Mutation Sets
Mutagoph provides four mutation sets with increasing intensity.
Overview
| Set |
Operators |
Description |
lite |
4 |
Fast feedback - essential mutations only |
standard |
9 |
Balanced coverage for regular use |
thorough |
13 |
Comprehensive mutation testing |
mutilated |
23 |
All operators - maximum coverage |
lite
Fast feedback with essential mutations. Best for watch mode and quick checks.
mutagoph run --mutations lite
Operators: arithmetic_replace, comparison_replace, literal_replace, bool_replace
standard
Balanced coverage for regular use. Good for CI and pre-commit checks.
mutagoph run --mutations standard
Includes all lite operators plus: arithmetic_delete, comparison_boundary, logical_replace, assign_replace, bitwise_replace
thorough
Comprehensive mutation testing. Good for release validation.
mutagoph run --mutations thorough
Includes all standard operators plus: string_replace, bitwise_assign, statement_delete, return_replace
mutilated (default)
All 23 operators for maximum coverage. Best for comprehensive analysis.
mutagoph run --mutations mutilated
Includes all thorough operators plus: condition_negate, condition_remove, else_remove, loop_break, call_silence, return_remove, slice_boundary, switch_case, loop_condition, loop_range_break
Choosing a Set
| Scenario |
Recommended Set |
| Development (watch mode) |
lite |
| PR validation |
standard |
| Release testing |
thorough or mutilated |
| Finding all gaps |
mutilated |
| CI with time constraints |
standard |
All Mutation Operators
Arithmetic
| Operator |
Description |
Example |
arithmetic_replace |
Replace arithmetic operators |
a + b → a - b, a * b → a / b |
arithmetic_delete |
Remove one operand |
a + b → a |
Comparison
| Operator |
Description |
Example |
comparison_replace |
Replace comparison operators |
a == b → a != b, a < b → a > b |
comparison_boundary |
Modify boundary conditions |
a < b → a <= b, a >= b → a > b |
Logical
| Operator |
Description |
Example |
logical_replace |
Replace logical operators |
a && b → a \|\| b, !x → x |
Bitwise
| Operator |
Description |
Example |
bitwise_replace |
Replace bitwise operators |
a & b → a \| b, a << 1 → a >> 1 |
bitwise_assign |
Replace bitwise assignment |
a &= b → a \|= b, a ^= b → a &= b |
Literals
| Operator |
Description |
Example |
literal_replace |
Replace numeric literals |
0 → 1, 42 → 43, -1 → 0 |
bool_replace |
Flip boolean literals |
true → false, false → true |
string_replace |
Replace string literals |
"hello" → "", "foo" → "mutated" |
Statements
| Operator |
Description |
Example |
statement_delete |
Delete statement entirely |
x = 5 → (removed) |
return_replace |
Replace return with zero value |
return x → return 0, return err → return nil |
Assignment
| Operator |
Description |
Example |
assign_replace |
Replace assignment operators |
x += 1 → x -= 1, x *= 2 → x /= 2 |
Conditionals
| Operator |
Description |
Example |
condition_negate |
Negate condition |
if x > 0 → if !(x > 0) |
condition_remove |
Remove conditional, keep body |
if x { body } → body |
else_remove |
Remove else branch |
if x { a } else { b } → if x { a } |
Loops
| Operator |
Description |
Example |
loop_break |
Swap break and continue |
break → continue, continue → break |
loop_condition |
Modify loop condition |
for i < n → for true, for i < n → for false |
loop_range_break |
Add break to range loop |
for range x { body } → for range x { body; break } |
Expressions
| Operator |
Description |
Example |
call_silence |
Silence function call result |
f() → _ = f() |
return_remove |
Remove return statement |
return x, err → (statement removed) |
slice_boundary |
Modify slice boundaries |
s[:2] → s[:1], s[1:] → s[2:] |
Switch
| Operator |
Description |
Example |
switch_case |
Remove or swap switch cases |
case x: body → case x: (body removed) |