میوٹیشن ٹیسٹنگ کوڈ میں جان بوجھ کر چھوٹے bugs ("mutants") متعارف کروا کر اور یہ جانچ کر کہ ٹیسٹس انہیں پکڑتے ہیں یا نہیں، ٹیسٹ سوٹ کی کوالٹی کا جائزہ لیتا ہے۔ یہ ناپتا ہے کہ ٹیسٹس اصل میں defects کو detect کرنے میں کتنے اچھے ہیں — coverage سے آگے بڑھتے ہوئے، جو صرف execution کو ناپتا ہے۔
میوٹیشن ٹیسٹنگ کیسے کام کرتی ہے
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
