TDD (test-driven development) is a software development practice in which tests are written before the implementation code. It repeats a short cycle of writing a failing test (red), writing the minimal code that makes it pass (green), and cleaning up the code while preserving behavior (refactor); this cycle is known as red-green-refactor. Kent Beck systematized it in the late 1990s as a core practice of Extreme Programming (XP), and his 2003 book "Test-Driven Development: By Example" spread it widely.
Beck later summarized the canonical procedure, in which a list of scenarios to test is written first and worked through one at a time, under the name Canon TDD. In AI coding tools, TDD procedures are built into prompts or harnesses as a way to verify agent-generated code and keep the scope of each step small.