Mutation Score
ELI5 — The Vibe Check
Mutation Score tells you how good your tests REALLY are — not just coverage, but whether they actually catch bugs. It inserts small bugs (mutations) into your code and checks if your tests fail. If they don't fail, your tests are useless even with 100% coverage. It's the honesty test for your test suite.
Real Talk
Mutation score is the percentage of code mutations (operator changes, condition inversions, statement deletions) detected by the test suite. A higher mutation score indicates more effective tests. Tools include Stryker (JS/TS), PIT (Java), and mutmut (Python). High computational cost limits it to critical code paths.
When You'll Hear This
"Our code has 90% coverage but only 60% mutation score — lots of tests aren't actually asserting anything." / "We run mutation testing on core business logic only — it's too slow for the whole codebase."
Related Terms
Branch Coverage
Branch Coverage measures whether your tests cover both the 'if' AND the 'else' of every decision in your code.
Statement Coverage
Statement Coverage is the simplest coverage metric: what percentage of your code lines were actually executed during tests?