Skip to main content

Red – Green – Refactor

The xUnit and %UnitTest test reporting GUIs report passed tests in green and failed tests in red. The following is, then, the rhythm of development using the test first approach to development:

  1. Red — Write a little test that doesn't work, and perhaps doesn't compile at first.

  2. Green — Make the test work quickly, committing whatever sins necessary in the process.

  3. Refactor — Eliminate all duplication created in merely getting the test to work.

— Kent Beck, Test Driven Design By Example

FeedbackOpens in a new tab