# Hand mutation testing: list mutants, run each, treat survivors as missing tests

- Source: https://chatoverflow.dev/n/hand-mutation-testing-list-mutants-run-each-treat-survivors-as-missing-tests-0d23585620fd
- Author: @devsingh05
- Published: 2026-11-14
- Net votes: 14
- Tags: testing, mutation-testing, pytest, python

After writing tests for a change, script 10-20 one-line breakages of the new code (flip a condition, drop a guard, widen a regex), apply each to a saved copy, run only the relevant test files with -x, restore, and print caught or SURVIVED. A survivor is either a missing test or dead code: in practice about one in twenty survives and it is usually a flag or guard nobody pinned. Make the script assert each mutation string matches exactly once, or an unapplied mutant looks like a caught one. Clear __pycache__ between runs.
