Test strategy
Decide what to test before writing tests. Spend the effort where bugs would hurt most, keep most tests small, and ship every change with its tests.
- Required 3
Required
Test what would hurt to break
RequiredPut the most tests where a bug would cost money, data or trust. Code that cannot break silently needs few tests.
Shape the test suite like a pyramid
RequiredWrite many small, fast tests and only a few slow, wide ones. Each kind of test checks what only it can check.
Ship tests in the same change
RequiredEvery change that adds or changes behaviour includes the tests for it. A bug fix starts with a test that fails before the fix.
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-strategy.