What Is Mutation Testing?
Mutation testing evaluates how good a test suite really is by making small, deliberate changes (mutations) to the code, then running the tests to see if they fail. A surviving mutation means the tests did not catch that change, revealing a gap. It measures the effectiveness of tests, not just how many lines they touch.
Why it matters
High code coverage can hide weak assertions: a test can execute a line without checking its result. Mutation testing exposes this by asking whether the tests would actually notice if the code were broken, giving a far more honest signal of test quality than coverage alone.
Related concepts
- More rigorous than line coverage
- A "killed" mutant means a test caught the change
- Computationally expensive, so often run selectively
Related guides
What Is Code Coverage?Code coverage measures the percentage of source code executed by a test suite, indicating which parts are exe…
What Is a Regression Test?A regression test verifies that previously working functionality still works after a change, catching newly i…
What Is a Flaky Test?A flaky test passes and fails intermittently on the same code, usually due to timing, ordering, or environmen…