-
Book Overview & Buying
-
Table Of Contents
Test-Driven Development with Java
By :
Just as there are often overly pessimistic objections to TDD, here is an opposite view: TDD guarantees good code. As TDD is a process, and it claims to improve code, it is quite reasonable to assume that using TDD is all you need to guarantee good code. Unfortunately, that is not at all correct. TDD helps developers write good code and it helps as feedback to show us where we have made mistakes in design and logic. It cannot guarantee good code, however.
The issue here is a misunderstanding. TDD is not a set of techniques that directly affect your design decisions. It is a set of techniques that help you specify what you expect a piece of code to do, when, under what conditions, and given a particular design. It leaves you free to choose that design, what you expect it to do, and how you are going to implement that code.
TDD has no suggestions regarding choosing a long variable name over a short one. It does...