Software Testing & QA (50 Qs)•Part 3: Advanced Internals, Scale & Production Quality (Senior / Lead)
Mutation Testing: Killing Mutants with Stryker to Measure Test Suite Quality.
senior LevelTestingGraphQL
In Simple Words:
Code coverage measures which lines ran, but not whether tests actually asserted correct behavior.
Mutation Testing (stryker):
- Stryker intentionally introduces small bugs (mutants) into your production code:
- Changes
if (a > b)toif (a >= b). - Changes
return truetoreturn false. - Removes a function call.
- Changes
- It runs your test suite against each mutant.
- If a test fails -> Mutant Killed (Test suite is effective!).
- If all tests still pass -> Mutant Survived (Your tests lack assertions!).
- Produces a Mutation Score Indicator (MSI) showing true test efficacy.