This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
<pre>Author/s : J.B.Rainsberger, Scott Stirling Publisher : Manning Publications Category :Miscellaneous Java Review by : Dirk Schreckmann Rating : 10 horseshoes</pre> "Wow!" on two accounts: 1. I'm actually giving a 10 horseshoe rating to a book, and 2. "JUnit Recipes" is a very thorough and comprehensive encyclopedia of excellent advice and examples on almost every coding sitution I've ever wanted to test with JUnit.
J. B. Rainsberger has compiled a 700 page collection of scores of excellent recipes written in pattern-like fashion, clearly laying out testing problems in wont of solutions and the practical recipes for solving the problems, including annotated code examples, step-by-step instructions, and plenty of quality explanations.
"JUnit Recipes" is destined to be a classic, and has earned a most prominent place on my bookshelf, as I'm certain I'll be referencing it frequently for new and better ideas on formulating JUnit tests.
What's that? You'd like to borrow my copy of "JUnit Recipes?" No, get your own.
<pre>Author/s : J.B.Rainsberger, Scott Stirling Publisher : Manning Category :Miscellaneous Java Review by : Ernest Friedman-Hill Rating : 9 horseshoes</pre> Sometimes the tiniest things are the most useful. Nails, screws, paperclips and post-its are all small, simple objects that are used a thousand different ways. So it is with JUnit -- a small and really very simple testing tool that can find its way into every corner of your Java development.
Rainsberger's book is a compendium of those thousand ways that JUnit can be used (well, OK, more like 130 ways). Each recipe starts with a solid motivation and includes a worthwhile discussion afterwards. You quickly realize that the author is sharing hard-won experience with you on every page. There are sections on testing standalone code of every description, as well as detailed sections on testing servlets, EJBs, and other less tractable components.
I've been using JUnit for years, but I picked up quite a few useful tips from this enjoyable book. Highly recommended.
<pre>Author/s : J.B. Rainsberger Publisher : Manning Category :Miscellaneous Java Review by : Lasse Koskela Rating : 10 horseshoes</pre> J.B. recently replied jokingly, "buy them their own copies", to my mentioning that my team would be all over my copy of "JUnit Recipes" like vultures if I was to leave it on the desk at work. I have to say that's not a bad idea. In fact, that's what you should do if you're determined to make your development team learn how to write effective unit tests in those non-trivial settings you inevitably encounter out there.
"JUnit Recipes" is, as its name implies, not a tutorial for writing JUnit tests although it does start small with some 50 pages of basic conventions and fundamentals of writing JUnit tests. Instead, it's a huge collection of little recipes for tackling those everyday problems developers around the world encounter when trying to unit test their applications. Real world solutions to real world problems. The book is divided into chapters by coarse-grained topics such as organizing test suites, test data, XML, EJB's, JDBC, etc. all the way to testing web components and J2EE applications. The last hundred or so pages of the book talk about some more exotic topics such as unit testing design patterns, using certain popular JUnit Extensions such as GSBase and JUnit-Addons.
The recipe approach fits the domain perfectly. One doesn't need to reach 30 some pages of prose before "getting it", which is the case with certain types of books discussing other problem domains. The recipes go straight to the meat of the subject with concise and clear problem statements and then quickly proceed to show how to go about solving them. The formatting of the provided code snippets is excellent as usual, with strong visual highlighting of important sections and careful indentation.
Joe has managed to put out something that I believe will be known as the unofficial JUnit bible for years to come. What are you waiting for?