This exercise was developed as part of an Agile technical skills training class that we teach. For more details on this or other courses, contact us now. You are welcome to use these exercises yourself - more details here.

Technical Debt with LEGO®

Intent

Demonstrate the kind of debt we accumulate if we don’t refactor as we go. This exercise will let the attendees experience the pain of dealing with technical debt, rather than just understanding it intellectually.

Round One

Facilitator will call out requirements that the attendees will then have to build. They should know that the goal is to build a house but they won't know the specific requirements up front and will only discover them as we go.

One new requirement will be given every 30 seconds. At the beginning, 30 seconds may seem too long but they’ll be rushing to keep up once the exercise gets going.

Constraints

  • Once two pieces have been connected, they may not be separated again.
    This simulates not refactoring.

Requirements

  • House must have two connecting walls
  • House must have a window on one wall
  • House must be fully enclosed. Add more walls.
  • House must have a sloped roof
    Encourage them to make the slope prominent and visible. Show it off.
  • House must have a chimney
  • House must have a ground floor door
    With luck, they won’t have enough room for a door and will have to add to the bottom instead of the top
  • House must have a window on a second wall
    If this means building up again then ensure they still have a ground floor door
  • House must now have a flat roof
    “Marketing tells us that sloped roofs just aren’t selling. If buyers even see a slope, they won’t buy so cover it up”

The expectation is that each step will make the next step more difficult and so it will take more time to implement than it should. I usually give 60 seconds for the last one, instead of 30, because it's harder than the others.

In order to satisfy the flat roof requirement, most people will have started down the path of a stovepipe architecture. This is a good time to discuss that.

Debrief

  • What did you notice? Any surprises?
  • Were you consistently fast at implementing new features or did it get harder as you progressed?

Round Two

Do a second build. If there are enough LEGO® bricks then leave the first build assembled so that we can compare them.

What's different with this build is that everyone is allowed to separate the bricks as needed. This simulates refactoring to keep the code clean.

Debrief

  • What did you notice about the second build?
  • Which version was easier to build on?
  • If you had to keep building on one of the two builds, which one would you want it to be?
  • Which was faster to build on?
    We commonly hear “we don’t have time to refactor” so ask “did the act of refactoring slow you down?”