The Three Laws of TDD
Internalize Robert Martin's three laws of TDD that govern exactly when you may write production and test code.
Discipline Behind the Cycle
The red-green-refactor cycle becomes precise through three short rules known as the Three Laws of TDD, formulated by Robert C. Martin. They constrain exactly when you write code.
The First Law
Law 1: You may not write production code until you have written a failing unit test.
No code is added speculatively. Every line exists to satisfy a test.
All lessons in this course
- Introduction to TDD Cycle
- Writing Tests First
- Refactoring for Testability
- The Three Laws of TDD