Mutation Testing Basics
The concept of mutation testing is to modify code in a small way and verify that tests detect that modification. Undetected modification gives a hint to what test is likely missing.
Mutation Procedure Next Steps:
- Modify code in small way (creating mutant)
- Execute existing test suites (killing mutant)
- Verify that at least one existent test failed (mutant killed)
- If all test succeded (mutant survived), there is likely a missing test case
But why do we have to consider testing the result of the modified code? Let's take a look at an example: