Date post: | 05-Dec-2014 |
Category: |
Technology |
Upload: | tricode |
View: | 350 times |
Download: | 0 times |
Tricode BVDe Schutterij 12 -183905 PL Veenendaal
The Netherlands
tel: 0318 - 559210 fax: 0318 - 650909
Scenario’s in BDD – How and Why?Tricode Slide ShareJanuary 2014
In development it is common to use user stories:
User Story Formats
[Short title]As a [type of user]I want [feature]So that [benefit]
[Short title]In order to [benefit]As a[role]I need [feature]
User Stories for Tic Tac Toe
Starting a new game
As a player
I want to start a new
game
So that I can play the
gameMaking a move
As a player
I want to make a move
So that I can take my turns
in playing the game
Game overAs a playerI want to be told when the
game is overSo that I know whether I
have won or not
In behaviour driven development you will make scenarios out of
user stories:
Starting a new game
Scenarios for Tic Tac Toe
Start a new gameWhen I start a new gameThen I see a blank 3x3 grid
Become first player
Given I start a new game
When I want to become first
playerThen it is my turn to play
Become second playerGiven I start a new gameWhen I want to become second playerThen it is not my turn to play
Scenarios:- Given- When- Then
Game over
Scenarios for Tic Tac Toe
End game in a drawGiven a player has just made his moveAnd he has not wonWhen the grid is completely filledThen the game has endedAnd the game is a drawWin the game
Given a player has just made his moveWhen 3 of his marks are in a horizontal, vertical or diagonal rowThen the game has endedand that player has won
Making a move
Make a (legal) move
Given it is my turn to playWhen I select an empty fieldThen my marker (an X or O) is placed on that field And my turn is over
At Tricode, we
Scenarios
Why Tricode loves scenarios
• Based on explicit user behaviour• Fixed structure, clear communication• An efficiënt software development methodology
- Easy to implement- Easy to verify
• Understandable for both business and development
• Scenarios = test documentation
Follow us on:tricode.nlfacebook.com/tricodelinkedin.com/company/tricodeslideshare.net/tricodetwitter.com/tricode