---
title: "Test quality · Agent Wranglers"
url: https://agentwranglers.se/playbook/testing/test-quality
updated: 2026-10-20
licence: "All rights reserved"
---

# Test quality

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

> Prove the tests would catch a bug. Use mutation testing, treat coverage as a floor, and review test code as carefully as the code it checks.

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

## Required

- [Make every test able to fail](https://agentwranglers.se/playbook/testing/test-quality/tests-can-fail): Every test must contain a check that fails when the behaviour breaks. Tests without assertions or with always-true checks are not tests.

## Recommended

- [Prove the tests catch bugs](https://agentwranglers.se/playbook/testing/test-quality/mutation-testing): Run mutation testing on the high-risk modules from the [risk list](https://agentwranglers.se/playbook/testing/test-strategy/test-by-risk). It changes the code on purpose and checks that at least one test fails for each change.
- [Treat coverage as a floor](https://agentwranglers.se/playbook/testing/test-quality/coverage-floor): Use line and branch coverage to find untested code and to stop it falling. Never treat a high number as proof of good tests.
- [Review tests like code](https://agentwranglers.se/playbook/testing/test-quality/review-tests): Review test code with the same care as production code. It must be clear, small and free of copy and paste.
- [Keep snapshot tests small and reviewed](https://agentwranglers.se/playbook/testing/test-quality/small-snapshots): Use snapshots only for small, stable output. Review every snapshot change like code, and never accept new snapshots without reading them.

- Previous: [Flaky and slow tests](https://agentwranglers.se/playbook/testing/flaky-and-slow-tests)
- Next: [Non-functional tests](https://agentwranglers.se/playbook/testing/non-functional-tests)
- [All chapters](https://agentwranglers.se/playbook/testing)
