me@jbrains.ca

Permanent link to this article Story Test-Driven Development: don't start here

I don’t want to claim that story test-driven development doesn’t work, because some of my most respected colleagues teach the practice with success; however, I do want to warn people who might find themselves seduced by STDD, especially if they think of it as an easy replacement for TDD.

Allow me to clarify the two terms, TDD and STDD. To practice TDD, the programmer begins with a small, well-defined behavior they’d like to implement. Typically, they design that behavior as a method on a class, although they could get away with doing even less, then brainstorm a list of tests they might write. With such a list in hand, they run through the TDD cycle, illustrated beautifully by Bill Wake’s stoplight analogy. When the design behaves adequately and correctly, the programmer stops.

To practice STDD, the programmer begins with a story and several story tests, which I tend to call “examples”. The programmer then selects a story test, watches it fail, then test-drives enough code to make it pass. One by one, the programmer makes each story test pass until they complete the entire story.

I have been teaching people about TDD and stories for years, and have practiced STDD most of that time, in one form or another. I find the technique helpful; however, when I have pushed STDD to its limit, I have found it to guide me in directions I don’t like, which TDD has generally never done. When I watch others attempt to practice STDD, especially novices and advanced beginners, I see how they misapply STDD and lead themselves towards a Big Ball of Mud, despite what the agile community’s marketing machine says about TDD and stories. I believe the intersection of the two creates problems for those not accustomed to the different goals of TDD and user stories.

I use examples, the term I use for story tests, to show progress towards delivering a story, or feature. Broadly, I add examples to reflect increasing levels of understanding of the system to design, and as examples pass, that reflects progress towards delivering an ever more powerful system. I use programmer tests, the term I use in place of unit tests, to test my design ideas as they come to me and to help me type code in correctly. Any time all the programmer tests pass, the system works as designed, even if it does not yet do everything the business needs. Any time all the programmer tests pass, I can freely commit changes to the main line of the project’s design repository.

More succinctly, examples help us design the right system and programmer tests help us design the system right. (I prefer “correctly” there, but then I lose the symmetry.)

I often see programmers try to use passing examples as an absolute criterion to stop designing. They underestimate, in my opinion, the role of programmer tests to put positive pressure on their design. Examples, especially when written as end-to-end or integration tests (a test whose failure does not isolate the mistake to a single method), simply do not put positive pressure on a design: their high-level nature can’t constrain a design enough to support careful refactoring. For this reason, I recommend novices and advanced beginners not practice STDD until they first see or feel for themselves the impact focused, small programmer tests have on their design.

I want to leave no room for doubt: I do not mean to say that novices should avoid STDD as an “advanced practice”; but rather that a combination of novice tendencies makes STDD harder than TDD to practice well. Specifically, the novice tends to write examples as end-to-end tests, which provide too much design freedom and exert too little positive pressure on the design to guide refactoring and prevent defects. Instead, I would counsel novices and advanced beginners to focus on TDD and run the examples every hour or so to measure their progress towards delivering the story.

Read more about how to practice STDD well.

Digg! Discuss

September 02, 2008 03:00 testing, agile, stories, people, refactoring, design, antipatterns, article, extreme programming

Permanent link to this article Gordon Pask Award 2009

I have agreed to administer the Gordon Pask Award starting in 2009. Brian Marick has done a wonderful job, just at the edge of chaos, in starting the program and I hope to be able to continue in his footsteps. Laurent Bossavit has agreed, at least in principle, to co-administer the program and I know I will need his help.

I have several ideas for improving the mechanics of the award in addition to a personal vision of the award, but I certainly don’t mind receiving your advice. Since I cannot handle thousands of emails on the topic, I would like you to answer one of these questions regarding the prize, how we award it and how we present it.

What does it mean to you to see someone other than you win a Gordon Pask Award?

What does it mean to you to see someone other than the person you nominated win a Gordon Pask Award?

All things considered, would you rather we continue the program or abandon it?

Please send me an email with your thoughts. Write what you will, but please include an answer to at least one of these questions.

Digg! Discuss

August 12, 2008 03:00 agile, people, extreme programming, gordon pask award 2009

Permanent link to this article Help us nominate David Chelimsky for the Gordon Pask Award

Once again, nominating season for the Gordon Pask Award has begun. I have so far put my support behind one excellent candidate, David Chelimsky. The nominating process has changed and we would like to garner some additional support for David. If you are interested, then please click the Discuss link for this article (which takes you to reddit) and write a blurb in the style that the selection committee has asked for. (If you haven’t already, read the link above.)

Thank you for helping us show support for David as a significant contributor to agile practice who is well due the recognition of the Gordon Pask Award.

Digg! Discuss

July 26, 2008 03:00 agile, people, extreme programming

Permanent link to this article If we are serious about speed...

I have been reading the Cutter IT Journal from March 2003, when they ran a special issue on Critical Chain Project Management. I wanted to share this especially salient point. I don’t know how to help my clients understand this, particularly because my clients usually find themselves behind the eight-ball and in desperate need of this advice.

If we are serious about speed, we must understand what is required for people to “go faster.” We are not asking them to work faster! We are asking them to wait, to rest, and then work at full speed. And then rest again. Our strategy is to remove all the obstacles that cause them delay and to recognize that relay runners don’t run at full speed all day. They are not “fully utilized” because full utilization of resources is inefficient for speed. For our people to do tasks faster, we must reduce their workload and lower their utilization. This is not a sacrifice for the organization, it is the means for substantially greater project throughput. For our people to do tasks faster, we must reduce their workload and lower their utilization.

How do I help them understand? Click the Discuss link to give me your suggestions.

Digg! Discuss

July 07, 2008 03:00 agile, people, extreme programming

Permanent link to this article Find out where I'm appearing

To borrow from Garr Reynolds, who has taught me much about presentations:

So if you’d like to know where I plan to appear next, click the link under my photo or subscribe to my appearances calendar:

Feel free to invite me anywhere with any amount of notice. You never know what we can work out. Be sure to tell me enough about your invitation to pique my interest!

See you on the road, which would be a town near you!

Digg! Discuss

July 07, 2008 03:00 speaking, people, presenting

Older entries | Older entries at diasparsoftware.com