Surviving Mutant Revealed a Targeting Flaw, Not a Weak Test
A developer running mutation testing on a Rust project found that 8 of 9 mutants were killed, but one survived — initially suggesting a weak test. The surviving mutant had altered a field inside a serialized byte blob, which the test never decoded because it was designed to assert only on the outer envelope layer. Further investigation confirmed the test was correct; the mutation simply landed outside the assertion's observable scope. Swapping the mutation to a field the test actually reads caused an immediate failure, proving both the tool and the test were functioning properly. The episode highlights a key distinction in mutation testing: a surviving mutant can indicate either a weak assertion or a misplaced mutation target, and conflating the two can lead to over-engineering tests that break layer boundaries unnecessarily.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in