Sun Java Solaris Communities My SDN Account Join SDN
 
Books & Authors

JUnit in Action

 

Book Index

by Vincent Massol with Ted Husted
April 2004

Chapter 7, Testing in Isolation with Mock Objects

Book Cover

The Sun Developer Network is pleased to present one chapter and a quiz from JUnit in Action published by Manning Publications Co.

About the Book

Many developers are switching to a new testing strategy - unit testing - which interleaves coding and testing in an integrated way. This has proven to be a powerful combination that results in better designed software with fewer defects and faster delivery cycles.

JUnit in Action shows you how to benefit from this strategy using the popular open source testing framework, JUnit. The book is a no-fluff discussion of unit testing techniques and best practices. It gives examples of tough situations such as how to unit test EJBs, database applications, JSPs and Taglibs. It discusses unit testing of J2EE applications, and shows how to test in automated builds.

About the Chapters

Chapter 7, "Testing in Isolation with Mock Objects," shows a relatively new technique called mock objects, which permits fine-grained testing in isolation. With mock objects, you'll discover not only a new way of unit testing your code but also a new way of writing it! The mock object strategy not only leads to better tested code but also to more flexible and better designed code.

The quiz is on all chapters of the book; however the majority of questions are focused on ch 7.

Ordering Information

BookPool.com

Amazon.com

Manning Publications Co.

About the Authors

Vincent Massol is Chief Technology Officer of Pivolis which specializes in agile offshore software development. Vince is an active member of the Maven, Gump and MockObjects development teams and the creator of the Jakarta Cactus testing framework. He lives in the City of Light, Paris, France.

Ted Husted is the lead author of Struts in Action.

More Information

Explore more JUnit testing techniques with these resources:

JUnit SourceForge Project
Find donated all of the JUnit code to OSS under an Apache license.

JUnit Recipes
This is a book due out in June, 2004, from Manning Publications company.

JUnit, Testing Resources for Extreme Programming

JUnit CookBook

NetBeansTM JUnit Module : Unit and Integration Testing with the JUnit Module and JUnit Testing Framework

Excerpted PDF chapter, from book, Java Development with Ant, Chapter 4, Testing with JUnit

Chapter 7, Testing in Isolation with Mock Objects


Reader Feedback
Excellent   Good   Fair   Poor  

If you have other comments or ideas for future technical content, please type them here:

Comments:

If you would like a reply to your comment, please submit your email address:
Note: We may not respond to all submitted comments.


Have a question about Java programming? Use Java Online Support.