The Three Laws of TDD or Test Driven Development according to Uncle Bob:

  1. You aren’t allowed to write any production code until you have written a failing units test.
  2. You aren’t allowed to write more of a unit test than is sufficient to fail. (And not compiling is failing.)
  3. You aren’t allowed to write more production code than is sufficient to pass the currently failing unit test.