Join Amazon Prime and ship Two-Day for free and Overnight for $3.99. Already a member? Sign in.

 

or
Sign in to turn on 1-Click ordering.
 
 
More Buying Choices
36 used & new from $17.29

Have one to sell? Sell yours here
 
   
Pragmatic Unit Testing in Java with JUnit
 
See larger image
 
Tell the Publisher!
I’d like to read this book on Kindle

Don’t have a Kindle? Get yours here.
 
  

Pragmatic Unit Testing in Java with JUnit (Paperback)

by Andy Hunt (Author), Dave Thomas (Author)
4.0 out of 5 stars See all reviews (12 customer reviews)

List Price: $29.95
Price: $19.77
You Save: $10.18 (34%)
In Stock.
Ships from and sold by Amazon.com. Gift-wrap available.

Want it delivered Monday, July 13? Choose One-Day Shipping at checkout. Details
27 new from $17.29 9 used from $17.50
Also Available in: List Price: Our Price: Other Offers:
Paperback Order it used!

Best Value

Buy The Software Test Engineer's Handbook: A Study Guide for the ISTQB Test Analyst and Technical Analyst Advanced Level Certificates (Rockynook Computing) and get Pragmatic Unit Testing in Java with JUnit at an additional 5% off Amazon.com's everyday low price.

The Software Test Engineer's Handbook: A Study Guide for the ISTQB Test Analyst and Technical Analyst Advanced Level Certificates (Rockynook Computing) + Pragmatic Unit Testing in Java with JUnit
Buy Together Today: $63.73

Show availability and shipping details


Customers Who Bought This Item Also Bought

Pragmatic Project Automation: How to Build, Deploy, and Monitor Java Apps

Pragmatic Project Automation: How to Build, Deploy, and Monitor Java Apps

by Mike Clark
4.7 out of 5 stars (32)  $21.86
Pragmatic Version Control: Using Subversion (The Pragmatic Starter Kit Series)(2nd Edition)

Pragmatic Version Control: Using Subversion (The Pragmatic Starter Kit Series)(2nd Edition)

by Mike Mason
4.1 out of 5 stars (28)  $23.07
JUnit Recipes: Practical Methods for Programmer Testing

JUnit Recipes: Practical Methods for Programmer Testing

by J. B. Rainsberger
JUnit Pocket Guide

JUnit Pocket Guide

by Kent Beck
4.2 out of 5 stars (4)  $9.95
Pragmatic Version Control Using CVS

Pragmatic Version Control Using CVS

by Dave Thomas
4.1 out of 5 stars (10)  $22.76
Explore similar items


Editorial Reviews

Product Description
Learn how to improve your Java coding skills using unit testing. Despite it's name, unit testing is really a coding technique, not a testing technique. Unit testing is done by programmers, for programmers. It's primarily for our benefit: we get improved confidence in our code, better ability to make deadlines, less time spent in the debugger, and less time beating on the code to make it work correctly.

This book shows how to write tests, but more importantly, it goes where other books fear to tread and gives you concrete advice and examples of what to test--the common things that go wrong in all of our programs. Discover the tricky hiding places where bugs breed, and how to catch them using the freely available JUnit framework. It's easy to learn how to think of all the things in your code that are likely to break. We'll show you how with helpful mnemonics, summarized in a handy tip sheet (also available from our website) to help you remember all this stuff.

With this book you will:

Write better code, and take less time to write it

Discover the tricky places where bugs breed

Learn how to think of all the things that could go wrong

Test individual pieces of code without having to include the whole project

Test effectively with the whole team

We'll also cover how to use Mock Objects for testing, how to write high quality test code, and how to use unit testing to improve your design skills. We'll show you frequent "gotchas"--along with the fixes--to save you time when problems come up. We'll show you how with helpful mnemonics, summarized in a handy tip sheet (also available from our website).

But the best part is that you don't need a sweeping mandate to change your whole team or your whole company. You don't need to adopt Extreme Programming or Test-Driven Development, or change your development process in order to reap the proven benefits of unit testing. You can start unit testing, the pragmatic way, right away.

Other Pragmatic Programmer books:

Pragmatic Project Automation: How to Build, Deploy, and Monitor Java Applications (Mike Clark)
Pragmatic Unit Testing in C# with NUnit (Andy Hunt and Dave Thomas)
Pragmatic Version Control using CVS (Dave Thomas and Andy Hunt)

About the Author
Andrew Hunt is an experienced examiner and educator.

David Thomas, Ph.D., is the current co-director of The Bethany Family Institute. For over thirty years he was a Professor of Systematic Theology, Religion, and Family Life at St. Louis University, St. Meinrad School of Theology in Indiana, and Regis University in Denver. Thomas served as a theological consultant to the United States Catholic Bishops' Committee on Marriage and Family Life. He and Karen, his wife of forty years, are the parents of seven children and seventy-five foster children. He now lives in Whitefish, Montana.


Product Details

  • Paperback: 176 pages
  • Publisher: The Pragmatic Programmers; 1st edition (September 2003)
  • Language: English
  • ISBN-10: 0974514012
  • ISBN-13: 978-0974514017
  • Product Dimensions: 8.9 x 7.4 x 0.6 inches
  • Shipping Weight: 12 ounces (View shipping rates and policies)
  • Average Customer Review: 4.0 out of 5 stars See all reviews (12 customer reviews)
  • Amazon.com Sales Rank: #304,106 in Books (See Bestsellers in Books)

    Popular in this category: (What's this?)

    #43 in  Books > Computers & Internet > Computer Science > Information Theory


What Do Customers Ultimately Buy After Viewing This Item?


Tags Customers Associate with This Product

 (What's this?)
Click on a tag to find related items, discussions, and people.
Check the boxes next to the tags you consider relevant or enter your own tags in the field below.
(5)

Your tags: Add your first tag
 
Help others find this product — tag it for Amazon search
No one has tagged this product for Amazon search yet. Why not be the first to suggest a search for which it should appear?

Sell a Digital Version of This Book in the Kindle Store

If you are a publisher or author and hold the digital rights to a book, you can sell a digital version of it in our Kindle Store. Learn more

 

Customer Reviews

12 Reviews
5 star:
 (6)
4 star:
 (3)
3 star:
 (1)
2 star:
 (1)
1 star:
 (1)
 
 
 
 
 
Average Customer Review
4.0 out of 5 stars (12 customer reviews)
 
 
 
 
Share your thoughts with other customers:
Most Helpful Customer Reviews

 
15 of 15 people found the following review helpful:
5.0 out of 5 stars A cornucopia of wisdom, July 28, 2004
By Jason Menard (Columbia, MD United States) - See all my reviews
  
Refusing to rest on their laurels from their 1999 success The Pragmatic Programmer, Andrew Hunt and David Thomas are back with a vengeance. They've taken a step back from their previous title to write The Pragmatic Starter Kit, billed as a prequel to The Pragmatic Programmer. The Pragmatic Starter Kit, meant to lay the foundation for a pragmatic programmer, consists of three titles: Pragmatic Version Control, Pragmatic Unit Testing, and Pragmatic Automation. Together, these titles show how to set up a sound development infrastructure, and educate as to fundamental practices, tools, and philosophies which may be used to enhance productivity within this infrastructure.

Pragmatic Unit Testing, the second volume of The Pragmatic Starter Kit, teaches the developer to code smartly by practicing a regime of disciplined unit testing. Hunt and Thomas begin by convincing the reader just why it is we must write unit tests, and then quickly debunk the most common excuses developers use for not testing. Now that we are suitably convinced, the authors go on to explain how to plan and write unit tests, how to work with the JUnit framework, and how to use mock objects.

Most books on this subject don't really go too far beyond how to write unit tests. Where this book stands head and shoulders above the rest though, is the great depth the book goes into showing us exactly what tests need to be written. Through a series of helpful mnemonics, the reader is taught exactly what to test, how to correctly test boundary conditions, and what the properties of good tests are. We are also given general testing principles to keep in mind, as well as questions to ask ourselves about our code while testing. The concepts given herein are invaluable, and if the book ended with just this, it would be well worth the money.

The book doesn't stop there however. The authors offer excellent advice for integrating unit testing within the scope of a project in a team environment, and we are given a look at how unit testing can influence design. Exercises are presented to help the reader practice key concepts throughout the book.

There are a couple of things that this book isn't. This book is not a treatise on how to unit test specific components in an application. As stated previously, this book is less about how to test specific components, and more about what tests should be written in the first place. This book also does not overtly espouse any particular process. Extreme programming and test-driven development are certainly mentioned, but they are not championed above other processes.

This book is concise, weighing in at around 159 pages. The book is a very quick and pleasant read. It is appropriate for the novice as well as the developer who's been around the block a couple of times. If you write unit tests, and particularly if you are new to the game, this book is a cornucopia of wisdom. Pragmatic Unit Testing is to the practice of unit testing, what Joshua Bloch's Effective Java is to the Java programming language. That's certainly high praise indeed.
Comment Comment | Permalink | Was this review helpful to you? Yes No (Report this)



 
22 of 24 people found the following review helpful:
2.0 out of 5 stars a shallow introduction to a deep subject, October 18, 2005
By L. J. Levin (New Jersey) - See all my reviews
(REAL NAME)   
When I decided to learn about JUnit I picked up two books: this one and "JUnit Recipes" by Rainsberger. The differences were immediately obvious. "Pragmatic Unit Testing" is a reasonable choice if your goal is to simply learn something about JUnit (e.g., you are a high school or college student taking a couple of programming courses). On the other hand, if your goal is to actually make use of JUnit to help you produce code that actually does something, you will quickly drop this book and turn to some other source of information.

A quick look at the index or table of contents highlights the problem with this book. Think about some of the constructs in your code: interfaces, SQL databases, XML, J2EE apps, web servers, etc. None of these topics are listed because this book doesnt give you any input on how to construct JUnit tests for any of these situations. For example, what's the best way to test when multiple classes implement the same interface? No help here.

The books is best used as a quick intro to testing for novice Java programmers. For anyone doing serious programming I suggest the Rainsberger book. Thats the one I keep on my desk close at hand. "Pragmatic Unit Testing" now resides in a box down in my basement.
Comment Comment | Permalink | Was this review helpful to you? Yes No (Report this)



 
11 of 11 people found the following review helpful:
3.0 out of 5 stars A good introduction but not Reference Shelf material, August 18, 2004
By Vincent O'Sullivan (London, England.) - See all my reviews
(REAL NAME)   
Pragmatic Unit Testing is another outing for the "Pragmatic" brand. This time the authors apply their characteristic humour and collection of acronyms to unit testing, specifically as it applies to Java and using the JUnit software package.

The book gives a general introduction to the whys and wherefores of unit testing and then uses a good example to introduce JUnit as a mechanism for carrying out these tests. This is followed by various chapters that look into what you should test and when and where, etc. In this respect it covers much of the ground on unit testing and does it well but the truth is that there isn't all that much to cover; to the extent that the authors can even provide a one page at-a-glance summary of all their main points at the back of the book. This is fine and as an introductory text I would recommend the book.

On the other hand, there are a number of areas in unit testing that always present problems for developers. For instance:
How should private methods be tested? This is mentioned in passing but not really addressed.
Where should tests be stored? Some options are presented but their advantages and disadvantages barely mentioned.
How can systems such as databases or networks be simulated for test purposes? There is a short chapter on simple Mock Objects but after presenting a small example they conclude "and that's all there is to mock objects" and the rest of the chapter barely covers anything more.

In summary, the book is a good (if verbose) introduction for beginners but is of limited value for those who are already familiar with JUnit and are looking for a book that tackles the more difficult areas.
Comment Comment | Permalink | Was this review helpful to you? Yes No (Report this)


Share your thoughts with other customers: Create your own review
 
 
 
Most Recent Customer Reviews

1.0 out of 5 stars Sorely in Need of Update
Buyer beware. This book does not reflect the many changes to JUnit implemented in version 4. I found it to be a very good book when it came out four years ago however.
Published on June 4, 2007 by YesWeCan

4.0 out of 5 stars good
pragmatic Unit testing in java save a lot of time to debug java code.
Published on February 16, 2007 by Heejae Park

4.0 out of 5 stars JUnit Testing
JUnit Testing can really save you a lot of time debugging. This book provides a various way to work with JUnit.
Published on February 1, 2007 by Cheng Lei

5.0 out of 5 stars Great JUnit Starter Kit
This is another fine book from the "Pragmatic Programmer" series. If you are doing Java development, but haven't gotten into unit testing yet, this is a great place to start... Read more
Published on August 15, 2006 by P. Heath

4.0 out of 5 stars Good introduction to unit testing
This book is very good for a beginner to unit testing. I like the simple explanation of the different types of unit testing that must be done. Read more
Published on July 27, 2006 by uml_zepho_com

5.0 out of 5 stars This should be required reading for new Java programmers
Pragmatic Unit Testing is one of those books that you only find once in a great while: concise, readable, practical, and applicable to everyday work tasks. Read more
Published on March 3, 2005 by akempo

5.0 out of 5 stars bridging the gap
Unit Testing is one of those widely accepted good practices that is not always well applied. This book helps to bridge the gap between what should be done and what is done... Read more
Published on October 20, 2004 by C. M. Lowry

5.0 out of 5 stars an excellent introduction
(The following is an excerpt of a review of "The Pragmatic Starter Kit" I posted at JavaRanch.)

"Pragmatic Unit Testing - In Java with JUnit" - the second volume in... Read more
Published on September 12, 2004 by Dirk Schreckmann

5.0 out of 5 stars Great Description of Unit Testing
There has been a resurgent interest amongst developers in unit
testing, mostly spurred on by Extreme Programming, test-driven
development and the JUnit testing... Read more
Published on July 29, 2004 by Bret Pettichord

Only search this product's reviews



Customer Discussions

 Beta (What's this?)
New! See all customer communities, and bookmark your communities to keep track of them.
This product's forum (0 discussions)
  Discussion Replies Latest Post
  No discussions yet

Ask questions, Share opinions, Gain insight
Start a new discussion
Topic:
First post:
Prompts for sign-in
  [Cancel]


Active discussions in related forums
   


Product Information from the Amapedia Community

Beta (What's this?)



Look for Similar Items by Category


Cook with the Best Ingredients

Traditional Paella Kit
Fall into cooking or give the gift of great cooking with fresh and innovative ingredients and spices from Amazon Gourmet.

Shop more now

 

Big Savings in Books

Bargain Books
Find great titles at fantastic prices in our Bargain Books Store.
 

Summer Reading for Kids & Teens

Summer Reading for Kids and Teens
Discover everything from beach reads and board books to teen romance and action-adventure series in Summer Reading for Kids & Teens. And, check off the kids' required reading lists in our Summer School Reading Store.
 
Shop for Hunter Fans
Hunter FansShop a wide collection of Hunter standing and ceiling fans, with styles ranging from classic to contemporary.
 

 

Feedback

If you need help or have a question for Customer Service, contact us.
 Would you like to update product info or give feedback on images?
Is there any other feedback you would like to provide?

Your comments can help make our site better for everyone.


Where's My Stuff?

Shipping & Returns

Need Help?

Your Recent History

  (What's this?)
You have no recently viewed items or searches.

After viewing product detail pages or search results, look here to find an easy way to navigate back to pages you are interested in.

Look to the right column to find helpful suggestions for your shopping session.

Continue shopping: Top Sellers
Glenn Beck's Common Sense
Glenn Beck's Common Sense
Darkfever
Darkfever by Karen Marie Moning
The Adventures of Sherlock Holmes
The Adventures of Sherlock Holmes by Arthur Conan, Sir, 1859-1930 Doyle

Conditions of Use | Privacy Notice © 1996-2009, Amazon.com, Inc. or its affiliates