Agent Wranglers

Testable code Recommended

Keep most tests small and fast

Write many fast unit tests, fewer integration tests and a few end-to-end tests. The whole suite runs in minutes.

How to do it

Test rules and calculations with unit tests. Test database queries and outside services with integration tests against real or containerised services. Keep end-to-end tests for the main user journeys. For more depth, see the testing playbook.

How to check

The unit tests finish in seconds. The full suite stays under a set time limit, such as 10 minutes, and the CI job fails above it.

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 architecture playbook: https://agentwranglers.se/playbook/architecture/testable-code/test-pyramid.