Mutation Testing

Mutation testing validates that your tests actually catch bugs — not just achieve coverage.

How it works: The tool mutates your source code (e.g., changes < to <=, True to False, deletes a line) and re-runs your tests. If tests still pass, the mutant "survived" — meaning your tests have a blind spot.

The closed loop:

  1. Write tests
  2. Run mutation testing
  3. Examine surviving mutants
  4. Write additional tests to kill surviving mutants — all surviving mutants MUST be addressed
  5. Repeat until mutation score is acceptable

Mutation testing MUST be run before claiming "tests are complete."

Platform tools:

Platform Tool Install Run
Python mutmut pip install mutmut mutmut run
TypeScript/JS Stryker npm i -g stryker-cli npx stryker run
.NET Stryker.NET dotnet tool install -g dotnet-stryker dotnet stryker
Swift Muter brew install muter-mutation-testing/formulae/muter muter
Kotlin/JVM Pitest Gradle/Maven plugin ./gradlew pitest
version
1.0.0
platforms
csharp, kotlin, python, swift, typescript
tags
mutation-testing, testing
author
Mike Fullerton
modified
2026-03-27

Change History

Version Date Author Summary
1.0.0 2026-03-27 Mike Fullerton Initial creation