Red-Green-Refactor
red green refactor, tdd cycle, tdd loopDefinition
The three-step loop of TDD: write a test that fails (red), write the least code that makes it pass (green), then improve the code without changing its behavior while the test keeps it honest (refactor) — and go around again
Each step has a discipline the others depend on. Red proves the test can fail, so a green later means something. Green forbids gold-plating — the ugliest code that passes is correct here. Refactor is where design happens, and it is safe only because the bar is green when it starts and must be green when it ends. Skip red and the tests are decoration; skip refactor and the code is the first draft forever.
Minutes, not hours, per loop. The step size is the point: a red that took an afternoon to reach is a design decision that was made without the test's help.