Mutation testing evalueert de kwaliteit van een test suite door opzettelijk kleine bugs ("mutanten") in de code in te voeren en te controleren of de tests deze opvangen. Het meet hoe goed tests werkelijk zijn in het detecteren van defecten — verder gaan dan coverage, die alleen execution meet.
Hoe mutation testing werkt
1. A tool makes small changes (MUTATIONS) to the code, e.g.:
→ change + to -, > to >=, true to false, remove a statement, change a constant
→ each mutation = a deliberate "bug" (a MUTANT version of the code)
2. Run the TEST SUITE against each mutant:
→ tests FAIL → the mutant is "KILLED" (good — tests caught the bug) ✓
→ tests PASS → the mutant "SURVIVED" (bad — tests DIDN'T catch the bug) ✗
3. MUTATION SCORE = % of mutants killed → measures how good the tests are at catching bugs
