Two Laptop Bag*
The moose likes Testing and the fly likes Q 4 J. B. Rainsberger (2):  preconditions for a recipe Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Q 4 J. B. Rainsberger (2):  preconditions for a recipe" Watch "Q 4 J. B. Rainsberger (2):  preconditions for a recipe" New topic
Author

Q 4 J. B. Rainsberger (2): preconditions for a recipe

Gian Franco
blacksmith
Ranch Hand

Joined: Dec 16, 2003
Posts: 977
Dear author,

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.

Does this imply that the recipe in your book
requires a certain programming style, like the
use of patterns or any other 'standard'?

Thank you,

Gian Franco Casula
[ August 10, 2004: Message edited by: Gian Franco Casula ]

"Eppur si muove!"
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
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
J. B. Rainsberger
author
Ranch Hand

Joined: Aug 05, 2004
Posts: 87
Gian Franco:

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>
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
Testing Solutions in this Book are like pattern for sovle problem or not ???


SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand
J. B. Rainsberger
author
Ranch Hand

Joined: Aug 05, 2004
Posts: 87
JUnit Recipes contains specific solutions to specific problems.

While describing those solutions, it makes references to patterns of problem solving. The patterns are not explicit, but as you read, you will notice them.
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
Thank you very much.
 
Consider Paul's rocket mass heater.
 
subject: Q 4 J. B. Rainsberger (2): preconditions for a recipe