# Red, Green, Refactor

The TDD loop: fail, pass, then tidy.

## What is **Red, Green, Refactor**?

**Red, green, refactor** is the TDD loop: write a failing test (red), make it pass (green), then clean up the code with tests still passing.

Level: Journeyman · [More Unit Testing terms at this level](https://www.ask-codey.com/glossary/subjects/unit-testing/journeyman)

Updated: September 27, 2026

Source: https://www.ask-codey.com/glossary/red-green-refactor
