OT2004 : Mock Objects: Driving Top-Down Development
Nat and I were first up with our talk on Mock Objects. Yes, we are still harping on about them :).
Here’s what we covered:
- OO concepts: an application is a web of
collaborating objects, each providing a
distinct responsibility and taking on
multiple roles to provide services to other
objects.
- How the process of using mock
objects complements TDD to drive out the
design of these responsibilities and
roles.
- How our original usage of mocks for
testing system boundaries such as databases,
web-apps, GUIs, external libraries turned
out to be a bad approach and the success we
started achieving when inverting this to
only mock types we can
change.
- The process of using mocks very quickly
points out key abstractions in your system,
difference in responsibilities between
objects and services objects require.
- Clearing up misconceptions about mocks,
including: not using them at system
boundaries and what they actually are (not
stubs, not recorders, no behaviour).
- Our first public demonstration of the
new JMock
API to walk through a single iteration of
the process.
- Usage patterns.
Feedback from: James Robertson @ Cincom Smalltalk and Mike Platt @ Microsoft.