HOME
Most Popular
New Books

Unit Test Frameworks

Unit Test FrameworksISBN:0596006896
Pages:304
Date:2004-10
Publisher:O'Reilly Media
Rating:4.0

Read Unit Test Frameworks Online

   

Book Description

Unit test frameworks are a key element of popular development methodologies such as eXtreme Programming (XP) and Agile Development. But unit testing has moved far beyond eXtreme Programming; it is now common in many different types of application development. Unit tests help ensure low-level code correctness, reduce software development cycle time, improve developer productivity, and produce more robust software. Until now, there was little documentation available on unit testing, and most sources addressed specific frameworks and specific languages, rather than explaining the use of unit testing as a language-independent, standalone development methodology. This invaluable new book covers the theory and background of unit test frameworks, offers step-by-step instruction in basic unit test development, provides useful code examples in both Java and C++, and includes details on some of the most commonly used frameworks today from the XUnit family, including JUnit for Java, CppUnit for C++, and NUnit for .NET. Unit Test Frameworks includes clear, concise, and detailed descriptions of:

  • The theory and design of unit test frameworks
  • Examples of unit tests and frameworks
  • Different types of unit tests
  • Popular unit test frameworks
  • And more
It also includes the complete source code for CppUnit for C++, and NUnit for .NET. /p>

Reviews From AMAZON.COM


Great intro and overview if that's what you're looking for


I had used JUnit for several years before picking up this book and I like to think that I know the tool pretty well. So why did I decide to read this book? I read this book because I thought that might help me venture a bit outside my familiar JUnit turf and into doing test-first programming with languages other than Java. The short version? A very nice introduction to all the included xUnit ports. The long version? Read on.

The first four chapters are general introduction to the topic of unit testing (and to some degree, test-driven development). I was prepared to do a quick scan through them all but ended up reading chapters 3 (xUnit architecture) and 4 (writing unit tests) almost word to word-the topic was mostly familiar but the authors solid writing kind of kept me going.

The first two chapters didn't pique my interest that much, perhaps because I had already seen people develop a unit test framework from scratch as an introduction to the domain.

The real meat of the book that I was looking forward to was in chapters 7 through 9, the introductions to CppUnit, NUnit, PyUnit-which were mostly new to me although I had done very little fooling around with them before. I wasn't disappointed. The author managed to put together a pretty good set of tutorials for these frameworks. Obviously the same information is available online but I still prefer reading a treekiller rather than a printout of a web page.

The not so bright spots in the book, in my opinion, were the chapters on unit testing a Swing GUI and on XMLUnit. Not that they were in anyway badly written. I just felt like they didn't belong. I would've personally swapped in a couple of additional xUnit ports instead (Ruby and PHP, for example).

This is definitely not a book you'll carry with you from project to project. There's approximately 100 pages of substance split among half a dozen topics so none of them gets covered in detail. The rest, almost 100 pages of the book is what I'd classify as "nice to have"-I don't mind having that material in the book but I also wouldn't have minded if they'd left them out.

To summarize, if you'd like to get an idea of how the unit testing frameworks on different platforms/languages differ and what they have in common, this is as good an introduction to them as any and well written in all dimensions. However, you might be disappointed if you're looking for a more long-lasting companion.

Excellent book, explains the core of testing frameworks

I have been using JUnit for unit testing on Java for quite a while and I have also been exposed to other testing frameworks, but had never looked under the hood is such detail as Paul does in this book.

He starts with a good overview of what a unit test framework and then takes us to a very nice tutorial on building your own unit test framework from scratch. This exercise is very well documented and you learn the basic principles behind a unit test framework while building a simple application and the unit tests required to test it.

After laying out the foundation, he goes on to explain in more detail how to write unit tests, how to use assertions, how to deal and test exceptions and expected errors, how to test protected behavior, how to organize your project for testing and using more advanced techniques like mock objects and performance testing.

He also includes a chapter that deals with testing GUIs (Graphical User Interfaces) which is a challenging task, but he offers good ideas for doing test driven development for a GUI to the application that we have been building during the previous chapters.

After all the basic concepts have been covered, the next chapters are dedicated to the most important (or more popular) unit test frameworks which are JUnit for Java, CppUnit for C++, NUnit for C# on .NET, PyUnit for Python and XMLUnit for XML documents. It is interesting to note that throughout the book the author uses the same application for the example code, so that we can compare the actual implementation of the tests using the different frameworks.

In the appendices, there is a C++ version of the simple Java framework that was built on chapter 2 and there are also summaries of the class reference documentation for JUnit and CppUnit.

Overall I think it is a very solid book with good examples and very concise content. Even though it doesn't cover all the unit test frameworks that exist today, I think it covers the most important ones, but the real gem is on the in-depth analysis of what makes a unit test framework.

If you are already familiar with one or more unit test frameworks, this book will give you a deeper understanding of them, and if you are still programming without writing unit tests... shame on you ;-)... buy this book and learn how simple it is to have a very good unit testing framework, no matter what language you use.

NEW!!!

TOOOO Many results in general search?!! Try this customized search engine for searching online books