Testing with Virtual Mock Objects


This session provides an overview of JUnit and mock objects. It also demonstrates a new way of using Aspect-Oriented Programming to write "virtual mock objects." These virtual mocks simplify the isolation of tested classes, allow easy introduction of mocks in a context sensitive manner without compromising the original design, and facilitate thorough analysis of test results. Attendees will get a feel for both the benefits of virtual mock objects and how to put them into use by watching a basic business-logic test reimplemented first with traditional mock objects, then with virtual mocks.

The presentation includes a short review of the basics of AOP, but previous exposure to Aspect-Oriented Programming is recommended (e.g., attending the Introduction to AOP class). Experience using JUnit is also recommended.

More Stories By Ron Bodkin

Ron Bodkin is the founder of New Aspects of Software, which consults trains on enterprise Java applications with an emphasis on Aspect-Oriented Programming. Ron is also a member of AspectMentor, a consortium of AOP experts.
Ron previously worked for the AspectJ group at Xerox PARC, where he led the first AOP implementation projects and training for customers. Prior to that, Ron was founder and CTO at C-bridge, a consultancy that delivered enterprise applications using Java and XML frameworks.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.