Chapter 14. Test-Driven Java

The first example demonstrates the use of test-driven development to create a new application in Java. I call the project WebRetriever; it is basically a work-alike of a subset of the command-line curl(1)1 command found in most Linux distributions and Mac OS X. If you are not familiar with curl, it is a tool for retrieving content over the internet that can be specified as URIs, including authentication, cookie management, and many more features.


The project has the benefit of being relatively small and straightforward, yet ripe for a number of the techniques from the book, in no small part due to its use of the network and, more specifically, the Apache HttpClient2 library. ...

Get Quality Code: Software Testing Principles, Practices, and Patterns now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.