Test-Driven Development (TDD)
Status: draft · Confidence: medium (0.635) · Basis: verified_sources
Quality notes: generic_source_homepage, no_verified_sources, partial_source_verification
## TL;DR TDD (Kent Beck, 2002) is a development practice: write a failing test → write minimum code to pass → refactor. Red-Green-Refactor cycle. TDD ensures testability, drives design toward small, loosely coupled units, and provides a regression safety net. Not about testing — it's about design. ## Core Explanation Red: write test, run, see it fail (confirms test catches failures). Green: write minimum code to pass test — no more. Refactor: clean up code while tests stay green. Benefits: 40-80% fewer bugs in production (IBM/Microsoft studies), confidence to refactor, living documentation. Outside-in TDD (mockist/Detroit school) vs. Inside-out TDD (classicist/London school). ## Further Reading - [Test-Driven Development: By Example (Kent Beck)](undefined) ## Related Articles - [AI for Science: AlphaFold and the AI-Driven Discovery Revolution](../../ai/ai-for-science.md) - [AI for Software Testing: Automated Test Generation, Fuzzing, and Quality Assurance](../../ai/ai-for-software-testing.md) - [AI for Weather Forecasting: Data-Driven Numerical Weather Prediction and Nowcasting](../../ai/ai-for-weather-forecasting.md)