Tests pay you back for your effort:
- When you are writing them. They help you to understand the problem you are attempting to solve, they reveal gaps in your knowledge, and lead you to useful questions.
- When they fail. They inform you of a defect, and if written well, specifically where that defect is.
- When they pass. When you are enhancing or refactoring the system, tests passing confirms that you are only making the changes you intend to make.
- When you read them later. Tests capture knowledge that might otherwise be lost. And their accuracy can be instantly confirmed at any time in the future, by running them.
TDD does not cause extra work. It is just the opposite; it is one effort that provides value in multiple ways.
This is Scott Bain. Visit us at www.netobjectives.com.