I\'m about to start out my first TDD (test-driven development) program, and I (naturally) have a TDD mental block..so I was wondering if someone could help guide me on where
When I was starting with TDD, I read these 3 rules by Uncle Bob that really helped me out:
- You are not allowed to write any production code unless it is to make a failing unit test pass.
- You are not allowed to write any more of a unit test than is sufficient to fail; and compilation failures are failures.
- You are not allowed to write any more production code than is sufficient to pass the one failing unit test.
In a shorter version it would be:
- Write only enough of a unit test to fail.
- Write only enough production code to make the failing unit test pass.
as you can see, this is very simple.