Specification by example

402 views
330 views

Published on

An example conversion from traditional requirements to an ATDD executable / living documentation style of requirements.

Based on the Gilded Rose Code Kata, working (executable) version of this requirement can be found on GitHub: https://github.com/wouterla/GildedRose/tree/origin/CucumberForRegresseionTest

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
402
On SlideShare
0
From Embeds
0
Number of Embeds
9
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Specification by example

  1. 1. Living Documentationaka Specification By Exampleaka Acceptance Test Driven Development
  2. 2. A RequirementWe buy and sell only the finest goods! Unfortunately, our goods are constantlydegrading in quality as they approach their sell by date. We have a system inplace that updates our inventory for us.● All items have a SellIng value which denotes the number of days we have to sell the item● All items have a Quality value which denotes how valuable the item is● At the end of each day our system lowers both values for every itemBut we also have the following business rules:● Once the sell by date has passed, Quality degrades twice as fast● The Quality of an item is never negative● "Aged Brie" actually increases in Quality the older it gets● The Quality of an item is never more than 50● "Sulfuras", being a legendary item, never has to be sold or decreases in Quality● "Backstage passes", like aged brie, increases in Quality as its SellIn value approaches; Quality increases by 2 when there are 10 days or less and by 3 when there are 5 days or less but Quality drops to 0 after the concertWe have recently signed a supplier of conjured items. This requires an update to our system:● "Conjured" items degrade in Quality twice as fast as normal items
  3. 3. A Feature Quality should change with sell-in date
  4. 4. A User StoryIn order to keep track of quality of items in stockAs a ShopkeeperI want quality to change as the sell-in date decreases
  5. 5. An Example "Aged Brie" actually increases in Quality the older it gets becomesScenario: Quality of Aged Brie increases by one every day instead of decreasing Given a Store Keeping Item with name "Aged Brie" And a sellIn date of 5 And a quality of 1 When the Item is updated Then the sellIn is 4 And the quality is 2
  6. 6. As Documentation
  7. 7. As Verification
  8. 8. Complex Scenarios

×