Unit Testing in Java: How Tests Drive the Code

Testing is important. All software developers know it, but (hardly) anyone does it. [1] Luckily, you have bought this book and therefore don't belong to this ignorant crowd ;-)
There are many reasons for the poor interest of programmers in the quality of their own products. Education plays an important role. Academically educated computer scientists hear of the fact that software has to be tested mostly as a theoretical topic within their two-semester software course. The autodidacts among programmers normally find nothing in their textbooks and programming books, except a note that programs should "of course" be thoroughly tested. Only you won't find how and why in these books, with a few praiseworthy exceptions, like those by Hunt and McManus [98] and Larman and Gutherie [00].
Eventually, developers build their own stock of prejudices and reasons reinforcing their dislike for testing. Here a few examples.
"I have no time for testing."
This frequently heard sentence assumes that testing takes a great deal of time. If you believe this, you will be caught in a vicious circle. The greater the time pressure, the fewer tests; the fewer tests, the more unstable your code. The more unstable your code, the more error reports will fly in from customers. The more error reports, the more debugging time will be required. The more debugging time, the greater the time pressure. ...
On the other hand, if you believe that tests stabilize your code, then this vicious circle will turn into an...