Justin Searls shares how he upgraded his AI coding agent (Claude Code) from simple red-green TDD to the dual-loop BDD approach. Simple red-green TDD caused agents to chase code coverage with unit tests while missing real integration correctness. The dual-loop approach starts each feature with a failing integration test (outer loop), drives implementation through unit-level red-green-refactor cycles (inner loop), then returns to verify the integration test passes. He provides a ready-to-use prompt for AGENTS.md files. He also notes with some irony that many developers who previously rejected TDD are now embracing it—not to validate their own code, but to verify AI-generated code.
Sort: