म्यूटेशन टेस्टिङ्गले कोडमा जानीजानी साना बग्स ("mutants") को परिचय गरेर र परीक्षणहरूले तिनलाई पक्र सक्छन् कि भनी जाँच गरेर परीक्षण सुइटको गुणस्तर मूल्यांकन गर्छ। यसले परीक्षणहरूले वास्तवमा कतिसम्म दोषहरू पत्ता लगाउन सक्छन् भनी मापन गर्छ — कभरेज भन्दा बढी, जो केवल कार्यान्वयन मापन गर्छ।
म्यूटेशन टेस्टिङ्ग कसरी काम गर्छ
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
