Survived mutants
What a mutation-survived finding of fallow mutation means, why it matters and how to fix it.
What it reports
A small code change made no test fail.
Mutation testing explains how fallow finds it.
Why it matters
fallow mutation makes one small change to the code, such as >= to >, and runs the tests that reach the changed line. A survived mutant is a change that made no test fail, so the tests do not check that behavior. The CI integrations report a survived mutant on a changed line as a warning finding (CodeClimate severity minor). The finding names the operator, the function and the mutant id, and never the source text. A mutant that no test reaches (no_coverage) is not a finding. No rules.* key gates the finding: the mutation score gate (--min-score or mutation.minScore) decides the exit code.
Example
The tests call isAdult(30) and isAdult(10) only. Changing >= to > in isAdult makes no test fail, because no test checks the age 18.
Fix
Add or change a test so that it fails on this change. To see the code, run fallow mutation inspect with the mutant ID that the finding names.
Facts
| Fact | Value |
|---|---|
| Issue type | mutation-survived |
| Rule id in SARIF output | fallow/mutation-survived |
| Command | fallow mutation |
Fixable with fallow fix | No |