---
title: "Prove the tests catch bugs · Agent Wranglers"
url: https://agentwranglers.se/playbook/testing/test-quality/mutation-testing
updated: 2026-10-20
licence: "All rights reserved"
---

# Prove the tests catch bugs

By Erik Bergstedt, Agent Wranglers. Updated 2026-10-20.

- Level: Recommended
- Chapter: [Test quality](https://agentwranglers.se/playbook/testing/test-quality)
- Rule: Run mutation testing on important code. It changes the code on purpose and checks that some test fails each time.
- How: 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`.
- Check: The mutation report for each high-risk module meets the set score, and the build fails when it does not.

Example:

```json
{
  "testRunner": "vitest",
  "mutate": ["src/pricing/**/*.ts"],
  "thresholds": { "high": 90, "low": 75, "break": 70 }
}
```

**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`.

- Next: [Treat coverage as a floor](https://agentwranglers.se/playbook/testing/test-quality/coverage-floor)
- [Test quality](https://agentwranglers.se/playbook/testing/test-quality)
