The flow of team software design

This week, I taught another installment of Headspring's Agile Boot Camp, part 2.  On one of the days, I lead the team (class) through a team design session to add some rather involved behavior to the software system used in the class.  I started out by putting on my customer hat and laying out the release objectives.

When attempting to get everyone on the same page, visuals are very important.  Either whiteboard, chalkboard, paper, or anything visual will do.  Here is a picture of the release goals written out.  I invited the team to ask me clarifying questions about the goals.

 

The top three, we pulled out as stories and put them on our story wall.  The next three were cross-cutting business rules that applied to the three stories.  The team quickly complete the first story and then split up the next two. 

Before the team began test-driving the functionality through pair-programming, we conducted a team design session to get everyone on the same page.  We did just enough drawing to ensure that everyone had a meeting of the minds.  In reality, if team members start slinging code before everyone has a shared understanding of the approach, there is bound to be wasted work.  Individuals will create assumptions and act on them.  Then, when the assumptions are invalidated, we also have work that becomes invalidated.  This is waste, and you never get that time back.  A little bit of communications (meeting of the minds) goes a long way to ensuring that the work done is the right work. 

We started the design session by coming up with all the individual responsibilities that are necessary to satisfy the stories.

The blue initials next to each responsibility is the acronym for the interface that has been assigned the responsibility.  After responsibilities had been identified, we took to the whiteboard and created a sequence diagram using the chosen type names.  This allowed us to determine dependencies and flow.

There are actually two different threads present on this sequence diagram.  On the left, the state command initiates a notification that gets placed into a queue.  On the right, a queue watcher peeks at the queue (intended to be run with Windows Scheduler) and kicks off the sending process according to business rules.

There are only certain state transitions when a notification needs to be send.  This is visualized through a state diagram:

The most hairy part of the design is the IQueueWatcher implementation.  This deserved its own graphic, and there was lots of discussion while we were fleshing out the flowchart.

Even as crude as it looks, the act of creating this as a team caused each team member to think critically about how the feature needed to be implemented.  There are lots of different places in code where a decision can be made, and putting it in visual form solidified the approach across the team.

The last step before actually pairing up and hitting the keyboards was to task out everything that needed to be done.

Notice that the first task was to create all the interfaces and common types.  By doing this first, other tasks could be accomplished without being blocked by uncompleted work.  One pair can work on the calling side of an interface, and another pair can work on the implementation.  Interfaces are natural seams, and when used liberally, provide a natural decoupling.  This decoupling enables team development while still working closely on the same stories.  My experience has shown that collective code ownership falls in line naturally when using this approach.

At the end of the day, the team hammered through the stories very quickly because each class by itself was very, very simple.  I really enjoyed the class, and I look forward to teaching the next Agile Boot Camp.


Trackbacks

igorbrejc.net » Fresh Catch For March 29th Posted on 3.29.2009 at 2:02 PM

Pingback from igorbrejc.net » Fresh Catch For March 29th

Comments

Yanic said on 3.27.2009 at 2:22 AM

Detailed design using sequence diagrams, on a whiteboard? That doesn't sound very productive.

I see from the leftover bits and pieces of erased arrows that you had to change it at some point, and it looks like things got a bit cramped on the right side when the Mail thingy needed to get created? :o)

I think I have a better solution, here's what you need :

- a beamer

- a laptop

- a wireless mouse

- Trace Modeler (software)

Put one person behind the laptop in charge of the keyboard ('the operator'). The operator can use the laptop's touchpad if necessary.

Pass the wireless mouse around to whoever wants to contribute to the sequence diagram ('the drawer'), just like you would with a whiteboard marker. When the drawer needs to add text, the operator types it in (passing a wireless keyboard around is a bit cumbersome :o).

You'll be able to quickly bang out the diagrams for all your scenarios, discuss ad-hoc alternatives and afterwards you'll have the diagrams in digitized form.

Whenever you want to know what your class model looks like, you can let the software derive an overview of all the classes and their methods from your sequence diagrams (it uses type inferencing to deduce as much of the signatures as possible).

Here's a 30 sec demo of Trace Modeler in action :

www.tracemodeler.com/.../index.html

If you want to give this a try the next time, let me know and I'll provide you with a license for your experiments.

Love to hear what you think of this approach!

Jeffrey Palermo said on 3.27.2009 at 8:03 AM

@Yanic,

I appreciate your pride in your product.

>> That doesn't sound very productive

I'm not sure what it sounds like, but it was very productive because the team was able to implement it all in less than 4 hours.

Yanic said on 3.27.2009 at 4:30 PM

Goal achieved then!

So far I've managed to convince every single whiteboard enthusiast I met to use Trace Modeler instead... All three of them :o)

If you wake up feeling adventurous one day, the offer still stands.

Cheers!

Igor Brejc said on 3.29.2009 at 2:10 AM

@Yanic,

I think the impetus is on flow of ideas and brainstorming, not so much on precise UML diagrams ans specs. The diagrams just help you visualize the mental process. They get out of date fairly quickly, anyway.

Yanic said on 3.29.2009 at 7:45 PM

@Igor,

Indeed, a tool (be it whiteboard or software) shouldn't hinder the flow of ideas. I find drawing sequence diagrams on a whiteboard cumbersome, it's slow and I run into its limitations rather quickly - even when 'just sketching' an idea. To each his own of course.

faffy fuck said on 4.02.2009 at 5:03 AM

What happened to the good old "just go and do it"? I personally hate all the project management crap like scrum and all. What you really need is skilled developers & everything will automatically be fine.