Concept · Technical basics

Red-green-refactor

Also called: red green refactor, test-driven development, TDD, test first

A way of writing code in three steps: write a test that fails (red), write just enough code to make it pass (green), then clean up the code while the test keeps passing (refactor).

For example: To fix a bug, a developer first writes a test that shows the bug, watches it fail, fixes the code until it passes, then tidies up.

Connects to 4

Page last changed · Suggest a correction