- Series: Pragmatic Programmers
- Paperback: 176 pages
- Publisher: The Pragmatic Programmers; 1 edition (September 2003)
- Language: English
- ISBN-10: 0974514012
- ISBN-13: 978-0974514017
- Product Dimensions: 7.5 x 0.6 x 9 inches
- Shipping Weight: 12 ounces (View shipping rates and policies)
- Average Customer Review: 16 customer reviews
- Amazon Best Sellers Rank: #672,236 in Books (See Top 100 in Books)
Enter your mobile number or email address below and we'll send you a link to download the free Kindle App. Then you can start reading Kindle books on your smartphone, tablet, or computer - no Kindle device required.
To get the free app, enter your mobile phone number.
Pragmatic Unit Testing in Java with JUnit 1st Edition
Use the Amazon App to scan ISBNs and compare prices.
All Books, All the Time
Read author interviews, book reviews, editors picks, and more at the Amazon Book Review. Read it now
Frequently bought together
Customers who bought this item also bought
About the Author
Andy Hunt is a programmer turned consultant, author and publisher. He co-authored the best-selling book “The Pragmatic Programmer”, was one of the 17 founders of the Agile Alliance, and co-founded the Pragmatic Bookshelf, publishing award-winning and critically acclaimed books for software developers.
Dave Thomas, as one of the authors of the Agile Manifesto, understands agility. As the author of "Programming Ruby," he understands Ruby. And, as an active Rails developer, he knows Rails.
Top customer reviews
If you are just looking to just get your feet wet and see the value in test driven development (and have some basic Java skills) this is a great jumping off point. You can probably get through most of it in a weekend. There are more in depth books for you to tackle after you get through this one.
The only reason I didn't give it 5 stars was that it's kind of old.
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.
While JUnit and Mock Objects are introduced in the text, the main focus is on developing insight into the philosophy of pragmatic unit testing. Most developers have a vague understanding of the why and how, but what do their results really mean? Are they sufficient to determine that the code is correct? How does the developer know?
With anecdotes and clear examples, the authors help to clear the fog. Just as important, they dispel many of the testing myths and explode the excuses that are offered for not unit testing. Resistance will frequently come developers, but also from management thinking that developing test code will add time to the project instead of saving it.
A side-effect of developing unit tests is that they add another layer of code that must be managed. Do you need tests for your test? Where does it end? Again the pragmatic programmers provide poignant pointers to managing the tests themselves.
One of the pragmatic programmer commandments must be "Be brief". In less than 160 pages, this slim volume covers a lot of ground. For a project technical lead, several copies for your team to read may be a solid investment. Be sure to make a poster-sized version of the "Pragmatic Unit Testing: Summary" page from the book for the wall behind your desk.