ruby.sidebar.ThreeLawsOfTddRevisited

The Three Laws of TDD Revisited Here are Robert Martin's three laws of TDD written from a BDD perspective:
 * 1) Write no production code without a failing Example
 * 2) Write only enough of an Example sufficient for it to fail (not compiling is failing)
 * 3) Write only enough production code to get the single failing Example to pass

These rules are not enough to effectively write code using either BDD or TDD. Here are a few more things to take into consideration:
 * Keep your code clean: as you notice unruly code, tame it. However, do this only when your Examples are all passing
 * Keep existing Examples passing
 * When you are looking at code, apply a critical eye and look for violations of sound design principles. (What are those principles? The tutorial will describe violations as they become ugly enough to warrant taking your time to discuss them.)