This site will look much better in a browser that supports web standards, but it is accessible to any browser or Internet device.

The Open Source Zone


Unit Testing in Java: How Tests Drive the Code (The Morgan Kaufmann Series in Software Engineering and Programming)

Book cover

by Johannes Link

ASIN: 1558608680

See more on Amazon.com

Average Customer Review: 4.5, based on 9 reviews.

Customer reviews (5 of 9)

Useful, but not the definitive book on unit testing, 2005-12-31, Rating: 4.

This was the second unit testing book that I read after Hunt & Thomas's /Pragmatic Unit Testing/, and it did an admirable job helping me progress beyond the basics. It has especially good overviews of Test-Driven Development, the guts of JUnit, and mock objects. I found it less useful (i.e. less detailed) when it turned to testing J2EE and database functionality. I found J.B. Rainsberger's /JUnit in Action/ a much more authoritative reference. But this book got back on track at the end with its sections on HTML and GUI testing, which fill in a lot of the gaps in Rainsberger's book. In the end, I give both books 4 stars because they complement each other well, although /JUnit in Action/ is, by far, a much better overall reference.

Practical unit test theory and implementation, 2004-11-19, Rating: 5.

For a short book like this I'm very impressed with it's breadth of coverage. It stars by covering JUnit and the test first methodology. It then covers testing a variety of types of code, including very notably HTML and GUI code. The last chapter, which is one of it's best is on the importance of unit testing in the entire lifecycle of development. This is an instant classic in the under-covered world of unit testing. A must buy for both QA and Developer alike.

Clear and practical, 2004-08-24, Rating: 5.

This is a very readable introduction to unit testing, a good first book for anyone wanting a sound approach to software testing.

The main text is divided into two parts. The first is a clear introduction to the basics of the JUnit test framework. The pace is gentle, and the entire discussion is built around sample code - very helpful for the beginner who thinks in concrete terms. Link (the author) omits the JUnit API information that's already available in JUnit's JavaDoc pages. Those are just the basic words available in the framework; Link's goal is to put them together into meaningful test phrases. Throughout this half of the book, the reader is shown a number of common situations with non-obvious solutions. At each step, Link presents a little theory (plus some nice references), a little refactoring to improve the system's testability, and enough sample code to make the solution clear. This isn't a textbook on the theory of testing. Still, by the end of this first section, the reader has been exposed to many ideas: coverage metrics, internet resources, design and implementation for testability, and a lot more.

The book is heavily oriented towards Java, partly because of the relative wealth of test tools available and because of Java features and APIs that support automated testing. Having chosen Java, it is natural to ask testing for unique features of the Java environment: GUIs, persistence, EJB, servlets, RMI, and more. Link covers those in the book's second half. Many of these chapters are specific to Java technologies and APIs. Some, like the GUI discussion, have value beyond the Java specifics they discuss. Even if the language and APIs change, many of the techniques will work well in any GUI programming environment. This section ends at a strategic level: introducing testing into existing workflows, handling of legacy systems, and management issues.

Link has written a very helpful introduction to testing. It has enough specifics to get a beginner started, or to help an old hand deal with the problems of complex systems. The book's practical orientation skips a lot of the history and theory of testing, including tests that deal with qualitative performance issues rather than basic correctness. Anyone reading this book by itself might not realize just how broad and deep the subject really is. Link does at least mention the major ideas in the field, though, and prepares the reader for more advanced discussions.

//wiredweird

Practical and Informative, 2004-07-09, Rating: 4.

I like this kind of book. It is practical and informative without being wordy or pretentious. It introduces test-driven development with a focus on Java and Java tools, but its lessons can be applied fairly well to any OO language such as C#, C++, Python etc. The book covers a pretty broad range of topics including an introduction to the principles of test-first development, mock objects, persistence, Web development, EJBs, and user interfaces, among others. Each topic is covered in sufficient detail to get started and points out the hazards one should be aware of. This book is also well-researched and contains a good list of references. Overall this is a solid, well-organized effort that deserves space on the bookshelf of any developer getting into test-driven development.

Great introduction to Unit Testing, 2004-04-30, Rating: 4.

Very good book for mastering the basics. Covers quite a bit of ground in a short period. Lots of references and examples make it easy to understand. I have worked with unit testing using JUnit for a couple of years and also enjoy the site www.developertesting.com by the folks at Agitar Software. I have recently taken unit testing to a new level using the Agitator, see www.agitar.com I highly recommend it!

See more reviews on Amazon.com...