Testing and quality loops

5
Red-green TDD, flaky-test hunts, refactors under tests and dependency upgrades, each kept honest by the test suite.
Loops › Testing and quality
1
Writes failing tests first, then implements without touching the tests until they pass.
Claude Code, Codex, Cursor and other coding agents · Stops when: all the new tests pass and none were weakened
2
Finds tests that pass and fail at random and fixes the root cause instead of retrying them.
Claude Code, Codex, Cursor and other coding agents · Stops when: the test passes on every one of many runs
3
Small refactors that keep behaviour identical, reverting any step that turns a test red.
Claude Code, Codex, Cursor and other coding agents · Stops when: the refactor is complete with the suite green throughout
4
Upgrades a dependency in small steps against a test baseline, so you know exactly what broke.
Claude Code, Codex, Cursor and other coding agents · Stops when: the target version is in and the baseline still passes
5
Fills coverage gaps, finds tests that verify nothing, and injects failures into dependencies.
Claude Code, Codex, Cursor and other coding agents · Stops when: coverage and mutation targets are met