mutation_testing
Table of Contents
Sources:
- Software Testing course at ITMO university by Kochubeev Nikolay Sergeevich
Mutation testing
Mutation testing changes the code which is being tested. For example, if a unit test checks for “1+2=3”, the mutation might change the operator, which will result in code outputting “-1”. In that case, a unit test must fail. If the unit test passes, it means it's not sufficient enough for the code.
Metric: Mutation score
Mutation score: mutations killed/total mutations.
Score 100% is very rare. 70%-80% is a good result.
Best practices
- You should combine code coverage with mutation testing.
- Focus on the most critical parts of the code like business logic.
- Mutation testing is slow, it's better to launch it periodically.
mutation_testing.txt · Last modified: by plida
