Test-Driven Development as Design Technique¶
Writing tests before implementation forces consideration of interface design, usage patterns, and expected behavior before committing to implementation - the test becomes a first client that reveals design friction early.
Tension Addressed¶
Sensitivity vs. Stability
Recognizable As¶
Red-green-refactor cycle; tests committed before implementation; APIs designed from consumer perspective; small incremental commits alternating test and implementation
Canonical Sources¶
Beck, "Test-Driven Development" (2002); Freeman & Pryce, "Growing Object-Oriented Software, Guided by Tests" (2009)
Transfers To¶
Contract-first API design; specification-driven development; requirements-first project management; acceptance criteria before implementation
TDD's value is not primarily about test coverage - it's about using tests as a design feedback mechanism. Hard-to-test code often signals design problems: excessive coupling, hidden dependencies, or unclear responsibilities.
Related Concepts¶
- Coupling - Software Architecture