The "BDD Story Template"

April 28th, 2008

Mike Cohn just wrote a nice post justifying what has become the preferred template for stories in BDD:

<p>As a <i>role</i><br />

I want feature
So that benefit

8 Responses to “The "BDD Story Template"”

  1. mjuneja@gmail.com Says:

    As a developer I want to use this template so that I can write better code

  2. Manik Juneja Says:

    As a developer I want to use this template so that I can write better code

  3. Aslak Hellesøy Says:

    I like this better:

    <p>In order to <achieve some value>
    

    As a I want

    <p>http://abc.truemesh.com/archives/000735.html
    

    http://sirenian.livejournal.com/47679.html

  4. Aslak Hellesøy Says:

    (Typo forgot to escape my previous post)

    <p>I like this better:</p>
    
    
    <p>In order to [achieve some value]
    

    As a [role] I want [some feature]

    <p>http://abc.truemesh.com/archives/000735.html
    

    http://sirenian.livejournal.com/47679.html

  5. Olof Bjarnason Says:

    Aslak: I think an even more “readable” version is this:

    <pre><code>In order to [achieve some value] I want [some feature]</code></pre>
    
    
    <p>It reads like a script from some theatre play; like a statement from one of the actors.</p>
    
    
    <p>An example from my current project:</p>
    
    
    <p><span class="caps">CAM</span> User: in order to undo a mistaken disconnect, I want to be able to connect a toolpath and a part</p>
    
  6. Olof Bjarnason Says:

    OK another try, the formatting got lost:

    <p>(Role): In order to (achieve some value) I want (some feature)</p>
    
    
    <p>For example:</p>
    
    
    <p><span class="caps">CAM</span> User: in order to undo a mistaken disconnect, I want to be able to connect a toolpath and a part</p>
    
  7. Craig Buchek Says:

    @Aslak: I think the original order works better, because it puts the user first. It helps to recall the whole reason for writing the program—to help people. That’s really our focus, and our starting point.

    <p>Actually, I like Olof&#8217;s suggestion even better, since the user&#8217;s goal is the 2nd most important thing.</p>
    
  8. Olof Bjarnason Says:

    Olof: In order to be polite, I want to give Craig my thanks! (pun intended).

    <p>So what languages/tools are you guys using for <span class="caps">BDD</span>? I&#8217;m learning using C#/NUnit but so far it&#8217;s much harder than <span class="caps">TDD</span> for me. Any hints?</p>