see https://www.xing.com/profile/Joerg_Buchberger and/or LinkedIn profile Jörg has posted 9 posts at DZone. View Full User Profile

The Art of Unit Testing in Java - Early Access Book Review

08.26.2010
| 6841 views |
  • submit to reddit
Published by: Manning Publications
ISBN: 9781935182573

Reviewer Ratings

Relevance:
5

Readability:
4

Overall:
3

Buy it now

One Minute Bottom Line

This review is based on an incomplete early access version of the book, which had only the first three out of nine chapters available. I think some of the most interesting chapters will fall into the six that are still in the works. Do not read this book if you already read The Art of Unit Testing with Examples in .NET because this is almost an exact word-by-word copy. The only difference is that the .NET and NUnit examples are replaced by Java and JUnit, respectively. The available chapters are simple, filled with good detail, and offer a great introduction into unit testing.

Review

The aim of this book is to give an introduction to Java developers who have little or no experience with unit testing. The author does a sound job of covering the basic principals of unit testing. The pretension also seems to be to answer why unit testing is necessary and how it is integrated into teams and projects. The author clearly aims to see beyond the backyard.

This book would be helpful for introducing unit testing practices to teams and projects that are not yet using unit testing. Experienced developers could do without part 1 and 2 (the first 5 chapters) of this book. Based on the table of contents, they would only benefit from part 3 and the appendices, since that is where there will be any advanced coverage.

Other unit testing frameworks that are very relevant to Java development are not mentioned in these first three chapters and it is unclear to me whether or not they will be covered. Here is table of contents from the book's website:

Part I - Getting started

  • The basics of unit testing - FREE
  • A first unit test - AVAILABLE

Part II - Core techniques

  • Using stubs to break dependencies - AVAILABLE
  • Interaction testing using mock objects
  • Isolation (mock object) frameworks

Part III - Structure and aesthetics
  • Test hierarchies and organization
  • The pillars of good tests     Part IV - Implementation
  • Integrating unit testing into the organization
  • Working with legacy code

Appendices

  • Design and testability
  • Extra tools and frameworks
  • Dynamic languages on the JVM
  • Speeding up test execution

I think the readability, in terms of the layout and the fonts used, of this book is not as high quality as the .NET and NUnit version.

As a developer who uses a test-driven approach whenever possible, I am always eager to improve my knowledge on unit testing. Since the book's title contains the word "Art", I was expecting more advanced insight and was very disappointed to see that the available chapters only cover the most basic aspects of unit testing.

In conclusion, if you want an introduction to unit testing or if you are planning to get your team started with unit testing, this book may be for you. Before you purchase it, decide if it's right for you by reading the first chapter - it's free on the book's website.

 

Related Resources

Published at DZone with permission of its author, Jörg Buchberger.

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