Skip to main content

This version of the product is no longer supported, and this documentation is no longer updated regularly. See the latest version of this content.Opens in a new tab

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