Red-Green-Refactor
ELI5 — The Vibe Check
Red-Green-Refactor is the TDD dance: Red means write a test that FAILS (it's red in the output). Green means write the MINIMUM code to make it pass (now it's green). Refactor means clean up your code without breaking the test. Repeat forever.
Real Talk
Red-Green-Refactor is the core cycle of Test-Driven Development. Red: write a failing test that describes desired behavior. Green: write the simplest code to make the test pass. Refactor: improve code structure while keeping tests green. The cycle enforces small, deliberate steps.
When You'll Hear This
"Follow red-green-refactor — don't skip to writing code before you have a failing test." / "In the refactor step, don't add new functionality — just clean up."
Related Terms
Refactoring
Refactoring is improving the internal structure of code WITHOUT changing what it does from the outside.
TDD (TDD)
TDD means you write the test BEFORE you write the code.
Test-Driven Development (TDD)
Test-Driven Development is a discipline where you write your tests before your actual code.
Unit Test
A unit test is like checking that one single LEGO brick isn't broken before you use it in your big castle.