Have one to sell? Sell yours here
or
Get a £1.85 Amazon.co.uk Gift Card
Pragmatic Unit Testing in Java with Junit (Pragmatic Programmers)
 
See larger image
 
Tell the Publisher!
I’d like to read this book on Kindle

Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.

Pragmatic Unit Testing in Java with Junit (Pragmatic Programmers) [Paperback]

Andy Hunt , Dave Thomas
3.0 out of 5 stars  See all reviews (2 customer reviews)

Available from these sellers.


Trade In this Item for up to £1.85
Get an extra £5 when you trade in books worth £10 or more until June 30, 2012. Trade in Pragmatic Unit Testing in Java with Junit (Pragmatic Programmers) for an Amazon.co.uk gift card of up to £1.85, which you can then spend on millions of items across the site. Trade-in values may vary (terms apply). Find more products eligible for trade-in.


Product details

  • Paperback: 176 pages
  • Publisher: Pragmatic Bookshelf; 1 edition (8 Sep 2003)
  • Language English
  • ISBN-10: 0974514012
  • ISBN-13: 978-0974514017
  • Product Dimensions: 22.7 x 19 x 1.5 cm
  • Average Customer Review: 3.0 out of 5 stars  See all reviews (2 customer reviews)
  • Amazon Bestsellers Rank: 446,881 in Books (See Top 100 in Books)
  • See Complete Table of Contents

More About the Authors

Discover books, learn about writers, and more.

Product Description

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 www.pragmaticprogrammer.com 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 www.pragmaticprogrammer.com 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.

From the Publisher

Improve your Java coding skills using unit testing: it's really all about coding, not testing. This book shows not just how to test, but what to test. Discover the tricky hiding places where bugs breed, and how to catch them using JUnit. You don't need to adopt Extreme Programming, or Test-Driven Development in order to reap the proven benefits of unit testing, the pragmatic way. Volume II of the Pragmatic Starter Kit.

Suggested Tags from Similar Products

 (What's this?)
Be the first one to add a relevant tag (keyword that's strongly related to this product)
 
(10)
(4)

Your tags: Add your first tag
 

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

What Other Items Do Customers Buy After Viewing This Item?


Customer Reviews

5 star
0
4 star
0
2 star
0
1 star
0
Most Helpful Customer Reviews
9 of 9 people found the following review helpful
Good introduction... 14 Aug 2005
By MTEd19
Format:Paperback
but then it doesn't offer much beyond what you can glean from reading about the subject on the internet. It also misses out a great deal of stuff which would be useful such as how to test private methods of classes, using databases in testing using DbUnit or how to use Cactus or many of the other frameworks it mentions. It does cover a lot of ground on what to test and why you are testing, but I found it very brief and lacking information on how to test.
Comment | 
Was this review helpful to you?
Good but basic 5 Aug 2011
Format:Paperback
This is not a bad book but I would only buy it if you have absolutely no experience of unit-testing.

It's well written and easy to understand but the subject matter is very basic and only suitable for beginners.
Comment | 
Was this review helpful to you?
Most Helpful Customer Reviews on Amazon.com (beta)
Amazon.com:  15 reviews
30 of 33 people found the following review helpful
a shallow introduction to a deep subject 18 Oct 2005
By L. J. Levin - Published on Amazon.com
Format:Paperback
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.
15 of 15 people found the following review helpful
A good introduction but not Reference Shelf material 18 Aug 2004
By Vincent O'Sullivan - Published on Amazon.com
Format:Paperback
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.
15 of 16 people found the following review helpful
A cornucopia of wisdom 28 July 2004
By Jason Menard - Published on Amazon.com
Format:Paperback
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.
Search Customer Reviews
Only search this product's reviews

Customer Discussions

This product's forum
Discussion Replies Latest Post
No discussions yet

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

Search Customer Discussions
Search all Amazon discussions
   


Listmania!


Look for similar items by category


Look for similar items by subject


Feedback