selene
Installation
SKILL.md
Selene mutation testing guide
Mutation testing measures unit test effectiveness by modifying the syntax tree of your Go code and running tests against each change. Selene modifies operators such as arithmetic signs (+ to -), comparison boundaries (>= to >), boolean checks, and return values.
Core concepts
When Selene introduces an Abstract Syntax Tree (AST) mutation, it records one of four outcomes:
| Outcome | Description | Resolution |
|---|---|---|
KILLED |
At least one test failed on mutated code. | Expected outcome. The test suite detects the logic defect. |
SURVIVED |
All tests passed despite mutated logic. | Assertion gap. Add tests or assertions covering the specific logic. |
UNCOVERED |
No test executed the mutated block. | Coverage gap. Write test cases that reach this code path. |
TIMEOUT |
Mutation caused an infinite loop or hang. | Treated as killed. |
The overall mutation score measures the percentage of introduced defects caught by tests:
$$\text{Mutation Score} = \frac{\text{Killed Mutants}}{\text{Total Mutants}} \times 100%$$