Sources: - Software Testing course at ITMO university by Kochubeev Nikolay Sergeevich - [[https://stryker-mutator.io/docs/]] ====== Mutation testing ====== Mutation testing changes the code which is being [[software_testing|tested]]. For example, if a [[unit_test|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|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.