
JSON Reporter for Mutation Testing
JSONMutationReporter.RdA quiet reporter that writes a machine-readable JSON artifact. It prints
nothing while running; on completion it writes one JSON file describing every
mutant, keyed by source file. The JSON is the data contract consumed by
dashboards, CI job summaries, and the HTML report (see
report()).
Combine it with ProgressMutationReporter via MultiReporter to get a live console display and a JSON file from the same run.
See also
Other MutationReporter:
MultiReporter,
MutationReporter,
ProgressMutationReporter,
default_reporter()
Super class
muttest::MutationReporter -> JSONMutationReporter
Public fields
pathPath of the JSON file to write.
mutants_by_filePer-file lists of mutant records.
sourcesPer-file original source lines.
Methods
Inherited methods
muttest::MutationReporter$cat_line()muttest::MutationReporter$end_file()muttest::MutationReporter$end_mutator()muttest::MutationReporter$get_score()muttest::MutationReporter$rule()muttest::MutationReporter$start_file()muttest::MutationReporter$start_mutator()muttest::MutationReporter$update()
Method new()
Initialize a new JSON reporter
Usage
JSONMutationReporter$new(path = "muttest.json", ...)Arguments
pathPath of the JSON file to write (default:
"muttest.json")....Passed to the MutationReporter constructor.
Method add_result()
Add a mutation test result
Usage
JSONMutationReporter$add_result(
plan,
killed,
survived,
no_coverage,
errors,
error = NULL,
original_code = NULL,
mutated_code = NULL
)Arguments
planCurrent testing plan. See
muttest_plan().killedWhether the mutation was killed by tests
survivedNumber of survived mutations
no_coverageNumber of mutants with no test coverage
errorsNumber of errors encountered
errorOptional error condition from a failed run
original_codeOriginal source lines before mutation
mutated_codeMutated source lines