[previous] [programme] [next]

 TU10 

   

OT2004 Session

Mock Objects: Driving top-down development.

An Irregular Course

Monday March, 09:45

tutorial -    75 minutes

Joe Walnes
Nat Pryce

 
Session results
When available, can be found at MockObjectsDrivingTopdownDevelopmentSessionResults??
Abstract
“I couldn’t afford to learn it,” said the Mock Turtle with a sigh. “I only took the regular course.”

“What was that?” inquired Alice.

“Reeling and Writhing, of course, to begin with,” the Mock Turtle replied; “and then the different branches of Arithmetic—Ambition, Distraction, Uglification, and Derision.” (*1)

Mock objects are usually regarded as a programming technique that merely supports existing methods of unit testing. But this does not exploit the full potential of mock objects. Fundamentally, mock objects enable an iterative, top-down development process that drives the creation of well designed object-oriented software.

This tutorial will demonstrate the mock object development process in action. We will show how using mock objects to guide your design results in a more effective form of test driven development and more flexible code; how mock objects allow you to concentrate more on end-user requirements than on infrastructure; and how the objects in the resultant code are small and loosely coupled, with well-defined responsibilities.

This is not a regular course.


(*1) From Alice in Wonderland by Lewis Caroll.
Audience
  • Developers working with OO languages (particularly Java or C#)

  • Developers attending this session should be familiar with the basics of unit-testing and test-driven-development. No prior knowledge of mock objects is required, however, if you are already using them this session will improve your technique.
Benefits
Attendees will leave this session with:

  • An understanding of an alternative form of test-driven development that naturally leads to a cleaner and more scalable design that is more manageable in the long-term.

  • An insight of how developing with mock objects naturally leads to code that follows recognised techniques such as cleanly defined interfaces, composition over inheritance, inversion of control, avoiding getters and setters, etc.

  • A simple pattern and process for developing code with unit-tests.

Materials
Presentation slides.

 


Joe Walnes

Google
Joe works at Google. Joe is interested in stuff like object design, web apps and agile techniques. He's not so good at writing bios.

Nat Pryce

ThoughtWorks
Nat Pryce is a software development consultant employed by ThoughtWorks.


[previous] [programme] [next]