Session_09

XP Day 2003 logo

(J)Unit Test driven development with Mocking


Organiser(s): ThijsJanssen

Session duration: 45 minutes

Session type: Interactive presentation

Intended Audience: developers

Session language: English


Description:

Mocking is helpful when unittesting an object that has dependencies on other objects. It helps to maintain focus on the responsibilities of the object under test.

In my presentation I will highlight the benefits of unittesting briefly, and then talk about and discuss (with the audience):

  • How I use mocking when I'm developing test-first.
  • Why mocking is important when writing tests.
  • What different (possible) kinds of mocking classes and interfaces I've used. These kinds include:
    • Easymock
    • Delegator
    • Testcase implements Interface
    • Override method with anonymous subclass
    • Custom implementation (mockclass)
    • Don't mock.
  • The differences between these kinds, what the strengths and weaknesses are.
  • The problems I've had with writing mock classes.
This presentation is intended for software developers who want to know more about mocking, want to improve their unittesting, or want to discuss about how and when to (ab)use mocking. The examples I use will be in Java, but that doesn't exclude other languages, where mocking can be quite useful.


Back to Program