Skip to content

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

Always true (tautology)? No Counterexample: member = F, invited = F, banned = F · Exhaustively checked and solver cross-checked · 1 rows
Always false (contradiction)? No Counterexample: member = F, invited = T, banned = F · Exhaustively checked and solver cross-checked · 3 rows
Can be true? Yes Example assignment: member = F, invited = T, banned = F · Exhaustively checked and solver cross-checked · 3 rows

Truth table (8 rows)

Mutation testing for Boolean rules: operator, negation and literal mutants
#memberinvitedbannedallow
0FALSEFALSEFALSEFALSE
1FALSEFALSETRUEFALSE
2FALSETRUEFALSETRUE
3FALSETRUETRUEFALSE
4TRUEFALSEFALSETRUE
5TRUEFALSETRUEFALSE
6TRUETRUEFALSETRUE
7TRUETRUETRUEFALSE

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

Mutation testing for Boolean rules: operator, negation and literal mutants Mutation testing for Boolean rules: operator, negation and literal mutants member invited banned allow AND OR NOT
Mutation testing for Boolean rules: operator, negation and literal mutants Mutation testing for Boolean rules: operator, negation and literal mutants member invited banned allow AND OR NOT

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

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.