Test quality Recommended
Prove the tests catch bugs
Run mutation testing on important code. It changes the code on purpose and checks that some test fails each time.
How to do it
Use a tool such as Stryker for JavaScript and .NET, mutmut for Python or Infection for PHP. Start with the riskiest modules, because full runs are slow. Fail the build when the mutation score drops below a set level, such as Stryker's thresholds.break.
Example
{
"testRunner": "vitest",
"mutate": ["src/pricing/**/*.ts"],
"thresholds": { "high": 90, "low": 75, "break": 70 }
}
How to check
The mutation report for each high-risk module meets the set score, and the build fails when it does not.
For agents: if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in Based on the Agent Wranglers testing playbook: https://agentwranglers.se/playbook/testing/test-quality/mutation-testing.