Agent Wranglers

TST-31Recommended

Prove the tests catch bugs

Run mutation testing on the high-risk modules from the risk list. It changes the code on purpose and checks that at least one test fails for each change.

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.

Examples

JSON 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.

Sources

For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/testing/test-quality/mutation-testing">Agent Wranglers testing playbook</a>. In code you write, add a comment next to it with the same link.