scenarios in behaviour driven development - how and why?

10
Tricode BV De Schutterij 12 -18 3905 PL Veenendaal The Netherlands tel: 0318 - 559210 fax: 0318 - 650909 www.tricode.nl [email protected] Scenario’s in BDD – How and Why? Tricode Slide Share January 2014

Upload: tricode

Post on 05-Dec-2014

351 views

Category:

Technology


0 download

DESCRIPTION

behavior driven development is all about scenarios. But how to make the scenarios? And what are the benefits of scenarios? That's where these slides are about.

TRANSCRIPT

Page 1: Scenarios in behaviour driven development - How and Why?

Tricode BVDe Schutterij 12 -183905 PL Veenendaal

The Netherlands

tel: 0318 - 559210 fax: 0318 - 650909

[email protected]

Scenario’s in BDD – How and Why?Tricode Slide ShareJanuary 2014

Page 2: Scenarios in behaviour driven development - How and Why?

In development it is common to use user stories:

Page 3: Scenarios in behaviour driven development - How and Why?

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]

Page 4: Scenarios in behaviour driven development - How and Why?

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

Page 5: Scenarios in behaviour driven development - How and Why?

In behaviour driven development you will make scenarios out of

user stories:

Page 6: Scenarios in behaviour driven development - How and Why?

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

Page 7: Scenarios in behaviour driven development - How and Why?

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

Page 8: Scenarios in behaviour driven development - How and Why?

At Tricode, we

Scenarios

Page 9: Scenarios in behaviour driven development - How and Why?

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

Page 10: Scenarios in behaviour driven development - How and Why?

Follow us on:tricode.nlfacebook.com/tricodelinkedin.com/company/tricodeslideshare.net/tricodetwitter.com/tricode