Originally posted by Gian Franco Casula: I've started to read other literature on the subject of JUnit and having read the first chapters I can't yet see how the idea of a recipe can be applied to help the programmer in a specific situation.
The recipes stand for problems a developer might face while using JUnit, such as "how to test a method with void return type" or "how should I organize my tests" and discuss their solutions.
Does this help you see how the idea of a recipe might help you?
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Suppose you have a specific problem, like you want to test a legacy container-managed persistence entity bean. Suppose further that you want to test it as much as possible without using the container. Now that you have defined the problem, you look for a solution. _JUnit Recipes_ might have a solution. (In this case, it does: recipe 11.5)
The principal difference between this book and others is its focus: you have a problem, you look for a solution. With other books, you'd perhaps look through the index, then see whether any entries are relevant. With _JUnit Recipes_, simply scan the table of contents to find the most similar problem to yours, then read the corresponding solution to see whether it helps.
Author of <a href="http://www.amazon.com/exec/obidos/ASIN/1932394230/ref=jranch-20" target="_blank" rel="nofollow">JUnit Recipes: Practical Methods for Programmer Testing</a>