Show all posts
6 years ago

BDD and User Story Specification: Examples

I’ve started using BDD to create user stories specifications several months ago. It works great. Very good format. Developers understand it without problems, Testers can write acceptance tests quickly and it is easy to follow for Product Owner.

Here are some examples of real user stories specs in BDD for TargetProcess product:

As a Scrum Master I want to see Release BD Chart drawn by weeks

As a Scrum Master
I want to see Release BD Chart drawn by weeks
When Iterations practice is disabled
So that I can benefit from BD chart

Given any development process
When I turn off Iterations practice in Admin -> Process -> Edit
And navigate to Release BD chart
Then iteration velocity replaced by weekly velocity
And Chart end date is the same as Release end date
And BD chart drawn by weeks instead of iterations
And Chart Start Date is the same as Release Start Date

As a Scrum Master I want to see Lead/Cycle time progress

As a Scrum Master
I want to see Lead/Cycle time progress
So that I know whether we are improving our development process or not

Scenario #1
Given Reports section in project and Bug Tracking practice is disabled
When I navigate to Lead and Cycle Time Report
Then I see Lead Time chart
And chart contains 1 line for stories

Scenario #2
Given Reports section in project and Bug Tracking practice is disabled
When I navigate to Lead and Cycle Time Report
Then I see Cycle Time
And chart contains 1 line for stories

Scenario #3
Given Reports section in project and Bug Tracking practice is ENABLED
When I navigate to Lead and Cycle Time Report
Then I see Lead Time chart
And chart contains 2 lines (for stories and bugs)

Scenario #4
Given Reports section in project and Bug Tracking practice is ENABLED
When I navigate to Lead and Cycle Time Report
Then I see Cycle Time
And chart contains 2 lines (for stories and bugs)

Additional Info
X-axis – Months (display 12 last CALENDAR months)
Y-axis – Lead time or Cycle Time (in days)

To display value for given months, we take stories completed this month (determined by End Date).
For example, in June we’ve completed 5 stories, in July 10.
Then lead/cycle time will be calculated for June by sum(5 stories lead time)/5 and for July sum(10 stories lead time)/10.

Charts should have labels for each month.

Story line color: #507cb6
Bug line color: #cc060d
kanban_stats1

  • Valentine Palazkov

    The bdd stories from above very useful for developers.

    Later they were transformed in more detailed ones.

    A part of them look as per below and now run on Cruise Control build server as a part of unit tests:

    —————————-
    Story: Should Provide Lead And Cycle Time Stats

    Scenario 1: Should provide lead time stats omitting not started/done US and Bugs for definite period of time
    Given Empty project for Kanban process
    And 5 User Stories created at 25.08.2008
    And 6 Bugs created 2.09.2008
    And 3 User Stories started 3.09.2008
    And 3 User Stories done 7.09.2008
    And 2 Bugs started 4.09.2008
    And 2 Bugs done 15.09.2008
    When get Lead Time Stats for range from 1.09.2008 to 30.09.2008
    Then Lead Time for User Stories should be 13 days
    And Should be 3 User Stories
    And Lead Time for Bugs should be 13 days
    And Should be 2 Bugs

    Scenario 2: Should provide cycle time stats omitting not started/done US and Bugs for definite period of time
    Given Empty project for Kanban process
    And 5 User Stories created at 1.09.2008
    And 6 Bugs created 2.09.2008
    And 3 User Stories started 3.09.2008
    And 3 User Stories done 7.09.2008
    And 2 Bugs started 4.09.2008
    And 2 Bugs done 15.09.2008
    When get Cycle Time Stats for range from 1.09.2008 to 30.09.2008
    Then Cycle Time for User Stories should be 4 days
    And Should be 3 User Stories
    And Cycle Time for Bugs should be 11 days
    And Should be 2 Bugs

  • http://www.adsdevshop.com Robert Dempsey

    If any readers here are using Ruby on Rails, the format that Michael is using here is *perfect* for cucumber tests :)

  • http://code.google.com/p/givwenzen/ wes

    i have done an extension to allow similar style test in fitnesse as well. http://code.google.com/p/givwenzen/

  • http://radsoft.com John Goodsen

    @Robert Dempsey Cucumber works for many languages, not just Ruby or RubyOnRails projects.

  • Christophe

    I have had the same experience and has worked very well for me too! Adding “examples” to user stories as conditions of satisfaction is really worth the money!

  • Peter Vukovic

    Michael, great post. When you say “Testers can write acceptance tests quickly”, can you describe that process? Are you talking about translating BDD scenarios to automatic back-end tests, or Selenium tests, or both? Thanks.

  • Philippa Cole

    And how have you structured this in Target Process?
    I tried using the Epic as Epic (eg Language control)
    Feature as a Feature card (eg users should be able to switch languages)
    User story as a User story card (eg As a user, I want…)
    And then where are you adding the Given When Then? As these would normally be different scenarios, but there is no logical way of adding this in Target Process. Is each scenario a Task within the user story?

    Thanks

Request a demo
Our product specialists will show you the beauty and power of Targetprocess 3 and help you to customize it for your process and business requirements
Request a demo