Expand description
Mutation testing as evidence: after a passing verdict, the attempt’s changed code is mutated and the tests run against each mutant. A mutant the tests do not catch (“survivor”) is code the tests do not really check — the shape of a test written to pass rather than to verify.
[mutation] tool = "cargo-mutants" runs cargo mutants --in-diff on
the attempt’s patch. tool = "command" runs any tool that writes the
standard mutation-testing JSON report (Stryker, Infection, PIT with its
plugin, …): argv may use {diff}, {out}, {files} (one argument per
changed source file) and {files_csv}, and report names the JSON file.
mode = "report" (default) records the result as evidence; "require"
fails the verdict when mutants survive, and the retry digest names them.
The same tool measures the acceptance set’s strength: the
mutants run against the acceptance command only (run_against).
suite = false keeps the tool for that alone; acceptance_argv is the
command tool’s invocation then, with {tests} for the acceptance
command.
Structs§
- Config
[mutation].
Enums§
Functions§
- acceptance_
invocation - The argv that mutates the changed code and runs
acceptanceagainst each mutant;Err: why it cannot be measured. - cargo_
test_ args - What
cargo mutantspasses tocargo testto run onlyacceptance(cargo test --test accept→--test accept);Nonewhen the acceptance command is not acargo test. - changed_
sources - Source files a patch changes (
+++ b/<path>), tests excluded. - failure
- The verdict reason for survivors (
mode = "require"), if any; a tool that could not run is a failure too (no evidence is not good evidence). - from_
cargo_ mutants - The result of
cargo mutants(mutants.out/outcomes.json). - from_
report_ schema - The result in the mutation-testing report schema (Stryker and others):
files.<path>.mutants[].status—Killed,Survived,NoCoverage,Timeout,CompileError,RuntimeError,Ignored. - parse
- Reads
[mutation];Nonewhen absent. - run
- Runs
config’s tool onpatchinproject;Nonewhen the patch changes no source file. Scratch files go totmp, outside the worktree. - run_
against runwith the mutants judged byacceptancealone: the result asrun’s, or{"error"}when it cannot be measured.- source_
patch patchwith only the sections of changed source files: test files — the acceptance tests among them — removed.- trailer
- The commit trailer value.