Mutation Testing
A test-of-tests that injects small bugs into code and checks whether the existing suite catches them, exposing tests that assert nothing.
Mutation testing evaluates a test suite's actual effectiveness by deliberately introducing small, syntactic bugs — "mutants" — into the source code and rerunning the suite against each mutant. A mutant flips > to >=, changes a + to a -, deletes a line, or swaps a boolean. If the suite still passes against a mutated line, that line's coverage is a lie: some test executes it, but no assertion depends on what it actually does. If the suite fails, the mutant is "killed," and the ratio of killed to total mutants is the mutation score — a much harder number to game than Code Coverage.
The distinction from ordinary coverage is the whole point of the technique: Branch Coverage answers "did execution pass through this line," while mutation testing answers "would a test suite notice if this line were wrong." A test that calls a function and asserts nothing about its return value gets full line coverage and a mutation score of zero on that function — coverage rewards execution, mutation testing rewards verification, and the gap between the two numbers is exactly the population of tests that assert nothing, which a coverage-only gate can't see.
The practical cost is why mutation testing isn't run on every commit the way coverage is: generating and rerunning the suite against hundreds or thousands of mutants is computationally expensive, scaling with both codebase size and suite runtime, so most teams run it periodically or on a targeted subset rather than as a CI gate on every push. Tools (Stryker for JS/TS, PIT for Java, mutmut for Python) also have to work around "equivalent mutants" — a mutation that's syntactically different but semantically identical to the original (multiplying by 1 vs. leaving a value alone) — which can't be killed by any test because there's nothing wrong to detect, and which manual triage still has to distinguish from genuine coverage gaps.
See also3
Coverage Gate
A build check that fails when coverage falls below a threshold, and what that pressure produces.
Testing & Verification16 connections
Unit Test
A fast, isolated test of one unit of behavior with its collaborators replaced.
Testing & Verification25 connections
Test Oracle
Whatever decides whether a test's output is correct, and the often-overlooked hard part of testing when nobody knows the right answer in advance.
Testing & Verification11 connections
Related1
Nearby in the graph rather than deliberately chosen. Looser, sometimes surprising.
Linked from4
- Parameterized TestTesting & Verification
Running one test body against a table of inputs and expected outputs, so each case is a single readable row and each failure is reported on its own.
- Property-Based TestingTesting & Verification
Asserting a general property that should hold for all inputs, then letting the framework generate many random inputs to try to break it.
- Regression TestingTesting & Verification
Rerunning existing tests after every change to confirm that what used to work still works, how the suite grows one fixed bug at a time, and how teams keep it fast enough to run.
- Test OracleTesting & Verification
Whatever decides whether a test's output is correct, and the often-overlooked hard part of testing when nobody knows the right answer in advance.