Mutation testing for Boolean rules: operator, negation and literal mutants
Mutation testing plants small deliberate bugs in a rule, such as swapping an operator, dropping a negation or replacing a literal, and asks whether the test suite notices. A mutant that no test fails on is surviving, and a surviving mutant is a gap in the suite.
Take the entry rule (member OR invited) AND NOT banned. An operator mutant swaps OR for AND: (member AND invited) AND NOT banned. A negation mutant drops the NOT: (member OR invited) AND banned. A literal mutant replaces an input by another or by a constant. Each mutant is a formula with its own truth table, and a test kills it when the test's expected result differs from what the mutant computes on that row. The engine's mutation report runs the suite against every mutant and classifies each as killed, surviving or equivalent, with a witness row for the survivors.
The classification is exact rather than sampled, because the mutants are formulas and the suite is a set of rows: the engine evaluates both. An equivalent mutant computes the same function as the original, for instance a reordering of operands, and no test can kill it; reporting it as equivalent rather than surviving is what keeps the mutation score honest. The score is the killed share of the non-equivalent mutants.
For a Boolean rule, mutation testing is the converse of coverage: coverage asks what the tests touched, mutation asks what they would catch. A suite that satisfies MC/DC usually kills the operator and negation mutants, because each independence pair is exactly the row where one condition's effect shows. The lesson on test design has the worked case, and the app offers to turn a survivor's witness into a new test.
Example
allow := (member OR invited) AND NOT banned · output
Exact checks
Truth table (8 rows)
| # | member | invited | banned | allow |
|---|---|---|---|---|
| 0 | FALSE | FALSE | FALSE | FALSE |
| 1 | FALSE | FALSE | TRUE | FALSE |
| 2 | FALSE | TRUE | FALSE | TRUE |
| 3 | FALSE | TRUE | TRUE | FALSE |
| 4 | TRUE | FALSE | FALSE | TRUE |
| 5 | TRUE | FALSE | TRUE | FALSE |
| 6 | TRUE | TRUE | FALSE | TRUE |
| 7 | TRUE | TRUE | TRUE | FALSE |
Plain-language reading
Beginnerallow 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, allow 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.
Intermediateallow 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, allow is false.
Advancedallow 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, allow is false.
Formal notation: (member ∨ invited) ∧ ¬banned
Logic diagram
The common slip
Counting equivalent mutants as surviving and chasing them. A mutant that only reorders operands cannot be killed by any test; the engine marks it equivalent, and time spent writing a test for it is wasted.
Questions
How many mutants does a rule have?
One per operator, negation and literal position, which grows with the rule's size; the entry rule has a handful. The report lists them all with their class, within the engine's limits.
What does a surviving mutant mean?
That the suite would not notice that specific change. The report gives a witness row on which the mutant and the original differ, which is the test to add.
Related
See also
- Mutation testing: meaning and examples
- Mutant in mutation testing: meaning and examples
- Lesson 12: Designing tests that find bugs (advanced, 15 min)
- MC/DC explained: modified condition/decision coverage for Boolean rules
- Turning a counterexample into a regression test
- Coverage is not correctness: tests still need expected results
- Entry rule: (member OR invited) AND NOT banned, checked every way
Testing and rules
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.