Alexander Day Chaffee & William PietriCompany: Purple Technology & Scissor
E-mail address: email@example.com
Website address: http://www.purpletech.com/
Alexander Day Chaffee is the founder of Purple Technology, a company that provides Java language, Extreme Programming, and open source consulting and training. He manages the Servlets FAQ for jGuru. As the Director of Software Engineering for EarthWeb, Alex co-created Gamelan, the official directory for the Java community. You can contact him at firstname.lastname@example.org.
William Pietri, the son of a systems analyst and an entrepreneur, started earning his lunch money with a computer at the age of thirteen. In the years since, he has worked in practically every facet of the technical world, from technical support to systems administration to software engineering to user-interface design. He is the founder of Scissor, a technology consulting firm. You can contact William at email@example.com.
Unit testing with mock objects - 2004-02-18
Mock objects are a useful way to write unit tests for objects that act as mediators. Instead of calling the real domain objects, the tested object calls a mock domain object that merely asserts that the correct methods were called, with the expected parameters, in the correct order. However, when the tested object must create the domain object, we are faced with a problem. How does the tested object know to create a mock domain object instead of the true domain object? In this article, software consultants Alexander Day Chaffee and William Pietri present a refactoring technique to create mock objects based on the factory method design pattern.
Read Tutorial View Tutorial Discussion