| inclusion | auto |
| name | qe-mutation-testing |
| description | Test quality validation through mutation testing, assessing test suite effectiveness by introducing code mutations and measuring kill rate. Use when evaluating test quality, identifying weak tests, or proving tests actually catch bugs. |
| tags | ["mutation","stryker","test-quality","kill-rate","assertions","effectiveness"] |
Mutation Testing
<default_to_action>
When validating test quality or improving test effectiveness:
- MUTATE code (change + to -, >= to >, remove statements)
- RUN tests against each mutant
- VERIFY tests catch mutations (kill mutants)
- IDENTIFY surviving mutants (tests need improvement)
- STRENGTHEN tests to kill surviving mutants
Quick Mutation Metrics:
- Mutation Score = Killed / (Killed + Survived)
- Target: > 80% mutation score
- Surviving mutants = weak tests
Critical Success Factors:
- High coverage ≠ good tests (100% coverage, 0% assertions)
- Mutation testing proves tests actually catch bugs
- Focus on critical code paths first
</default_to_action>
Quick Reference Card
When to Use
- Evaluating test suite quality
- Finding gaps in test assertions
- Proving tests catch bugs
- Before critical releases