Specification by example

  • 136 views
Uploaded on

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

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

More in: Technology , Business
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
136
On Slideshare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
4
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Living Documentationaka Specification By Exampleaka Acceptance Test Driven Development
  • 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. A Feature Quality should change with sell-in date
  • 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. 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. As Documentation
  • 7. As Verification
  • 8. Complex Scenarios