Mutation testing एक test suite की गुणवत्ता का मूल्यांकन करती है, code में जानबूझकर छोटे bugs ("mutants") पेश करके और जाँचकर कि tests उन्हें पकड़ते हैं या नहीं। यह मापती है कि tests वास्तव में defects का पता लगाने में कितने अच्छे हैं — coverage से आगे जाकर, जो केवल execution मापती है।
Mutation testing कैसे काम करती है
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
