Mutation testing
Changes the code on purpose and checks that some test fails; surviving mutants show tests that do not constrain behaviour.
Sub-techniques
2
| ID | Name | Description |
|---|---|---|
V1023.001 | Diff-scoped mutation | Mutate only lines changed in the PR to keep runtime bounded. |
V1023.002 | Mutation score gate | Fail when the score on changed code drops below a threshold. |
Craft it
- Run on one critical module first to see the runtime.
- Scope to changed lines on PRs.
- Treat each surviving mutant as a missing assertion, not a number to optimise.
Reverse engineer it
Signs that a codebase already runs this technique, and where to read how it is configured.
- stryker.conf, mutmut config or cargo-mutants in CI.
- Mutation reports uploaded as artifacts.
Where the scanned repositories configure it:
.github/workflows/*.ymlin 2 repositoriespackage.jsonin 1 repositoriespyproject.tomlin 1 repositoriesstryker.conf.jsonin 1 repositories
Detected by the scanner as: Mutation testing (tests that keep passing whatever the code does.)
Procedure examples
repositories that run it, most-starred first
| Repository | Tools | Runs in | Evidence |
|---|---|---|---|
| diegosouzapw/OmniRoute | stryker |
ci, local | .github/workflows/mutation-redundancy.yml jobs.stryker-nobail.steps[3] (Run S... |
| BerriAI/litellm | mutmut |
ci | .github/workflows/mutation-test.yml jobs.mutation.steps[11] (Run mutmut) |