Mutant in mutation testing: meaning and examples
A mutant is a copy of a rule with one small deliberate change. It is killed when some test gives a different result on the mutant than on the original, and it survives when every test passes on both.
Mutants are generated by mutation operators. For a Boolean rule the engine uses three kinds: operator mutants swap one connective for another, negation mutants add or remove a NOT, and literal mutants replace a variable with another or with a constant. Each mutant differs from the original on some set of truth-table rows, possibly none; a mutant that differs on no row is equivalent and cannot be killed. A test kills a mutant when its input lies on a differing row and its expected result is the original's.
The artefact on this page is one operator mutant beside its original: original = (member OR invited) AND NOT banned and operator_mutant = (member AND invited) AND NOT banned, the OR replaced by AND. The two columns differ on rows 2 and 4 only, the rows where exactly one of member and invited is true and banned is false. The equivalence check is violated with the counterexample member = FALSE, invited = TRUE, banned = FALSE: the original admits an invited non-member, the mutant does not. A suite kills it only if it contains one of those rows.
Mutants are small by design so that each one stands for one plausible mistake, such as writing && for ||; a suite that kills them all has at least checked those mistakes. Mutants with few differing rows are the hardest to kill and the most informative, as this one with two rows out of eight shows. The term is confused with a bug (a mutant is planted, not found) and with a variant written by a developer.
Example
original := (member OR invited) AND NOT banned · outputoperator_mutant := (member AND invited) AND NOT banned · output
Exact checks
Truth table (8 rows)
| # | member | invited | banned | original | operator_mutant |
|---|---|---|---|---|---|
| 0 | FALSE | FALSE | FALSE | FALSE | FALSE |
| 1 | FALSE | FALSE | TRUE | FALSE | FALSE |
| 2 | FALSE | TRUE | FALSE | TRUE | FALSE |
| 3 | FALSE | TRUE | TRUE | FALSE | FALSE |
| 4 | TRUE | FALSE | FALSE | TRUE | FALSE |
| 5 | TRUE | FALSE | TRUE | FALSE | FALSE |
| 6 | TRUE | TRUE | FALSE | TRUE | TRUE |
| 7 | TRUE | TRUE | TRUE | FALSE | FALSE |
Plain-language reading
Beginneroriginal is true exactly when both of the following hold:
1. at least one of member or invited is true (both may be true)
2. banned is false
In every other case, original is false.
About the operators:
- AND is true only when all of its parts are true.
- OR is inclusive: it is true when at least one part is true, including when several are.
- NOT reverses a value: true becomes false and false becomes true.
Intermediateoriginal is true exactly when both of the following hold:
1. at least one of member or invited is true (both may be true)
2. banned is false
In every other case, original is false.
Advancedoriginal is true exactly when both of the following hold [conjunction ∧]:
1. at least one of member or invited is true (both may be true) [inclusive disjunction ∨]
2. banned is false [negation ¬]
In every other case, original is false.
Formal notation: (member ∨ invited) ∧ ¬banned
The common slip
Testing only the “happy path” and the all-false case. Neither row 0 nor row 6 distinguishes this mutant from the original; only rows 2 and 4 do. A suite can pass on the original, pass on the mutant, and have tested nothing that separates OR from AND.
Questions
How does the engine decide whether a mutant was killed?
It evaluates each test case against the mutant and compares with the expected outcome; any mismatch kills it. Before that, it checks the mutant for equivalence with the original on every row, so that an equivalent mutant is reported as such rather than counted as surviving.
Related
See also
- Mutation testing: meaning and examples
- Mutation testing for Boolean rules: operator, negation and literal mutants
- Test oracle (expected result): meaning and examples
- Logical equivalence checker: two expressions, exact verdict, counterexample
- Logical equivalence: meaning and examples
- Entry rule slip: member OR (invited AND NOT banned) and the case that differs
Glossary
Generated from the Tangibool engine, semantics tangibool-semantics/1, engine 1.0.0, build . Every table, map, simplification and verdict on these pages was computed by the Tangibool engine when the site was built, and every claim was re-checked by the same exact checker the app uses. Limits are stated where they apply. © 2026 Foreranger LTD.