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.
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.