Glossary

Mutation Testing

Mutation testing is a method for evaluating test quality: a tool automatically introduces small changes (mutations) into the code and checks whether existing tests detect them. If mutated code passes the tests — the tests are not thorough enough.

Typical mutations

Metric: Mutation Score

MS = killed mutants / total mutants * 100%. MS 80%+ is considered a good result. Differs from code coverage: 100% coverage does not guarantee detection of logic bugs.

Tools

PHP: Infection. JavaScript: Stryker. Java: PIT.

Cost

Mutation testing is slow — it runs the test suite for every mutant. Typically applied to critical parts of the code, not the entire project.