Product Details
JUnit Recipes: Practical Methods for Programmer Testing

JUnit Recipes: Practical Methods for Programmer Testing
By J. B. Rainsberger

Price:

This item is not available for purchase from this store.
Click here to go to Amazon to see other purchasing options.


28 new or used available from $13.89

Average customer review:

Product Description

When testing becomes a developer's habit good things tend to happen—good productivity, good code, and good job satisfaction. If you want some of that, there's no better way to start your testing habit, nor to continue feeding it, than with JUnit Recipes. In this book you will find one hundred and thirty-seven solutions to a range of problems, from simple to complex, selected for you by an experienced developer and master tester. Each recipe follows the same organization giving you the problem and its background before discussing your options in solving it. JUnit – the unit testing framework for Java – is simple to use, but some code can be tricky to test. When you're facing such code you will be glad to have this book. It is a how-to reference full of practical advice on all issues of testing, from how to name your test case classes to how to test complicated J2EE applications. Its valuable advice includes side matters that can have a big payoff, like how to organize your test data or how to manage expensive test resources. What's Inside: - Getting started with JUnit - Recipes for:

servlets

JSPs

EJBs

Database code

much more - Difficult-to-test designs, and how to fix them - How testing saves time - Choose a JUnit extension:

HTMLUnit

XMLUnit

ServletUnit

EasyMock

and more!


Product Details

  • Amazon Sales Rank: #473928 in Books
  • Published on: 2004-07-15
  • Original language: English
  • Number of items: 1
  • Binding: Paperback
  • 752 pages

Editorial Reviews

Review
"Very comprehensive...Highly Recommended." -- C Vu, Journal of ACCU

About the Author
J. B. Rainsberger is a developer and consultant who has been a leader in the JUnit community since 2001. His popular online tutorial "JUnit: A Starter Guide" is read by thousands of new JUnit users each month. Joe lives in Toronto, Canada.


Customer Reviews

A wonderful compendium of JUnit tips and tricks5
J. B. Rainsberger's JUnit Recipes is a wonderful compendium of tips and tricks that can quickly take anyone from novice to expert at JUnit. The organization of the book should make it appealing to unit-testing programmers of all levels. Early chapters are highly introductory, covering the installation and first uses of JUnit. Later chapters cover testing of JDBC, Enterprise Java Beans, XML, and more.

JUnit Recipes includes the best discussions I've read on how to test database applications and on the complicated art of managing test data. This is probably not a book you will read every chapter of. In my programming, for example, I don't use EJB so I only skimmed that chapter. But at over 700 pages is much more of an encyclopedia of wonderful testing techniques than a book that is meant to be read cover to cover. As its title implies, JUnit Recipes is a cookbook of ideas that will allow you to serve up better, and better-tested, applications.

Put this next to Knuth and The Gang of Four on your bookshelf4
This isn't necessarily the best introduction for absolute beginners (I would recommend /Pragmatic Unit Testing/ for that), but it is required reading for server-side Java, as most other reviewers have pointed out. But it's more than that--it's one of those rare computer books that transcends its subject matter. Why? Because it can make you a better programmer. While some of the credit can rightly be given to unit testing and Test-Driven Development in general, Rainsberger's book makes you /see/ better ways to write and refactor your code. The breadth and depth of examples is astonishing--he convincingly shatters "but it's too hard to test that" arguments with well-researched, non-trivial examples. In fact, I'd say that this is almost a better J2EE tutorial than most books about J2EE proper.

I'm withholding a star for one reason: the book doesn't cover GUI testing tools like Jemmy, JFCUnit, or Abbot/Costello. These JUnit extensions are ripe for a book with this depth; it's just too bad that this couldn't be that book. Other than that, I find that I turn to Rainsberger's book far more often than any other testing book or online reference.

Tasty recipes for success5
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.