-
Notifications
You must be signed in to change notification settings - Fork 0
TDD
The essence of TDD entails the discipline to do the following:
-
Create a test suite that enables refactoring and is trusted to the extent the passage implies deployability. That is, if the test suit passes, the system can be deployable.
-
Create production code that is decoupled enough to be testable and refactorable.
-
Create a extremely short-cycle feedback loop that maintains the task of writing programs with a stable rhythm and productivity.
-
Create tests and production code that are sufficiently decoupled from each other so as to allow convenient maintenance of both, without the impediment of replicating changes between the two.
Write no production code until you have first written a test that fails due to the lack of that production code.
Write no more of a test that is sufficient to fail or fail to compile. Resolve the failure by writing some production code.
Write no more production code that will resolve the currently failing test. Once the test passes, write more test code.
First make it work. then make it right. The law of refactoring. First you write a small amount of failing test code. Then you write a small amount of passing production code. Then you clean up the mess you just made.