Responsibility-driven Design with Mock Objects

Willem van den Ende & Marc Evers (QWAN)

Tutorial/Dojo

60 minutes

You Will Need: A laptop with a Java or .NET IDE and knowledge of xUnit testing frameworks

 

Responsibility Driven Design is a concept coined by Rebecca Wirfs-Brock and is about good object oriented design. OO design is about assigning the right responsibilities to the right objects and developing a clear design with loose coupling and high cohesion.

Test Driven Development (TDD) guides you in that direction, but not far enough. TDD helps to get loosely coupled objects, because having too many dependencies will get in the way of the test-code-refactor rhythm.

Testing with mock objects takes it a step further. The focus shifts from state to interactions - the messages objects send to each other. Testing with mocks emphasises behaviour and responsibilities.

In this session with a live (pair)programming demonstration, Willem and Marc will show how using mock objects helps to develop in a responsibility-based instead of a state-based way. They will also show how this approach enforces the Tell, Don't Ask design principle.

 

About The Presenters:

Willem van den Ende is a Dutch eXtreme Programming pioneer. Since 1999 he guides organisations in the introduction of Agile Software development as an all-hands person: coach, developer and facilitator. Always active in the local and international community, he currently serves as board member of the Agile Alliance, host of systemsthinking.net and the European AgileOpen conferences. Willem is an appreciated workshop facilitator at practitioners' conferences like XP(Day), Software Practice Advancement and Agile200x.

Marc Evers works as an independent coach, trainer and consultant in the field of (agile) software development and software processes. Marc develops true learning organizations that focus on continuous reflection and improvement: apply, inspect, adapt. Marc also organizes workshops and conferences on agile and lean software development, extreme programming, systems thinking, theory of constraints, and effective communication. Marc is co-founder of the Agile Open and XP Days Benelux conferences.

© Jason Gorman 2008