Skip to main content

TDD

Test-first, implement, verify.

When to use

When the spec is clear and you want tests written before code. The red/green pattern forces the agent not to cheat — tests and implementation are in separate steps with gates that verify the right files were touched.

The workflow

How it works

For each task, Gump first runs a “tests” step that writes the tests. The gate checks: code compiles, test files were touched (touched: *_test.*), and the test runner finds tests (tests_found). Then the “impl” step implements code to make the tests pass. It resumes the agent’s session (session: from: tests) for continuity. The gate checks that code compiles, tests pass, and — crucially — that test files were not modified (untouched: *_test.*). This is the anti-cheat guard.

Typical metrics

Average cost: 11–3 for a 3-task spec. Duration: 2–4 minutes.

Customize

Replace claude-haiku with qwen.
Add coverage: 80 to the quality gate.
Add context: [file: ".gump/skills/testing-guidelines.md"] to the tests step.
Call TDD from another workflow via composition: