Pavel has posted 3 posts at DZone. View Full User Profile

The Art of Unit Testing in Java - review

07.20.2010
| 9574 views |
  • submit to reddit
Published by: Manning
ISBN:

Reviewer Ratings

Relevance:
4

Readability:
4

Overall:
4

Buy it now

One Minute Bottom Line

This book offers a great introduction to Java Unit Testing. Only select chapters are available right now, so this review is not based on the whole book. There will hopefully be some important advanced topics covered in later chapters.

Review

I recently had the opportunity to read the first few chapters of “The Art of Unit Testing in Java” by Roy Osherove and Lasse Koskela. What follows is a review of those chapters.
 
The book is distributed as an early access pdf which is both good and bad. The good part is that we get the book at an early stage, the bad part is that we don't get the advantage of the editing done by the publisher. For that reason I will not comment on things such as font choices, occasionally bad formatting and some poor language choices since I expect those issues to be resolved in the final version.

The book's title promises an overview of unit testing in Java and the table of contents as described on the book's website appears to fulfill that promise. The book first covers the basics (what a unit test is and why it is a good thing), then advanced topics (stubbing and mocking), and finally aesthetics (how to write good tests) and politics (how to integrate unit testing into organizations and projects).

At the time of this review only the first three chapters were released. These described what a unit test is, how they differ from integration tests and why they are needed. A JUnit (the primary unit testing framework) tutorial and a stubbing introduction were also provided. The text gives good coverage on the topics that it has introduced so far and explains the basics well. I am especially pleased with the dependency injection introduction in the third chapter since I find it to be a very important topic both for testing and good design.

The book has no real weaknesses at this point and, if the authors keep the same quality throughout the rest of the book, it will be a great read for novices (the early parts) and experts (the latter parts) alike. I am looking forward to reading the rest of the book.
Published at DZone with permission of its author, Pavel Rozenblioum.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Comments

Jörg Buchberger replied on Tue, 2010/07/20 - 12:24pm

;-)

One might like to add that this book is the Java edition of "The Art of Unit Testing". The first edition with Examples in .NET was released in 2009. Apart from the examples and illustrations, the two editions are pretty much identical in structure and content (word-by-word copy). Suffice to say, that there is already another decent review on dzone for the _complete_ first edition.

FWIW, any complete edition of this book will pay off, if your intent is to introduce unit testing to your team or in your project - as the latter part of the book goes way beyond mere technical aspects of unit testing.

Cheers.
Jörg

Pavel Rozenblioum replied on Tue, 2010/07/20 - 1:00pm in response to: Jörg Buchberger

Well, the table of contents is more or less the same so you seem to be correct. On the other hand, it is one year later so the authors might've learned something new:) We'll see when the rest of the Java edition comes out.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.