SlideShare une entreprise Scribd logo
1  sur  65
Télécharger pour lire hors ligne
Behavior Driven Development
Writing better scenario
Arnauld LOYER — @aloyer Mastering Software Development
EAre You really doing BDD?
Disclaimer
No scenario has been harmed during the investigation
github search:
extension:feature travel/deal/…
Most remarks are purely subjectives
@aloyer
Let’s try to diagnose the maturity
@aloyer
Anti-Pattern
… an antipattern was something
that seems like a good idea when
you begin, but leads you into
trouble.
http://martinfowler.com/bliki/AntiPattern.html
Having conversations with domain experts
and discover unknowns
and using examples
to gain a shared understanding of the desired behavior
@aloyer
C
Ready?
Functional Tests or BDD ?
@aloyer
Functional Tests or BDD ?
@aloyer
Functional Tests or BDD ?
@aloyer
Acceptance
Feature: The Confluence server is up



In order to make sure that Confluence has been installed and runs

As a developer

I want to access Confluence's home page



Scenario: Developer accesses the home page

Given the url of Confluences home page

When a web user browses to the url

Then the connection should be successful

Then the page status should be OK

Then the page should have the title "Confluence Setup Wizard - Confluence"
https://github.com/xebia-france/chef-confluence-jira-crowd/blob/a26e29a85d1e75b9b612a560685940b40c971adc/test/integration/confluence-jira-crowd/cucumber/confluence_up.feature
BDD ?
@aloyer
Feature: The Confluence server is up



In order to make sure that Confluence has been installed and runs

As a developer

I want to access Confluence's home page



Scenario: Developer accesses the home page

Given the url of Confluences home page

When a web user browses to the url

Then the connection should be successful

Then the page status should be OK

Then the page should have the title "Confluence Setup Wizard - Confluence"
https://github.com/xebia-france/chef-confluence-jira-crowd/blob/a26e29a85d1e75b9b612a560685940b40c971adc/test/integration/confluence-jira-crowd/cucumber/confluence_up.feature
Sanity CheckBDD ?
behavior ?
@aloyer
Feature: The Confluence server is up



In order to make sure that Confluence has been installed and runs

As a developer

I want to access Confluence's home page



Scenario: Developer accesses the home page

Given the url of Confluences home page

When a web user browses to the url

Then the connection should be successful

Then the page status should be OK

Then the page should have the title "Confluence Setup Wizard - Confluence"
https://github.com/xebia-france/chef-confluence-jira-crowd/blob/a26e29a85d1e75b9b612a560685940b40c971adc/test/integration/confluence-jira-crowd/cucumber/confluence_up.feature
Sanity CheckBDD ?
behavior ?
@aloyer
@aloyer 12
Given-When-Then
Then an outcome should be observed
Given a context
When an event happens
3 phases
setup/arrange
exercise/act
verify/assert
Tips
Feature: Asset Manager



@local-network

@normal

Scenario: check an asset can be loaded

Given I am testing "asset-manager"

And I am an authenticated API client

When I visit "/assets/513a0efbed915d425e000002"

Then I should get a 200 status code

And I should see "120613_Albania_Travel_Advice_WEB_Ed2_jpeg.jpg"



@normal

Scenario: check an asset can be served

Given I am testing "static"

When I visit "/media/
513a0efbed915d425e000002/120613_Albania_Travel_Advice_WEB_Ed2_jpeg.jpg"

Then I should get a 200 status code

And I should get a content length of "212880"
https://github.com/alphagov/smokey/blob/4c8fe739938e4a4b8b7bb393dfd485efd39dc034/features/asset_manager.feature
BDD ?
@aloyer
Feature: Asset Manager



@local-network

@normal

Scenario: check an asset can be loaded

Given I am testing "asset-manager"

And I am an authenticated API client

When I visit "/assets/513a0efbed915d425e000002"

Then I should get a 200 status code

And I should see "120613_Albania_Travel_Advice_WEB_Ed2_jpeg.jpg"



@normal

Scenario: check an asset can be served

Given I am testing "static"

When I visit "/media/
513a0efbed915d425e000002/120613_Albania_Travel_Advice_WEB_Ed2_jpeg.jpg"

Then I should get a 200 status code

And I should get a content length of "212880"
https://github.com/alphagov/smokey/blob/4c8fe739938e4a4b8b7bb393dfd485efd39dc034/features/asset_manager.feature
BDD ?
Business Language?
Technical Test
web page
Selenium
technical details
@aloyer
Feature: Asset Manager



@local-network

@normal

Scenario: check an asset can be loaded

Given I am testing "asset-manager"

And I am an authenticated API client

When I visit "/assets/513a0efbed915d425e000002"

Then I should get a 200 status code

And I should see "120613_Albania_Travel_Advice_WEB_Ed2_jpeg.jpg"



@normal

Scenario: check an asset can be served

Given I am testing "static"

When I visit "/media/
513a0efbed915d425e000002/120613_Albania_Travel_Advice_WEB_Ed2_jpeg.jpg"

Then I should get a 200 status code

And I should get a content length of "212880"
https://github.com/alphagov/smokey/blob/4c8fe739938e4a4b8b7bb393dfd485efd39dc034/features/asset_manager.feature
BDD ? Technical Test
differences?
@aloyer
different results?
Unclear and non-sustainable
Tests BDD
Business
Tech’
Cucumber
Behavior
Let’s try to diagnose the maturity
@aloyer
Should I use cucumber to write technical tests?
Be pragmatic!
Who will read the scenario?
Are you ready to pay the cucumber overhead?
compared to raw xUnit tests
Do you really contribute to a shared knowledge or do you increase the
business/technical gap?
@aloyer
Who write the scenario ?
&read
@aloyer
L
N
C
Tester
Business/PO Developer
?
@aloyer
Feature: Asset Manager



@local-network

@normal

Scenario: check an asset can be loaded

Given I am testing "asset-manager"

And I am an authenticated API client

When I visit "/assets/513a0efbed915d425e000002"

Then I should get a 200 status code

And I should see "120613_Albania_Travel_Advice_WEB_Ed2_jpeg.jpg"



@normal

Scenario: check an asset can be served

Given I am testing "static"

When I visit "/media/
513a0efbed915d425e000002/120613_Albania_Travel_Advice_WEB_Ed2_jpeg.jpg"

Then I should get a 200 status code

And I should get a content length of "212880"
https://github.com/alphagov/smokey/blob/4c8fe739938e4a4b8b7bb393dfd485efd39dc034/features/asset_manager.feature
Who wrote this ?
@aloyer
@MoveToken

Feature: Moving the token over the board



As a player

I want to move to new positions on the board

So that I can get rich and win the game



Scenario Outline: Moving a token after a single throw

Given players token is at starting position <startingPosition>

When player throws die1 <die1> and die2 <die2>

Then players token moves to a new position <newPosition>



Examples:

| startingPosition | die1 | die2 | newPosition |

| 1 | 1 | 2 | 4 |

| 2 | 3 | 4 | 9 |

| 39 | 2 | 2 | 3 |

Forgot the rule ?
https://github.com/xebia/spec-by-example-2014-09-29/blob/4eabded6b22e816f6509a3ecd2c2180b62f4d73d/src/test/resources/monopoly/cucumber/MoveToken.feature
@aloyer
@MoveToken

Feature: Moving the token over the board



As a player

I want to move to new positions on the board

So that I can get rich and win the game



Scenario Outline: Moving a token after a single throw

Given players token is at starting position <startingPosition>

When player throws die1 <die1> and die2 <die2>

Then players token moves to a new position <newPosition>



Examples:

| startingPosition | die1 | die2 | newPosition |

| 1 | 1 | 2 | 4 |

| 2 | 3 | 4 | 9 |

| 39 | 2 | 2 | 3 |

Forgot the rule ?
https://github.com/xebia/spec-by-example-2014-09-29/blob/4eabded6b22e816f6509a3ecd2c2180b62f4d73d/src/test/resources/monopoly/cucumber/MoveToken.feature
@aloyer
where is the rule?
The All-In-One Effect
@MoveToken

Feature: Moving the token over the board



As a player

I want to move to new positions on the board

So that I can get rich and win the game



Scenario Outline: Moving a token after a single throw

Given players token is at starting position <startingPosition>

When player throws die1 <die1> and die2 <die2>

Then players token moves to a new position <newPosition>



Examples:

| startingPosition | die1 | die2 | newPosition |

| 1 | 1 | 2 | 4 |

| 2 | 3 | 4 | 9 |

| 39 | 2 | 2 | 3 |

Forgot the rule ?
https://github.com/xebia/spec-by-example-2014-09-29/blob/4eabded6b22e816f6509a3ecd2c2180b62f4d73d/src/test/resources/monopoly/cucumber/MoveToken.feature
where is the rule?
the outline effect
@aloyer
The All-In-One Effect
Feature: Deal team invitations



1. A "My deals" section with

The deals that I created

The deals on which me or my team are deal leaders

The deals on which me or my team are deal members



2. A "Other deals" section with:

The deals for which me or my team are "other contact"



Scenario Outline: People invited into deal team directly

Given the following deals have been created

| Name | Creator | User leaders | User members | User other contacts |

| AF | John | Charlotte | Peter | Diego |

| KLM | Charlotte | John | Charlotte | Peter |

| IB | Charlotte | Charlotte | John | Peter |

| GW | Diego | Charlotte | Peter | John |

| TAP | Diego | Charlotte | Peter | |

| TUN | Diego | Charlotte | Peter | Matthieu |

When <user> logs into the platform

Then the My deals section should have only <my deals>

And the Other deals section should have only <other deals>



Examples:

| user | my deals | other deals |

| John | AF, KLM, IB | GW |

| Charlotte | AF, KLM, IB, GW, TAP, TUN | <none> |

| Peter | AF, GW, TAP, TUN | KLM, IB |

| Matthieu | <none> | TUN |

| Mariem | <none> | <none> |
Is the rule obvious?
@aloyer
Feature: Deal team invitations



1. A "My deals" section with

The deals that I created

The deals on which me or my team are deal leaders

The deals on which me or my team are deal members



2. A "Other deals" section with:

The deals for which me or my team are "other contact"



Scenario Outline: People invited into deal team directly

Given the following deals have been created

| Name | Creator | User leaders | User members | User other contacts |

| AF | John | Charlotte | Peter | Diego |

| KLM | Charlotte | John | Charlotte | Peter |

| IB | Charlotte | Charlotte | John | Peter |

| GW | Diego | Charlotte | Peter | John |

| TAP | Diego | Charlotte | Peter | |

| TUN | Diego | Charlotte | Peter | Matthieu |

When <user> logs into the platform

Then the My deals section should have only <my deals>

And the Other deals section should have only <other deals>



Examples:

| user | my deals | other deals |

| John | AF, KLM, IB | GW |

| Charlotte | AF, KLM, IB, GW, TAP, TUN | <none> |

| Peter | AF, GW, TAP, TUN | KLM, IB |

| Matthieu | <none> | TUN |

| Mariem | <none> | <none> |
Is the rule obvious?ARE
S
Feature: Deal team invitations



1. A "My deals" section with

The deals that I created

The deals on which me or my team are deal leaders

The deals on which me or my team are deal members



2. A "Other deals" section with:

The deals for which me or my team are "other contact"



Scenario Outline: People invited into deal team directly

Given the following deals have been created

| Name | Creator | User leaders | User members | User other contacts |

| AF | John | Charlotte | Peter | Diego |

| KLM | Charlotte | John | Charlotte | Peter |

| IB | Charlotte | Charlotte | John | Peter |

| GW | Diego | Charlotte | Peter | John |

| TAP | Diego | Charlotte | Peter | |

| TUN | Diego | Charlotte | Peter | Matthieu |

When <user> logs into the platform

Then the My deals section should have only <my deals>

And the Other deals section should have only <other deals>



Examples:

| user | my deals | other deals |

| John | AF, KLM, IB | GW |

| Charlotte | AF, KLM, IB, GW, TAP, TUN | <none> |

| Peter | AF, GW, TAP, TUN | KLM, IB |

| Matthieu | <none> | TUN |

| Mariem | <none> | <none> |
what if …I belongs to multiple group?
Is the rule obvious?ARE
S
the outline effect
Feature: Deal team invitations



1. A "My deals" section with

The deals that I created

The deals on which me or my team are deal leaders

The deals on which me or my team are deal members



2. A "Other deals" section with:

The deals for which me or my team are "other contact"



Scenario Outline: People invited into deal team directly

Given the following deals have been created

| Name | Creator | User leaders | User members | User other contacts |

| AF | John | Charlotte | Peter | Diego |

| KLM | Charlotte | John | Charlotte | Peter |

| IB | Charlotte | Charlotte | John | Peter |

| GW | Diego | Charlotte | Peter | John |

| TAP | Diego | Charlotte | Peter | |

| TUN | Diego | Charlotte | Peter | Matthieu |

When <user> logs into the platform

Then the My deals section should have only <my deals>

And the Other deals section should have only <other deals>



Examples:

| user | my deals | other deals |

| John | AF, KLM, IB | GW |

| Charlotte | AF, KLM, IB, GW, TAP, TUN | <none> |

| Peter | AF, GW, TAP, TUN | KLM, IB |

| Matthieu | <none> | TUN |

| Mariem | <none> | <none> |
what if …I belongs to multiple group?
Is the rule obvious?ARE
S
the outline effect
Feature: Deals display order in the home page

As an FO

I need to see my deals ordered in the way that fits my function

In order to have a clear view of the most important or urgent deals.



Clarifications:

Deals should be ordered by expected closing date, the first deals displayed should be the ones with the oldest expected closing date.

For cards display, the oldest cards will be on the top and for cards on the same row, the oldest card will be on the left.

For table display, the oldest cards will on the top.

For deals with the same expected closing date, they should be ordered by deal name



Scenario: Deals display order

Given the following deals

| name | client name | total amount | creator | user leaders | user members | user other contacts | expected closing date | pricing status | Credit approval status | Lso deal code | Cwf request code | stage | confidentiality level |

| Aircraft AF | Air France | 150000000 | Johny | Charlotte | Peter | Diego | May 12, 2016 | true | Not submitted | L0377450 | 2015_07_001105 | Marketing | My Team |

| Aircraft KLM | KLM | 15000000 | Charlotte | Johny | Charlotte | Peter | Jul 11, 2014 | false | In progress | L0377451 | 2015_08_001105 | Bidding | Confidential |

| Aircraft TUN | Tunisair | 16000000 | Johny | Charlotte | Charlotte | Peter | Jul 12, 2014 | false | In progress | L0377451 | 2015_09_001105 | Bidding | My Team |



When Charlotte logs into the platform

Then the My deals section must be ordered as Aircraft KLM,Aircraft TUN,Aircraft AF

the A4 rule ?
@aloyer
Feature: Deals display order in the home page

As an FO

I need to see my deals ordered in the way that fits my function

In order to have a clear view of the most important or urgent deals.



Clarifications:

Deals should be ordered by expected closing date, the first deals displayed should be the ones with the oldest expected closing date.

For cards display, the oldest cards will be on the top and for cards on the same row, the oldest card will be on the left.

For table display, the oldest cards will on the top.

For deals with the same expected closing date, they should be ordered by deal name



Scenario: Deals display order

Given the following deals

| name | client name | total amount | creator | user leaders | user members | user other contacts | expected closing date | pricing status | Credit approval status | Lso deal code | Cwf request code | stage | confidentiality level |

| Aircraft AF | Air France | 150000000 | Johny | Charlotte | Peter | Diego | May 12, 2016 | true | Not submitted | L0377450 | 2015_07_001105 | Marketing | My Team |

| Aircraft KLM | KLM | 15000000 | Charlotte | Johny | Charlotte | Peter | Jul 11, 2014 | false | In progress | L0377451 | 2015_08_001105 | Bidding | Confidential |

| Aircraft TUN | Tunisair | 16000000 | Johny | Charlotte | Charlotte | Peter | Jul 12, 2014 | false | In progress | L0377451 | 2015_09_001105 | Bidding | My Team |



When Charlotte logs into the platform

Then the My deals section must be ordered as Aircraft KLM,Aircraft TUN,Aircraft AF

the A4 rule ?
Feature: Deals display order in the home page

Deals should be ordered by expected closing date, the first deals
displayed should be the ones with the oldest expected closing date.

For deals with the same expected closing date, they should be ordered
by deal name



Scenario: Deals display order

Given the following deals

| name | client name | total amount | creator | user leaders | user memb
| AF | Air France | 150000000 | Johny | Charlotte | Peter
| KLM | KLM | 15000000 | Charlotte | Johny | Charlotte
| TUN | Tunisair | 16000000 | Johny | Charlotte | Charlotte


When Charlotte logs into the platform

Then the My deals section must be ordered as KLM, TUN, AF
Feature: Deals display order in the home page

As an FO

I need to see my deals ordered in the way that fits my function

In order to have a clear view of the most important or urgent deals.



Clarifications:

Deals should be ordered by expected closing date, the first deals displayed should be the ones with the oldest expected closing date.

For cards display, the oldest cards will be on the top and for cards on the same row, the oldest card will be on the left.

For table display, the oldest cards will on the top.

For deals with the same expected closing date, they should be ordered by deal name



Scenario: Deals display order

Given the following deals

| name | client name | total amount | creator | user leaders | user members | user other contacts | expected closing date | pricing status | Credit approval status | Lso deal code | Cwf request code | stage | confidentiality level |

| Aircraft AF | Air France | 150000000 | Johny | Charlotte | Peter | Diego | May 12, 2016 | true | Not submitted | L0377450 | 2015_07_001105 | Marketing | My Team |

| Aircraft KLM | KLM | 15000000 | Charlotte | Johny | Charlotte | Peter | Jul 11, 2014 | false | In progress | L0377451 | 2015_08_001105 | Bidding | Confidential |

| Aircraft TUN | Tunisair | 16000000 | Johny | Charlotte | Charlotte | Peter | Jul 12, 2014 | false | In progress | L0377451 | 2015_09_001105 | Bidding | My Team |



When Charlotte logs into the platform

Then the My deals section must be ordered as Aircraft KLM,Aircraft TUN,Aircraft AF

the A4 rule ?
Feature: Deals display order in the home page

Deals should be ordered by expected closing date, the first deals
displayed should be the ones with the oldest expected closing date.

For deals with the same expected closing date, they should be ordered
by deal name



Scenario: Deals display order

Given the following deals

| name | client name | total amount | creator | user leaders | user memb
| AF | Air France | 150000000 | Johny | Charlotte | Peter
| KLM | KLM | 15000000 | Charlotte | Johny | Charlotte
| TUN | Tunisair | 16000000 | Johny | Charlotte | Charlotte


When Charlotte logs into the platform

Then the My deals section must be ordered as KLM, TUN, AF
Feature: Deals display order in the home page

As an FO

I need to see my deals ordered in the way that fits my function

In order to have a clear view of the most important or urgent deals.



Clarifications:

Deals should be ordered by expected closing date, the first deals displayed should be the ones with the oldest expected closing date.

For cards display, the oldest cards will be on the top and for cards on the same row, the oldest card will be on the left.

For table display, the oldest cards will on the top.

For deals with the same expected closing date, they should be ordered by deal name



Scenario: Deals display order

Given the following deals

| name | client name | total amount | creator | user leaders | user members | user other contacts | expected closing date | pricing status | Credit approval status | Lso deal code | Cwf request code | stage | confidentiality level |

| Aircraft AF | Air France | 150000000 | Johny | Charlotte | Peter | Diego | May 12, 2016 | true | Not submitted | L0377450 | 2015_07_001105 | Marketing | My Team |

| Aircraft KLM | KLM | 15000000 | Charlotte | Johny | Charlotte | Peter | Jul 11, 2014 | false | In progress | L0377451 | 2015_08_001105 | Bidding | Confidential |

| Aircraft TUN | Tunisair | 16000000 | Johny | Charlotte | Charlotte | Peter | Jul 12, 2014 | false | In progress | L0377451 | 2015_09_001105 | Bidding | My Team |



When Charlotte logs into the platform

Then the My deals section must be ordered as Aircraft KLM,Aircraft TUN,Aircraft AF

the A4 rule ?
Feature: Deals display order in the home page

Deals should be ordered by expected closing date, the first deals
displayed should be the ones with the oldest expected closing date.

For deals with the same expected closing date, they should be ordered
by deal name



Scenario: Deals display order

Given the following deals

| name | client name | total amount | creator | user leaders | user memb
| AF | Air France | 150000000 | Johny | Charlotte | Peter
| KLM | KLM | 15000000 | Charlotte | Johny | Charlotte
| TUN | Tunisair | 16000000 | Johny | Charlotte | Charlotte


When Charlotte logs into the platform

Then the My deals section must be ordered as KLM, TUN, AF
B
Feature: Deals display order in the home page

As an FO

I need to see my deals ordered in the way that fits my function

In order to have a clear view of the most important or urgent deals.



Clarifications:

Deals should be ordered by expected closing date, the first deals displayed should be the ones with the oldest expected closing date.

For cards display, the oldest cards will be on the top and for cards on the same row, the oldest card will be on the left.

For table display, the oldest cards will on the top.

For deals with the same expected closing date, they should be ordered by deal name



Scenario: Deals display order

Given the following deals

| name | client name | total amount | creator | user leaders | user members | user other contacts | expected closing date | pricing status | Credit approval status | Lso deal code | Cwf request code | stage | confidentiality level |

| Aircraft AF | Air France | 150000000 | Johny | Charlotte | Peter | Diego | May 12, 2016 | true | Not submitted | L0377450 | 2015_07_001105 | Marketing | My Team |

| Aircraft KLM | KLM | 15000000 | Charlotte | Johny | Charlotte | Peter | Jul 11, 2014 | false | In progress | L0377451 | 2015_08_001105 | Bidding | Confidential |

| Aircraft TUN | Tunisair | 16000000 | Johny | Charlotte | Charlotte | Peter | Jul 12, 2014 | false | In progress | L0377451 | 2015_09_001105 | Bidding | My Team |



When Charlotte logs into the platform

Then the My deals section must be ordered as Aircraft KLM,Aircraft TUN,Aircraft AF

the A4 rule ?
Feature: Deals display order in the home page

Deals should be ordered by expected closing date, the first deals
displayed should be the ones with the oldest expected closing date.

For deals with the same expected closing date, they should be ordered
by deal name



Scenario: Deals display order

Given the following deals

| name | expected closing date |

| AF | May 12, 2016 |

| KLM | Jul 11, 2014 |

| TUN | Jul 12, 2014 |


When Charlotte logs into the platform

Then the My deals section must be ordered as KLM, TUN, AF
O
Tests BDD
Business
Tech’
Cucumber
Behavior
Let’s try to diagnose the maturity
@aloyer
Cucumber
3 Amigos
Tests BDD
Business
Tech’
Behavior
Let’s try to diagnose the maturity
@aloyer
Cucumber
3 Amigos
Tests BDD
Business
Tech’
Behavior
Let’s try to diagnose the maturity
Scenario
@aloyer
Cucumber
Scenario
3 Amigos
Driven Development
Tests BDD
Business
Tech’
Behavior
Let’s try to diagnose the maturity
@aloyer
Scenario should be written using the Business Language
Together
What is the intent?
Have I understood the expected behavior?
Do I clearly understand the rule when reading a scenario?
How many rules are exposed within the scenario?
@aloyer
Try to limit to One rule per scenario
What level of details ?
Writing better scenario
@aloyer
@BuyingProperties

Feature: Buying properties



As a player

I want to buy properties

So that I can ask rent when my opponents land on it



Scenario: Buying property

Given I land on unowned property

And my funds are sufficient

When I choose to buy the property

Then I pay the printed price

And I receive the title deed





Scenario: No sufficient funds

Given I land on unowned property

And my funds are not sufficient

Then I am not able to buy the property

https://github.com/xebia/workshop-agile-testing/blob/8705e3f93270662285cd9c8ec8c24e5ac957f3ed/src/test/resources/features/BuyingProperties.feature
Enough details ?
@aloyer
@BuyingProperties

Feature: Buying properties



As a player

I want to buy properties

So that I can ask rent when my opponents land on it



Scenario: Buying property

Given I land on unowned property

And my funds are sufficient

When I choose to buy the property

Then I pay the printed price

And I receive the title deed





Scenario: No sufficient funds

Given I land on unowned property

And my funds are not sufficient

Then I am not able to buy the property

https://github.com/xebia/workshop-agile-testing/blob/8705e3f93270662285cd9c8ec8c24e5ac957f3ed/src/test/resources/features/BuyingProperties.feature
Enough details ? too declarative
which one?
what does it mean?
« Pay »
is an outcome?
Choose?
@aloyer
Scenario: Buying property

Given I land on unowned property

And my funds are sufficient

When I choose to buy the property

Then I pay the printed price

And I receive the title deed
@aloyer
Scenario: Buying property

Given I land on unowned property

And my funds are sufficient

When I choose to buy the property

Then I pay the printed price

And I receive the title deed


@default_properties

Scenario: Buying property



Given I land on unowned "west" property

And my funds are 2000

When I buy the property

And I pay the printed price

Then I should receive the "west" title deed

And my funds should be decreased to 1800
@aloyer
Scenario: Buying property

Given I land on unowned property

And my funds are sufficient

When I choose to buy the property

Then I pay the printed price

And I receive the title deed
to pay is an action (when)
not an outcome (then) value can be changed


@default_properties

Scenario: Buying property



Given I land on unowned "west" property

And my funds are 2000

When I buy the property

And I pay the printed price

Then I should receive the "west" title deed

And my funds should be decreased to 1800
can help to project to other case
Can it always be applied?
@aloyer
Scenario: Buying property

Given I land on unowned property

And my funds are sufficient

When I choose to buy the property

Then I pay the printed price

And I receive the title deed


@default_properties

Scenario: Buying property



Given I land on unowned "west" property

And my funds are 2000

When I buy the property

And I pay the printed price

Then I should receive the "west" title deed

And my funds should be decreased to 1800
@Then("^my funds should be (?:decreased to |increased to )?(d+)$")

public void my_funds_should_be_(int amount)
@aloyer
Scenario: Buying property

Given I land on unowned property

And my funds are sufficient

When I choose to buy the property

Then I pay the printed price

And I receive the title deed
@default_properties

Scenario: Default properties - by tag

Then the available properties should be at least:

| name | price |

| east | 150 |

| west | 200 |

| north | 100 |

| south | 40 |


@default_properties

Scenario: Buying property



Given I land on unowned "west" property

And my funds are 2000

When I buy the property

And I pay the printed price

Then I should receive the "west" title deed

And my funds should be decreased to 1800
@aloyer
Scenario: Default properties - explicit

Given the default properties are used

Then the available properties should be at least:

| name | price |

| east | 150 |

| west | 200 |

| north | 100 |

| south | 40 |
Scenario: Buying property

Given I land on unowned property

And my funds are sufficient

When I choose to buy the property

Then I pay the printed price

And I receive the title deed
@default_properties

Scenario: Default properties - by tag

Then the available properties should be at least:

| name | price |

| east | 150 |

| west | 200 |

| north | 100 |

| south | 40 |


@default_properties

Scenario: Buying property



Given I land on unowned "west" property

And my funds are 2000

When I buy the property

And I pay the printed price

Then I should receive the "west" title deed

And my funds should be decreased to 1800
@aloyer
Scenario: Buying property

Given I land on unowned property

And my funds are sufficient

When I choose to buy the property

Then I pay the printed price

And I receive the title deed


@default_properties @default_player

Scenario: Buying property





Given I land on unowned "west" property that cost 180

When I choose to buy the property

And I pay the printed price

Then I should receive the "west" title deed

And my funds should be decreased by 180


@default_properties

Scenario: Buying property



Given I land on unowned "west" property

And my funds are 2000

When I buy the property

And I pay the printed price

Then I should receive the "west" title deed

And my funds should be decreased to 1800
@aloyer
Scenario: Create a Stock option
Given the following option:
| Property | Value |
| delivery | Cash |
| bo strike | no |
| floor | 0 |
| forex constat | - |
| forex constat date | 1970-JAN-01 |
| forex start date | 1970-JAN-01 |
| guaranteed currency | EUR |
| guaranteed rate | 0 |
| initial spot | 0 |
...
| maturity | 2020-FEB-05 |
| option quotity | 1 |
| strike | 2500 |
| underlying id | SOCIETE-GLE_X |
| underlying type | Stock |
And the option’s restriking infos is:
| Property | Value |
| floating rate | no |
| fixed rate | no |
...
| last update | <now> |
| first trading date | <now> |
| rate offset | 0.0 |
When I create the option
Then the option id should be filled in
Scenario: Create a Fund option
Given the following option:
| Property | Value |
| delivery | Cash |
| bo strike | no |
| floor | 0 |
| forex constat | - |
| forex constat date | 1970-JAN-01 |
| forex start date | 1970-JAN-01 |
| guaranteed currency | EUR |
| guaranteed rate | 0 |
| initial spot | 0 |
...
| maturity | 2020-FEB-05 |
| option quotity | 1 |
| strike | 2500 |
| underlying id | SOCIETE-GLE_X |
| underlying type | Fund |
And the option’s restriking infos is:
| Property | Value |
| floating rate | no |
| fixed rate | no |
...
| last update | <now> |
| first trading date | <now> |
| rate offset | 0.0 |
When I create the option
Then the option id should be filled in
~53 properties
~20 properties
@aloyer
Too much details ?
Scenario: Create an external OTC deal
Given the following option:
| Property | Value |
| delivery | Cash |
| bo strike | no |
| floor | 0 |
| forex constat | - |
| forex constat date | 1970-JAN-01 |
| forex start date | 1970-JAN-01 |
| guaranteed currency | EUR |
| guaranteed rate | 0 |
| initial spot | 0 |
...
| maturity | 2020-FEB-05 |
| option quotity | 1 |
| strike | 2500 |
| underlying id | SOCIETE-GLE_X |
| underlying type | Stock |
And the option’s restriking infos is:
| Property | Value |
| floating rate | no |
| fixed rate | no |
...
| last update | <now> |
| first trading date | <now> |
| rate offset | 0.0 |
And an external OTC deal:
| Property | Value |
| category | OTC |
| delivery | - |
| initial price | 0 |
| internal market | yes |
| last update | <now> |
...
| quantity | 6000 |
| remaining quantity | 6000 |
And the deal’s counter part is:
| Property | Value |
| confirm mode | ST |
| market maker | Nefertiti |
...
And the deal’s sales part is:
| Property | Value |
| accounting center | - |
| derogation | no |
...
And the deal’s collateral is:
| Property | Value |
| IA | no |
| currency | - |
...
When I create the option
And I create the deal with the created option
Then the deal id should be filled in
~58
~5
~58
~22
@aloyer
Too much details ?
Scenario: Standard option
Given a standard option with no specifics
Then the option should have the following properties:
| Property | Value |
| delivery | Cash |
| bo strike | no |
| floor | 0 |
| forex constat | - |
| forex constat date | 1970-JAN-01 |
| forex start date | 1970-JAN-01 |
| guaranteed currency | EUR |
| guaranteed rate | 0 |
| initial spot | 0 |
...
| maturity | 2020-FEB-05 |
| option quotity | 1 |
| strike | 2500 |
| underlying id | SOCIETE-GLE_X |
| underlying type | Stock |
| restriking infos | <standard> |
~53 properties
Scenario: Standard option’s restriking infos
Given a standard option’s restriking infos
Then the option’s restriking infos should be:
| Property | Value |
| floating rate | no |
| fixed rate | no |
...
| last update | <now> |
| first trading date | <now> |
| rate offset | 0.0 |
~20
@aloyer
Too much details ? use persona
Persona is checked
AND documented
Scenario: Create a Stock option
Given the following option:
| Property | Value |
| delivery | Cash |
| bo strike | no |
| floor | 0 |
| forex constat | - |
| forex constat date | 1970-JAN-01 |
| forex start date | 1970-JAN-01 |
| guaranteed currency | EUR |
| guaranteed rate | 0 |
| initial spot | 0 |
...
| maturity | 2020-FEB-05 |
| option quotity | 1 |
| strike | 2500 |
| underlying id | SOCIETE-GLE_X |
| underlying type | Stock |
And the option’s restriking infos is:
| Property | Value |
| floating rate | no |
| fixed rate | no |
...
| last update | <now> |
| first trading date | <now> |
| rate offset | 0.0 |
When I create the option
Then the option id should be filled in
Scenario: Create a Stock Option
Given a standard option with the following specifics:
| underlying type | underlying id |
| Stock | SOCIETE-GLE_X |
When I create the option
Then the option id should be filled in
@aloyer
Too much details ? use persona
Enough details ?
http://blog.thiga.fr/product-management/bdd-gherkin-pour-ecrire-vos-user-stories/
@aloyer
Enough details ?
http://blog.thiga.fr/product-management/bdd-gherkin-pour-ecrire-vos-user-stories/
@aloyer
Lot of details there
no details!
no way to challenge the result
Enough details ?
http://blog.thiga.fr/product-management/bdd-gherkin-pour-ecrire-vos-user-stories/
@aloyer
Lot of details there,
6 decimals precision!
GPS?
GPS? - destination is
usually an address!
Enough details ?
http://blog.thiga.fr/product-management/bdd-gherkin-pour-ecrire-vos-user-stories/
@aloyer
why no date there
but it is explicit there
Enough details ?
http://blog.thiga.fr/product-management/bdd-gherkin-pour-ecrire-vos-user-stories/
@aloyer
Why would such result
exist?
@aloyer
@aloyer
# language: fr

Fonctionnalité:













@reseau_simplifié

Scénario: Obtenir une feuille de l'itinéraire par d'arrivée



2 Place de la Défense: 48.893195, 2.238945



Etant donné que je veux aller de "48.893195, 2.238945" au "25 rue du Louvre, Paris"

Et que je veux partir à 9h30 avec les options suivantes:

| X | Transport en commun |

| X | Le plus rapide |

| | Le moins de changement |

Alors je devrais obtenir la feuille de route suivante:

| Type | Heure | Localisation | Transport | Durée | Distance |

| départ | 9h30 | 2 Place de la Défense | Pied | ~5min | 400m |

| - | 9h37 | La Défense | RER A vers Vincennes | 10min | - |

| - | 9h47 | Châtelet - Les Halles | Pied | ~7min | 550m |

| arrivée | 9h54 | 25 rue du Louve | - | - | - |
@aloyer
# language: fr

Fonctionnalité:







Scénario: Rer A dans le réseau de transport simplifié



Etant donné le réseau de transport simplifié "Parisien"

Alors le Rer A devrait passer toutes les 10mins à "la Défense" à partir de 5h37

Alors les temps de transport cumulés depuis "la Défense" devraient être:

| Charles de Gaulle Etoile | 5min |

| Auber | 7min |

| Chatelet les Halles | 10min |





@reseau_simplifié

Scénario: Obtenir une feuille de l'itinéraire par d'arrivée



2 Place de la Défense: 48.893195, 2.238945



Etant donné que je veux aller de "48.893195, 2.238945" au "25 rue du Louvre, Paris"

Et que je veux partir à 9h30 avec les options suivantes:

| X | Transport en commun |

| X | Le plus rapide |

| | Le moins de changement |

Alors je devrais obtenir la feuille de route suivante:

| Type | Heure | Localisation | Transport | Durée | Distance |

| départ | 9h30 | 2 Place de la Défense | Pied | ~5min | 400m |

| - | 9h37 | La Défense | RER A vers Vincennes | 10min | - |

| - | 9h47 | Châtelet - Les Halles | Pied | ~7min | 550m |

| arrivée | 9h54 | 25 rue du Louve | - | - | - |
To be continued…
@aloyer
# language: fr

Fonctionnalité:



Scénario: Le métro 1 dans le réseau de transport simplifié



Etant donné le réseau de transport simplifié "Parisien"

Alors le métro 1 devrait passer dans chaque station toutes les 5mins à partir de 6h00



Scénario: Rer A dans le réseau de transport simplifié



Etant donné le réseau de transport simplifié "Parisien"

Alors le Rer A devrait passer toutes les 10mins à "la Défense" à partir de 5h37

Alors les temps de transport cumulés depuis "la Défense" devraient être:

| Charles de Gaulle Etoile | 5min |

| Auber | 7min |

| Chatelet les Halles | 10min |





@reseau_simplifié

Scénario: Obtenir une feuille de l'itinéraire par d'arrivée



2 Place de la Défense: 48.893195, 2.238945



Etant donné que je veux aller de "48.893195, 2.238945" au "25 rue du Louvre, Paris"

Et que je veux partir à 9h30 avec les options suivantes:

| X | Transport en commun |

| X | Le plus rapide |

| | Le moins de changement |

Alors je devrais obtenir la feuille de route suivante:

| Type | Heure | Localisation | Transport | Durée | Distance |

| départ | 9h30 | 2 Place de la Défense | Pied | ~5min | 400m |

| - | 9h37 | La Défense | RER A vers Vincennes | 10min | - |

| - | 9h47 | Châtelet - Les Halles | Pied | ~7min | 550m |

| arrivée | 9h54 | 25 rue du Louve | - | - | - |
Adjust the cursor
@aloyer
declarative imperative
too much
details
not enough
details
Adjust the cursor
@aloyer
declarative imperative
too much
details
not enough
details
Together!
Remove ambiguities but keep scenario short
Am I concrete enough on the expected behavior?
Signal vs noise ratio?
What if the scenario has more details?
@aloyer
Rely on Persona/Defaults…
Do Scenario Review…
is NOT About is About
BDD
!
"
KLa tool for test automation communication
acceptance criteriaL K behavior
Questions?
Arnauld LOYER — @aloyer
QTraining
Coaching
/[TBD]DD/
Testing/Clean Code
Mastering Software Development

Contenu connexe

Tendances

Demystifying observability
Demystifying observability Demystifying observability
Demystifying observability Abigail Bangser
 
Domain Driven Design (DDD)
Domain Driven Design (DDD)Domain Driven Design (DDD)
Domain Driven Design (DDD)Tom Kocjan
 
Lambda and Stream Master class - part 1
Lambda and Stream Master class - part 1Lambda and Stream Master class - part 1
Lambda and Stream Master class - part 1José Paumard
 
Building Fullstack Graph Applications With Neo4j
Building Fullstack Graph Applications With Neo4j Building Fullstack Graph Applications With Neo4j
Building Fullstack Graph Applications With Neo4j Neo4j
 
Modern Java web applications with Spring Boot and Thymeleaf
Modern Java web applications with Spring Boot and ThymeleafModern Java web applications with Spring Boot and Thymeleaf
Modern Java web applications with Spring Boot and ThymeleafLAY Leangsros
 
Pivotal Labs 고객사례 - Coinone
Pivotal Labs 고객사례 - CoinonePivotal Labs 고객사례 - Coinone
Pivotal Labs 고객사례 - CoinoneVMware Tanzu Korea
 
Microservices Interview Questions and Answers | Microservices Architecture Tr...
Microservices Interview Questions and Answers | Microservices Architecture Tr...Microservices Interview Questions and Answers | Microservices Architecture Tr...
Microservices Interview Questions and Answers | Microservices Architecture Tr...Edureka!
 
Beyond the Spotify model - Team Topologies - Keynote at JAX DevOps 2019-05-16...
Beyond the Spotify model - Team Topologies - Keynote at JAX DevOps 2019-05-16...Beyond the Spotify model - Team Topologies - Keynote at JAX DevOps 2019-05-16...
Beyond the Spotify model - Team Topologies - Keynote at JAX DevOps 2019-05-16...Matthew Skelton
 
The Apache Solr Semantic Knowledge Graph
The Apache Solr Semantic Knowledge GraphThe Apache Solr Semantic Knowledge Graph
The Apache Solr Semantic Knowledge GraphTrey Grainger
 
Specification-By-Example with Gherkin
Specification-By-Example with GherkinSpecification-By-Example with Gherkin
Specification-By-Example with GherkinChristian Hassa
 
Hexagonal architecture vs Functional core / Imperative shell
Hexagonal architecture vs Functional core / Imperative shellHexagonal architecture vs Functional core / Imperative shell
Hexagonal architecture vs Functional core / Imperative shellThomas Pierrain
 
Breaking Dependencies Legacy Code - Cork Software Crafters - September 2019
Breaking Dependencies Legacy Code -  Cork Software Crafters - September 2019Breaking Dependencies Legacy Code -  Cork Software Crafters - September 2019
Breaking Dependencies Legacy Code - Cork Software Crafters - September 2019Paulo Clavijo
 
Building Adaptive Systems with Wardley Mapping, Domain-Driven Design, and Tea...
Building Adaptive Systems with Wardley Mapping, Domain-Driven Design, and Tea...Building Adaptive Systems with Wardley Mapping, Domain-Driven Design, and Tea...
Building Adaptive Systems with Wardley Mapping, Domain-Driven Design, and Tea...Susanne Kaiser
 
Pragmatic RESTful API Design: Apigee Webinar
Pragmatic RESTful API Design: Apigee WebinarPragmatic RESTful API Design: Apigee Webinar
Pragmatic RESTful API Design: Apigee WebinarApigee | Google Cloud
 
DevOps and Continuous Delivery Reference Architectures (including Nexus and o...
DevOps and Continuous Delivery Reference Architectures (including Nexus and o...DevOps and Continuous Delivery Reference Architectures (including Nexus and o...
DevOps and Continuous Delivery Reference Architectures (including Nexus and o...Sonatype
 
Dynatrace Cloud-Native Workshop Slides
Dynatrace Cloud-Native Workshop SlidesDynatrace Cloud-Native Workshop Slides
Dynatrace Cloud-Native Workshop SlidesVMware Tanzu
 
Let's build Developer Portal with Backstage
Let's build Developer Portal with BackstageLet's build Developer Portal with Backstage
Let's build Developer Portal with BackstageOpsta
 
Devops Devops Devops, at Froscon
Devops Devops Devops, at FrosconDevops Devops Devops, at Froscon
Devops Devops Devops, at FrosconKris Buytaert
 
Ddd reboot (english version)
Ddd reboot (english version)Ddd reboot (english version)
Ddd reboot (english version)Thomas Pierrain
 
Software design as a cooperative game with EventStorming
Software design as a cooperative game with EventStormingSoftware design as a cooperative game with EventStorming
Software design as a cooperative game with EventStormingAlberto Brandolini
 

Tendances (20)

Demystifying observability
Demystifying observability Demystifying observability
Demystifying observability
 
Domain Driven Design (DDD)
Domain Driven Design (DDD)Domain Driven Design (DDD)
Domain Driven Design (DDD)
 
Lambda and Stream Master class - part 1
Lambda and Stream Master class - part 1Lambda and Stream Master class - part 1
Lambda and Stream Master class - part 1
 
Building Fullstack Graph Applications With Neo4j
Building Fullstack Graph Applications With Neo4j Building Fullstack Graph Applications With Neo4j
Building Fullstack Graph Applications With Neo4j
 
Modern Java web applications with Spring Boot and Thymeleaf
Modern Java web applications with Spring Boot and ThymeleafModern Java web applications with Spring Boot and Thymeleaf
Modern Java web applications with Spring Boot and Thymeleaf
 
Pivotal Labs 고객사례 - Coinone
Pivotal Labs 고객사례 - CoinonePivotal Labs 고객사례 - Coinone
Pivotal Labs 고객사례 - Coinone
 
Microservices Interview Questions and Answers | Microservices Architecture Tr...
Microservices Interview Questions and Answers | Microservices Architecture Tr...Microservices Interview Questions and Answers | Microservices Architecture Tr...
Microservices Interview Questions and Answers | Microservices Architecture Tr...
 
Beyond the Spotify model - Team Topologies - Keynote at JAX DevOps 2019-05-16...
Beyond the Spotify model - Team Topologies - Keynote at JAX DevOps 2019-05-16...Beyond the Spotify model - Team Topologies - Keynote at JAX DevOps 2019-05-16...
Beyond the Spotify model - Team Topologies - Keynote at JAX DevOps 2019-05-16...
 
The Apache Solr Semantic Knowledge Graph
The Apache Solr Semantic Knowledge GraphThe Apache Solr Semantic Knowledge Graph
The Apache Solr Semantic Knowledge Graph
 
Specification-By-Example with Gherkin
Specification-By-Example with GherkinSpecification-By-Example with Gherkin
Specification-By-Example with Gherkin
 
Hexagonal architecture vs Functional core / Imperative shell
Hexagonal architecture vs Functional core / Imperative shellHexagonal architecture vs Functional core / Imperative shell
Hexagonal architecture vs Functional core / Imperative shell
 
Breaking Dependencies Legacy Code - Cork Software Crafters - September 2019
Breaking Dependencies Legacy Code -  Cork Software Crafters - September 2019Breaking Dependencies Legacy Code -  Cork Software Crafters - September 2019
Breaking Dependencies Legacy Code - Cork Software Crafters - September 2019
 
Building Adaptive Systems with Wardley Mapping, Domain-Driven Design, and Tea...
Building Adaptive Systems with Wardley Mapping, Domain-Driven Design, and Tea...Building Adaptive Systems with Wardley Mapping, Domain-Driven Design, and Tea...
Building Adaptive Systems with Wardley Mapping, Domain-Driven Design, and Tea...
 
Pragmatic RESTful API Design: Apigee Webinar
Pragmatic RESTful API Design: Apigee WebinarPragmatic RESTful API Design: Apigee Webinar
Pragmatic RESTful API Design: Apigee Webinar
 
DevOps and Continuous Delivery Reference Architectures (including Nexus and o...
DevOps and Continuous Delivery Reference Architectures (including Nexus and o...DevOps and Continuous Delivery Reference Architectures (including Nexus and o...
DevOps and Continuous Delivery Reference Architectures (including Nexus and o...
 
Dynatrace Cloud-Native Workshop Slides
Dynatrace Cloud-Native Workshop SlidesDynatrace Cloud-Native Workshop Slides
Dynatrace Cloud-Native Workshop Slides
 
Let's build Developer Portal with Backstage
Let's build Developer Portal with BackstageLet's build Developer Portal with Backstage
Let's build Developer Portal with Backstage
 
Devops Devops Devops, at Froscon
Devops Devops Devops, at FrosconDevops Devops Devops, at Froscon
Devops Devops Devops, at Froscon
 
Ddd reboot (english version)
Ddd reboot (english version)Ddd reboot (english version)
Ddd reboot (english version)
 
Software design as a cooperative game with EventStorming
Software design as a cooperative game with EventStormingSoftware design as a cooperative game with EventStorming
Software design as a cooperative game with EventStorming
 

Similaire à Behavior Driven Development Writing Better Scenarios

Moving away from legacy code with BDD
Moving away from legacy code with BDDMoving away from legacy code with BDD
Moving away from legacy code with BDDKonstantin Kudryashov
 
PHPSpec & Behat: Two Testing Tools That Write Code For You (#phptek edition)
PHPSpec & Behat: Two Testing Tools That Write Code For You (#phptek edition)PHPSpec & Behat: Two Testing Tools That Write Code For You (#phptek edition)
PHPSpec & Behat: Two Testing Tools That Write Code For You (#phptek edition)Joshua Warren
 
pnwphp - PHPSpec & Behat: Two Testing Tools That Write Code For You
pnwphp - PHPSpec & Behat: Two Testing Tools That Write Code For Youpnwphp - PHPSpec & Behat: Two Testing Tools That Write Code For You
pnwphp - PHPSpec & Behat: Two Testing Tools That Write Code For YouJoshua Warren
 
Probo.ci Drupal 4 Gov Devops 1/2 day Presentation
Probo.ci Drupal 4 Gov Devops 1/2 day Presentation Probo.ci Drupal 4 Gov Devops 1/2 day Presentation
Probo.ci Drupal 4 Gov Devops 1/2 day Presentation Zivtech, LLC
 
Php[tek] 2016 - BDD with Behat for Beginners
Php[tek] 2016 - BDD with Behat for BeginnersPhp[tek] 2016 - BDD with Behat for Beginners
Php[tek] 2016 - BDD with Behat for BeginnersAdam Englander
 
Software Testing
Software TestingSoftware Testing
Software Testingsuperphly
 
Behat for writing tests in a stylized way
Behat for writing tests in a stylized wayBehat for writing tests in a stylized way
Behat for writing tests in a stylized wayRavindra Singh
 
Building Mobile Friendly APIs in Rails
Building Mobile Friendly APIs in RailsBuilding Mobile Friendly APIs in Rails
Building Mobile Friendly APIs in RailsJim Jeffers
 
4-Step SEO Waltz: Tackle SEO Challenges Head-On
4-Step SEO Waltz: Tackle SEO Challenges Head-On4-Step SEO Waltz: Tackle SEO Challenges Head-On
4-Step SEO Waltz: Tackle SEO Challenges Head-OnSearch Engine Journal
 
Selendroid in Action
Selendroid in ActionSelendroid in Action
Selendroid in ActionDominik Dary
 
Zend con 2016 bdd with behat for beginners
Zend con 2016   bdd with behat for beginnersZend con 2016   bdd with behat for beginners
Zend con 2016 bdd with behat for beginnersAdam Englander
 
The Art of Gherkin Scripting - Matt Eakin
The Art of Gherkin Scripting - Matt EakinThe Art of Gherkin Scripting - Matt Eakin
The Art of Gherkin Scripting - Matt EakinQA or the Highway
 
Implement BDD with Cucumber and SpecFlow
Implement BDD with Cucumber and SpecFlowImplement BDD with Cucumber and SpecFlow
Implement BDD with Cucumber and SpecFlowTechWell
 
Behat - Drupal South 2018
Behat  - Drupal South 2018Behat  - Drupal South 2018
Behat - Drupal South 2018Berend de Boer
 
[drupalday2017] - Behat per Drupal: test automatici e molto di più
[drupalday2017] - Behat per Drupal: test automatici e molto di più[drupalday2017] - Behat per Drupal: test automatici e molto di più
[drupalday2017] - Behat per Drupal: test automatici e molto di piùDrupalDay
 
BDD with Behat and Symfony2
BDD with Behat and Symfony2BDD with Behat and Symfony2
BDD with Behat and Symfony2katalisha
 
Gherkin for test automation in agile
Gherkin for test automation in agileGherkin for test automation in agile
Gherkin for test automation in agileViresh Doshi
 
Acceptance Test Driven Development
Acceptance Test Driven DevelopmentAcceptance Test Driven Development
Acceptance Test Driven DevelopmentAmir Barylko
 
Getting Started with Test Automation: Introduction to Cucumber with Lapis Lazuli
Getting Started with Test Automation: Introduction to Cucumber with Lapis LazuliGetting Started with Test Automation: Introduction to Cucumber with Lapis Lazuli
Getting Started with Test Automation: Introduction to Cucumber with Lapis LazuliRebecca Eloise Hogg
 

Similaire à Behavior Driven Development Writing Better Scenarios (20)

Moving away from legacy code with BDD
Moving away from legacy code with BDDMoving away from legacy code with BDD
Moving away from legacy code with BDD
 
PHPSpec & Behat: Two Testing Tools That Write Code For You (#phptek edition)
PHPSpec & Behat: Two Testing Tools That Write Code For You (#phptek edition)PHPSpec & Behat: Two Testing Tools That Write Code For You (#phptek edition)
PHPSpec & Behat: Two Testing Tools That Write Code For You (#phptek edition)
 
pnwphp - PHPSpec & Behat: Two Testing Tools That Write Code For You
pnwphp - PHPSpec & Behat: Two Testing Tools That Write Code For Youpnwphp - PHPSpec & Behat: Two Testing Tools That Write Code For You
pnwphp - PHPSpec & Behat: Two Testing Tools That Write Code For You
 
Probo.ci Drupal 4 Gov Devops 1/2 day Presentation
Probo.ci Drupal 4 Gov Devops 1/2 day Presentation Probo.ci Drupal 4 Gov Devops 1/2 day Presentation
Probo.ci Drupal 4 Gov Devops 1/2 day Presentation
 
Php[tek] 2016 - BDD with Behat for Beginners
Php[tek] 2016 - BDD with Behat for BeginnersPhp[tek] 2016 - BDD with Behat for Beginners
Php[tek] 2016 - BDD with Behat for Beginners
 
Software Testing
Software TestingSoftware Testing
Software Testing
 
Behat for writing tests in a stylized way
Behat for writing tests in a stylized wayBehat for writing tests in a stylized way
Behat for writing tests in a stylized way
 
Building Mobile Friendly APIs in Rails
Building Mobile Friendly APIs in RailsBuilding Mobile Friendly APIs in Rails
Building Mobile Friendly APIs in Rails
 
4-Step SEO Waltz: Tackle SEO Challenges Head-On
4-Step SEO Waltz: Tackle SEO Challenges Head-On4-Step SEO Waltz: Tackle SEO Challenges Head-On
4-Step SEO Waltz: Tackle SEO Challenges Head-On
 
Selendroid in Action
Selendroid in ActionSelendroid in Action
Selendroid in Action
 
Zend con 2016 bdd with behat for beginners
Zend con 2016   bdd with behat for beginnersZend con 2016   bdd with behat for beginners
Zend con 2016 bdd with behat for beginners
 
The Art of Gherkin Scripting - Matt Eakin
The Art of Gherkin Scripting - Matt EakinThe Art of Gherkin Scripting - Matt Eakin
The Art of Gherkin Scripting - Matt Eakin
 
Implement BDD with Cucumber and SpecFlow
Implement BDD with Cucumber and SpecFlowImplement BDD with Cucumber and SpecFlow
Implement BDD with Cucumber and SpecFlow
 
Behat - Drupal South 2018
Behat  - Drupal South 2018Behat  - Drupal South 2018
Behat - Drupal South 2018
 
[drupalday2017] - Behat per Drupal: test automatici e molto di più
[drupalday2017] - Behat per Drupal: test automatici e molto di più[drupalday2017] - Behat per Drupal: test automatici e molto di più
[drupalday2017] - Behat per Drupal: test automatici e molto di più
 
Double Loop
Double LoopDouble Loop
Double Loop
 
BDD with Behat and Symfony2
BDD with Behat and Symfony2BDD with Behat and Symfony2
BDD with Behat and Symfony2
 
Gherkin for test automation in agile
Gherkin for test automation in agileGherkin for test automation in agile
Gherkin for test automation in agile
 
Acceptance Test Driven Development
Acceptance Test Driven DevelopmentAcceptance Test Driven Development
Acceptance Test Driven Development
 
Getting Started with Test Automation: Introduction to Cucumber with Lapis Lazuli
Getting Started with Test Automation: Introduction to Cucumber with Lapis LazuliGetting Started with Test Automation: Introduction to Cucumber with Lapis Lazuli
Getting Started with Test Automation: Introduction to Cucumber with Lapis Lazuli
 

Plus de Arnauld Loyer

Brown Bag Lunch - BDD an introduction - 2017 feb/mar
Brown Bag Lunch - BDD an introduction - 2017 feb/marBrown Bag Lunch - BDD an introduction - 2017 feb/mar
Brown Bag Lunch - BDD an introduction - 2017 feb/marArnauld Loyer
 
Bdd training v5.2.0 - public
Bdd training   v5.2.0 - publicBdd training   v5.2.0 - public
Bdd training v5.2.0 - publicArnauld Loyer
 
Event storming Notes
Event storming NotesEvent storming Notes
Event storming NotesArnauld Loyer
 
Nos premiers pas autour du Behavior Driven Development
Nos premiers pas autour du Behavior Driven DevelopmentNos premiers pas autour du Behavior Driven Development
Nos premiers pas autour du Behavior Driven DevelopmentArnauld Loyer
 
Behavior Driven Development // Brown Bag Lunch v1.0.0
Behavior Driven Development // Brown Bag Lunch  v1.0.0Behavior Driven Development // Brown Bag Lunch  v1.0.0
Behavior Driven Development // Brown Bag Lunch v1.0.0Arnauld Loyer
 
Dégraissons le mammouth ou Darwin a encore frappé - La théorie de l'évolution...
Dégraissons le mammouth ou Darwin a encore frappé - La théorie de l'évolution...Dégraissons le mammouth ou Darwin a encore frappé - La théorie de l'évolution...
Dégraissons le mammouth ou Darwin a encore frappé - La théorie de l'évolution...Arnauld Loyer
 
L'ABC du BDD (Behavior Driven Development)
L'ABC du BDD (Behavior Driven Development)L'ABC du BDD (Behavior Driven Development)
L'ABC du BDD (Behavior Driven Development)Arnauld Loyer
 
Confiance&bdd softshake2013
Confiance&bdd softshake2013Confiance&bdd softshake2013
Confiance&bdd softshake2013Arnauld Loyer
 

Plus de Arnauld Loyer (11)

Brown Bag Lunch - BDD an introduction - 2017 feb/mar
Brown Bag Lunch - BDD an introduction - 2017 feb/marBrown Bag Lunch - BDD an introduction - 2017 feb/mar
Brown Bag Lunch - BDD an introduction - 2017 feb/mar
 
Bdd training v5.2.0 - public
Bdd training   v5.2.0 - publicBdd training   v5.2.0 - public
Bdd training v5.2.0 - public
 
Event storming Notes
Event storming NotesEvent storming Notes
Event storming Notes
 
BDD training v5.0.1
BDD training  v5.0.1BDD training  v5.0.1
BDD training v5.0.1
 
Nos premiers pas autour du Behavior Driven Development
Nos premiers pas autour du Behavior Driven DevelopmentNos premiers pas autour du Behavior Driven Development
Nos premiers pas autour du Behavior Driven Development
 
Behavior Driven Development // Brown Bag Lunch v1.0.0
Behavior Driven Development // Brown Bag Lunch  v1.0.0Behavior Driven Development // Brown Bag Lunch  v1.0.0
Behavior Driven Development // Brown Bag Lunch v1.0.0
 
Dégraissons le mammouth ou Darwin a encore frappé - La théorie de l'évolution...
Dégraissons le mammouth ou Darwin a encore frappé - La théorie de l'évolution...Dégraissons le mammouth ou Darwin a encore frappé - La théorie de l'évolution...
Dégraissons le mammouth ou Darwin a encore frappé - La théorie de l'évolution...
 
L'ABC du BDD (Behavior Driven Development)
L'ABC du BDD (Behavior Driven Development)L'ABC du BDD (Behavior Driven Development)
L'ABC du BDD (Behavior Driven Development)
 
Confiance&bdd softshake2013
Confiance&bdd softshake2013Confiance&bdd softshake2013
Confiance&bdd softshake2013
 
Bdd training - v3
Bdd training - v3Bdd training - v3
Bdd training - v3
 
Bdd training-v1
Bdd training-v1Bdd training-v1
Bdd training-v1
 

Dernier

How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....ShaimaaMohamedGalal
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 

Dernier (20)

How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 

Behavior Driven Development Writing Better Scenarios

  • 1. Behavior Driven Development Writing better scenario Arnauld LOYER — @aloyer Mastering Software Development EAre You really doing BDD?
  • 2. Disclaimer No scenario has been harmed during the investigation github search: extension:feature travel/deal/… Most remarks are purely subjectives @aloyer
  • 3. Let’s try to diagnose the maturity @aloyer Anti-Pattern … an antipattern was something that seems like a good idea when you begin, but leads you into trouble. http://martinfowler.com/bliki/AntiPattern.html
  • 4. Having conversations with domain experts and discover unknowns and using examples to gain a shared understanding of the desired behavior @aloyer C
  • 6. Functional Tests or BDD ? @aloyer
  • 7. Functional Tests or BDD ? @aloyer
  • 8. Functional Tests or BDD ? @aloyer Acceptance
  • 9. Feature: The Confluence server is up
 
 In order to make sure that Confluence has been installed and runs
 As a developer
 I want to access Confluence's home page
 
 Scenario: Developer accesses the home page
 Given the url of Confluences home page
 When a web user browses to the url
 Then the connection should be successful
 Then the page status should be OK
 Then the page should have the title "Confluence Setup Wizard - Confluence" https://github.com/xebia-france/chef-confluence-jira-crowd/blob/a26e29a85d1e75b9b612a560685940b40c971adc/test/integration/confluence-jira-crowd/cucumber/confluence_up.feature BDD ? @aloyer
  • 10. Feature: The Confluence server is up
 
 In order to make sure that Confluence has been installed and runs
 As a developer
 I want to access Confluence's home page
 
 Scenario: Developer accesses the home page
 Given the url of Confluences home page
 When a web user browses to the url
 Then the connection should be successful
 Then the page status should be OK
 Then the page should have the title "Confluence Setup Wizard - Confluence" https://github.com/xebia-france/chef-confluence-jira-crowd/blob/a26e29a85d1e75b9b612a560685940b40c971adc/test/integration/confluence-jira-crowd/cucumber/confluence_up.feature Sanity CheckBDD ? behavior ? @aloyer
  • 11. Feature: The Confluence server is up
 
 In order to make sure that Confluence has been installed and runs
 As a developer
 I want to access Confluence's home page
 
 Scenario: Developer accesses the home page
 Given the url of Confluences home page
 When a web user browses to the url
 Then the connection should be successful
 Then the page status should be OK
 Then the page should have the title "Confluence Setup Wizard - Confluence" https://github.com/xebia-france/chef-confluence-jira-crowd/blob/a26e29a85d1e75b9b612a560685940b40c971adc/test/integration/confluence-jira-crowd/cucumber/confluence_up.feature Sanity CheckBDD ? behavior ? @aloyer
  • 12. @aloyer 12 Given-When-Then Then an outcome should be observed Given a context When an event happens 3 phases setup/arrange exercise/act verify/assert Tips
  • 13. Feature: Asset Manager
 
 @local-network
 @normal
 Scenario: check an asset can be loaded
 Given I am testing "asset-manager"
 And I am an authenticated API client
 When I visit "/assets/513a0efbed915d425e000002"
 Then I should get a 200 status code
 And I should see "120613_Albania_Travel_Advice_WEB_Ed2_jpeg.jpg"
 
 @normal
 Scenario: check an asset can be served
 Given I am testing "static"
 When I visit "/media/ 513a0efbed915d425e000002/120613_Albania_Travel_Advice_WEB_Ed2_jpeg.jpg"
 Then I should get a 200 status code
 And I should get a content length of "212880" https://github.com/alphagov/smokey/blob/4c8fe739938e4a4b8b7bb393dfd485efd39dc034/features/asset_manager.feature BDD ? @aloyer
  • 14. Feature: Asset Manager
 
 @local-network
 @normal
 Scenario: check an asset can be loaded
 Given I am testing "asset-manager"
 And I am an authenticated API client
 When I visit "/assets/513a0efbed915d425e000002"
 Then I should get a 200 status code
 And I should see "120613_Albania_Travel_Advice_WEB_Ed2_jpeg.jpg"
 
 @normal
 Scenario: check an asset can be served
 Given I am testing "static"
 When I visit "/media/ 513a0efbed915d425e000002/120613_Albania_Travel_Advice_WEB_Ed2_jpeg.jpg"
 Then I should get a 200 status code
 And I should get a content length of "212880" https://github.com/alphagov/smokey/blob/4c8fe739938e4a4b8b7bb393dfd485efd39dc034/features/asset_manager.feature BDD ? Business Language? Technical Test web page Selenium technical details @aloyer
  • 15. Feature: Asset Manager
 
 @local-network
 @normal
 Scenario: check an asset can be loaded
 Given I am testing "asset-manager"
 And I am an authenticated API client
 When I visit "/assets/513a0efbed915d425e000002"
 Then I should get a 200 status code
 And I should see "120613_Albania_Travel_Advice_WEB_Ed2_jpeg.jpg"
 
 @normal
 Scenario: check an asset can be served
 Given I am testing "static"
 When I visit "/media/ 513a0efbed915d425e000002/120613_Albania_Travel_Advice_WEB_Ed2_jpeg.jpg"
 Then I should get a 200 status code
 And I should get a content length of "212880" https://github.com/alphagov/smokey/blob/4c8fe739938e4a4b8b7bb393dfd485efd39dc034/features/asset_manager.feature BDD ? Technical Test differences? @aloyer different results? Unclear and non-sustainable
  • 17. Should I use cucumber to write technical tests? Be pragmatic! Who will read the scenario? Are you ready to pay the cucumber overhead? compared to raw xUnit tests Do you really contribute to a shared knowledge or do you increase the business/technical gap? @aloyer
  • 18. Who write the scenario ? &read @aloyer
  • 20. Feature: Asset Manager
 
 @local-network
 @normal
 Scenario: check an asset can be loaded
 Given I am testing "asset-manager"
 And I am an authenticated API client
 When I visit "/assets/513a0efbed915d425e000002"
 Then I should get a 200 status code
 And I should see "120613_Albania_Travel_Advice_WEB_Ed2_jpeg.jpg"
 
 @normal
 Scenario: check an asset can be served
 Given I am testing "static"
 When I visit "/media/ 513a0efbed915d425e000002/120613_Albania_Travel_Advice_WEB_Ed2_jpeg.jpg"
 Then I should get a 200 status code
 And I should get a content length of "212880" https://github.com/alphagov/smokey/blob/4c8fe739938e4a4b8b7bb393dfd485efd39dc034/features/asset_manager.feature Who wrote this ? @aloyer
  • 21. @MoveToken
 Feature: Moving the token over the board
 
 As a player
 I want to move to new positions on the board
 So that I can get rich and win the game
 
 Scenario Outline: Moving a token after a single throw
 Given players token is at starting position <startingPosition>
 When player throws die1 <die1> and die2 <die2>
 Then players token moves to a new position <newPosition>
 
 Examples:
 | startingPosition | die1 | die2 | newPosition |
 | 1 | 1 | 2 | 4 |
 | 2 | 3 | 4 | 9 |
 | 39 | 2 | 2 | 3 |
 Forgot the rule ? https://github.com/xebia/spec-by-example-2014-09-29/blob/4eabded6b22e816f6509a3ecd2c2180b62f4d73d/src/test/resources/monopoly/cucumber/MoveToken.feature @aloyer
  • 22. @MoveToken
 Feature: Moving the token over the board
 
 As a player
 I want to move to new positions on the board
 So that I can get rich and win the game
 
 Scenario Outline: Moving a token after a single throw
 Given players token is at starting position <startingPosition>
 When player throws die1 <die1> and die2 <die2>
 Then players token moves to a new position <newPosition>
 
 Examples:
 | startingPosition | die1 | die2 | newPosition |
 | 1 | 1 | 2 | 4 |
 | 2 | 3 | 4 | 9 |
 | 39 | 2 | 2 | 3 |
 Forgot the rule ? https://github.com/xebia/spec-by-example-2014-09-29/blob/4eabded6b22e816f6509a3ecd2c2180b62f4d73d/src/test/resources/monopoly/cucumber/MoveToken.feature @aloyer where is the rule? The All-In-One Effect
  • 23. @MoveToken
 Feature: Moving the token over the board
 
 As a player
 I want to move to new positions on the board
 So that I can get rich and win the game
 
 Scenario Outline: Moving a token after a single throw
 Given players token is at starting position <startingPosition>
 When player throws die1 <die1> and die2 <die2>
 Then players token moves to a new position <newPosition>
 
 Examples:
 | startingPosition | die1 | die2 | newPosition |
 | 1 | 1 | 2 | 4 |
 | 2 | 3 | 4 | 9 |
 | 39 | 2 | 2 | 3 |
 Forgot the rule ? https://github.com/xebia/spec-by-example-2014-09-29/blob/4eabded6b22e816f6509a3ecd2c2180b62f4d73d/src/test/resources/monopoly/cucumber/MoveToken.feature where is the rule? the outline effect @aloyer The All-In-One Effect
  • 24. Feature: Deal team invitations
 
 1. A "My deals" section with
 The deals that I created
 The deals on which me or my team are deal leaders
 The deals on which me or my team are deal members
 
 2. A "Other deals" section with:
 The deals for which me or my team are "other contact"
 
 Scenario Outline: People invited into deal team directly
 Given the following deals have been created
 | Name | Creator | User leaders | User members | User other contacts |
 | AF | John | Charlotte | Peter | Diego |
 | KLM | Charlotte | John | Charlotte | Peter |
 | IB | Charlotte | Charlotte | John | Peter |
 | GW | Diego | Charlotte | Peter | John |
 | TAP | Diego | Charlotte | Peter | |
 | TUN | Diego | Charlotte | Peter | Matthieu |
 When <user> logs into the platform
 Then the My deals section should have only <my deals>
 And the Other deals section should have only <other deals>
 
 Examples:
 | user | my deals | other deals |
 | John | AF, KLM, IB | GW |
 | Charlotte | AF, KLM, IB, GW, TAP, TUN | <none> |
 | Peter | AF, GW, TAP, TUN | KLM, IB |
 | Matthieu | <none> | TUN |
 | Mariem | <none> | <none> | Is the rule obvious? @aloyer
  • 25. Feature: Deal team invitations
 
 1. A "My deals" section with
 The deals that I created
 The deals on which me or my team are deal leaders
 The deals on which me or my team are deal members
 
 2. A "Other deals" section with:
 The deals for which me or my team are "other contact"
 
 Scenario Outline: People invited into deal team directly
 Given the following deals have been created
 | Name | Creator | User leaders | User members | User other contacts |
 | AF | John | Charlotte | Peter | Diego |
 | KLM | Charlotte | John | Charlotte | Peter |
 | IB | Charlotte | Charlotte | John | Peter |
 | GW | Diego | Charlotte | Peter | John |
 | TAP | Diego | Charlotte | Peter | |
 | TUN | Diego | Charlotte | Peter | Matthieu |
 When <user> logs into the platform
 Then the My deals section should have only <my deals>
 And the Other deals section should have only <other deals>
 
 Examples:
 | user | my deals | other deals |
 | John | AF, KLM, IB | GW |
 | Charlotte | AF, KLM, IB, GW, TAP, TUN | <none> |
 | Peter | AF, GW, TAP, TUN | KLM, IB |
 | Matthieu | <none> | TUN |
 | Mariem | <none> | <none> | Is the rule obvious?ARE S
  • 26. Feature: Deal team invitations
 
 1. A "My deals" section with
 The deals that I created
 The deals on which me or my team are deal leaders
 The deals on which me or my team are deal members
 
 2. A "Other deals" section with:
 The deals for which me or my team are "other contact"
 
 Scenario Outline: People invited into deal team directly
 Given the following deals have been created
 | Name | Creator | User leaders | User members | User other contacts |
 | AF | John | Charlotte | Peter | Diego |
 | KLM | Charlotte | John | Charlotte | Peter |
 | IB | Charlotte | Charlotte | John | Peter |
 | GW | Diego | Charlotte | Peter | John |
 | TAP | Diego | Charlotte | Peter | |
 | TUN | Diego | Charlotte | Peter | Matthieu |
 When <user> logs into the platform
 Then the My deals section should have only <my deals>
 And the Other deals section should have only <other deals>
 
 Examples:
 | user | my deals | other deals |
 | John | AF, KLM, IB | GW |
 | Charlotte | AF, KLM, IB, GW, TAP, TUN | <none> |
 | Peter | AF, GW, TAP, TUN | KLM, IB |
 | Matthieu | <none> | TUN |
 | Mariem | <none> | <none> | what if …I belongs to multiple group? Is the rule obvious?ARE S the outline effect
  • 27. Feature: Deal team invitations
 
 1. A "My deals" section with
 The deals that I created
 The deals on which me or my team are deal leaders
 The deals on which me or my team are deal members
 
 2. A "Other deals" section with:
 The deals for which me or my team are "other contact"
 
 Scenario Outline: People invited into deal team directly
 Given the following deals have been created
 | Name | Creator | User leaders | User members | User other contacts |
 | AF | John | Charlotte | Peter | Diego |
 | KLM | Charlotte | John | Charlotte | Peter |
 | IB | Charlotte | Charlotte | John | Peter |
 | GW | Diego | Charlotte | Peter | John |
 | TAP | Diego | Charlotte | Peter | |
 | TUN | Diego | Charlotte | Peter | Matthieu |
 When <user> logs into the platform
 Then the My deals section should have only <my deals>
 And the Other deals section should have only <other deals>
 
 Examples:
 | user | my deals | other deals |
 | John | AF, KLM, IB | GW |
 | Charlotte | AF, KLM, IB, GW, TAP, TUN | <none> |
 | Peter | AF, GW, TAP, TUN | KLM, IB |
 | Matthieu | <none> | TUN |
 | Mariem | <none> | <none> | what if …I belongs to multiple group? Is the rule obvious?ARE S the outline effect
  • 28. Feature: Deals display order in the home page
 As an FO
 I need to see my deals ordered in the way that fits my function
 In order to have a clear view of the most important or urgent deals.
 
 Clarifications:
 Deals should be ordered by expected closing date, the first deals displayed should be the ones with the oldest expected closing date.
 For cards display, the oldest cards will be on the top and for cards on the same row, the oldest card will be on the left.
 For table display, the oldest cards will on the top.
 For deals with the same expected closing date, they should be ordered by deal name
 
 Scenario: Deals display order
 Given the following deals
 | name | client name | total amount | creator | user leaders | user members | user other contacts | expected closing date | pricing status | Credit approval status | Lso deal code | Cwf request code | stage | confidentiality level |
 | Aircraft AF | Air France | 150000000 | Johny | Charlotte | Peter | Diego | May 12, 2016 | true | Not submitted | L0377450 | 2015_07_001105 | Marketing | My Team |
 | Aircraft KLM | KLM | 15000000 | Charlotte | Johny | Charlotte | Peter | Jul 11, 2014 | false | In progress | L0377451 | 2015_08_001105 | Bidding | Confidential |
 | Aircraft TUN | Tunisair | 16000000 | Johny | Charlotte | Charlotte | Peter | Jul 12, 2014 | false | In progress | L0377451 | 2015_09_001105 | Bidding | My Team |
 
 When Charlotte logs into the platform
 Then the My deals section must be ordered as Aircraft KLM,Aircraft TUN,Aircraft AF
 the A4 rule ? @aloyer
  • 29. Feature: Deals display order in the home page
 As an FO
 I need to see my deals ordered in the way that fits my function
 In order to have a clear view of the most important or urgent deals.
 
 Clarifications:
 Deals should be ordered by expected closing date, the first deals displayed should be the ones with the oldest expected closing date.
 For cards display, the oldest cards will be on the top and for cards on the same row, the oldest card will be on the left.
 For table display, the oldest cards will on the top.
 For deals with the same expected closing date, they should be ordered by deal name
 
 Scenario: Deals display order
 Given the following deals
 | name | client name | total amount | creator | user leaders | user members | user other contacts | expected closing date | pricing status | Credit approval status | Lso deal code | Cwf request code | stage | confidentiality level |
 | Aircraft AF | Air France | 150000000 | Johny | Charlotte | Peter | Diego | May 12, 2016 | true | Not submitted | L0377450 | 2015_07_001105 | Marketing | My Team |
 | Aircraft KLM | KLM | 15000000 | Charlotte | Johny | Charlotte | Peter | Jul 11, 2014 | false | In progress | L0377451 | 2015_08_001105 | Bidding | Confidential |
 | Aircraft TUN | Tunisair | 16000000 | Johny | Charlotte | Charlotte | Peter | Jul 12, 2014 | false | In progress | L0377451 | 2015_09_001105 | Bidding | My Team |
 
 When Charlotte logs into the platform
 Then the My deals section must be ordered as Aircraft KLM,Aircraft TUN,Aircraft AF
 the A4 rule ? Feature: Deals display order in the home page
 Deals should be ordered by expected closing date, the first deals displayed should be the ones with the oldest expected closing date.
 For deals with the same expected closing date, they should be ordered by deal name
 
 Scenario: Deals display order
 Given the following deals
 | name | client name | total amount | creator | user leaders | user memb | AF | Air France | 150000000 | Johny | Charlotte | Peter | KLM | KLM | 15000000 | Charlotte | Johny | Charlotte | TUN | Tunisair | 16000000 | Johny | Charlotte | Charlotte 
 When Charlotte logs into the platform
 Then the My deals section must be ordered as KLM, TUN, AF
  • 30. Feature: Deals display order in the home page
 As an FO
 I need to see my deals ordered in the way that fits my function
 In order to have a clear view of the most important or urgent deals.
 
 Clarifications:
 Deals should be ordered by expected closing date, the first deals displayed should be the ones with the oldest expected closing date.
 For cards display, the oldest cards will be on the top and for cards on the same row, the oldest card will be on the left.
 For table display, the oldest cards will on the top.
 For deals with the same expected closing date, they should be ordered by deal name
 
 Scenario: Deals display order
 Given the following deals
 | name | client name | total amount | creator | user leaders | user members | user other contacts | expected closing date | pricing status | Credit approval status | Lso deal code | Cwf request code | stage | confidentiality level |
 | Aircraft AF | Air France | 150000000 | Johny | Charlotte | Peter | Diego | May 12, 2016 | true | Not submitted | L0377450 | 2015_07_001105 | Marketing | My Team |
 | Aircraft KLM | KLM | 15000000 | Charlotte | Johny | Charlotte | Peter | Jul 11, 2014 | false | In progress | L0377451 | 2015_08_001105 | Bidding | Confidential |
 | Aircraft TUN | Tunisair | 16000000 | Johny | Charlotte | Charlotte | Peter | Jul 12, 2014 | false | In progress | L0377451 | 2015_09_001105 | Bidding | My Team |
 
 When Charlotte logs into the platform
 Then the My deals section must be ordered as Aircraft KLM,Aircraft TUN,Aircraft AF
 the A4 rule ? Feature: Deals display order in the home page
 Deals should be ordered by expected closing date, the first deals displayed should be the ones with the oldest expected closing date.
 For deals with the same expected closing date, they should be ordered by deal name
 
 Scenario: Deals display order
 Given the following deals
 | name | client name | total amount | creator | user leaders | user memb | AF | Air France | 150000000 | Johny | Charlotte | Peter | KLM | KLM | 15000000 | Charlotte | Johny | Charlotte | TUN | Tunisair | 16000000 | Johny | Charlotte | Charlotte 
 When Charlotte logs into the platform
 Then the My deals section must be ordered as KLM, TUN, AF
  • 31. Feature: Deals display order in the home page
 As an FO
 I need to see my deals ordered in the way that fits my function
 In order to have a clear view of the most important or urgent deals.
 
 Clarifications:
 Deals should be ordered by expected closing date, the first deals displayed should be the ones with the oldest expected closing date.
 For cards display, the oldest cards will be on the top and for cards on the same row, the oldest card will be on the left.
 For table display, the oldest cards will on the top.
 For deals with the same expected closing date, they should be ordered by deal name
 
 Scenario: Deals display order
 Given the following deals
 | name | client name | total amount | creator | user leaders | user members | user other contacts | expected closing date | pricing status | Credit approval status | Lso deal code | Cwf request code | stage | confidentiality level |
 | Aircraft AF | Air France | 150000000 | Johny | Charlotte | Peter | Diego | May 12, 2016 | true | Not submitted | L0377450 | 2015_07_001105 | Marketing | My Team |
 | Aircraft KLM | KLM | 15000000 | Charlotte | Johny | Charlotte | Peter | Jul 11, 2014 | false | In progress | L0377451 | 2015_08_001105 | Bidding | Confidential |
 | Aircraft TUN | Tunisair | 16000000 | Johny | Charlotte | Charlotte | Peter | Jul 12, 2014 | false | In progress | L0377451 | 2015_09_001105 | Bidding | My Team |
 
 When Charlotte logs into the platform
 Then the My deals section must be ordered as Aircraft KLM,Aircraft TUN,Aircraft AF
 the A4 rule ? Feature: Deals display order in the home page
 Deals should be ordered by expected closing date, the first deals displayed should be the ones with the oldest expected closing date.
 For deals with the same expected closing date, they should be ordered by deal name
 
 Scenario: Deals display order
 Given the following deals
 | name | client name | total amount | creator | user leaders | user memb | AF | Air France | 150000000 | Johny | Charlotte | Peter | KLM | KLM | 15000000 | Charlotte | Johny | Charlotte | TUN | Tunisair | 16000000 | Johny | Charlotte | Charlotte 
 When Charlotte logs into the platform
 Then the My deals section must be ordered as KLM, TUN, AF B
  • 32. Feature: Deals display order in the home page
 As an FO
 I need to see my deals ordered in the way that fits my function
 In order to have a clear view of the most important or urgent deals.
 
 Clarifications:
 Deals should be ordered by expected closing date, the first deals displayed should be the ones with the oldest expected closing date.
 For cards display, the oldest cards will be on the top and for cards on the same row, the oldest card will be on the left.
 For table display, the oldest cards will on the top.
 For deals with the same expected closing date, they should be ordered by deal name
 
 Scenario: Deals display order
 Given the following deals
 | name | client name | total amount | creator | user leaders | user members | user other contacts | expected closing date | pricing status | Credit approval status | Lso deal code | Cwf request code | stage | confidentiality level |
 | Aircraft AF | Air France | 150000000 | Johny | Charlotte | Peter | Diego | May 12, 2016 | true | Not submitted | L0377450 | 2015_07_001105 | Marketing | My Team |
 | Aircraft KLM | KLM | 15000000 | Charlotte | Johny | Charlotte | Peter | Jul 11, 2014 | false | In progress | L0377451 | 2015_08_001105 | Bidding | Confidential |
 | Aircraft TUN | Tunisair | 16000000 | Johny | Charlotte | Charlotte | Peter | Jul 12, 2014 | false | In progress | L0377451 | 2015_09_001105 | Bidding | My Team |
 
 When Charlotte logs into the platform
 Then the My deals section must be ordered as Aircraft KLM,Aircraft TUN,Aircraft AF
 the A4 rule ? Feature: Deals display order in the home page
 Deals should be ordered by expected closing date, the first deals displayed should be the ones with the oldest expected closing date.
 For deals with the same expected closing date, they should be ordered by deal name
 
 Scenario: Deals display order
 Given the following deals
 | name | expected closing date |
 | AF | May 12, 2016 |
 | KLM | Jul 11, 2014 |
 | TUN | Jul 12, 2014 | 
 When Charlotte logs into the platform
 Then the My deals section must be ordered as KLM, TUN, AF O
  • 35. Cucumber 3 Amigos Tests BDD Business Tech’ Behavior Let’s try to diagnose the maturity Scenario @aloyer
  • 36. Cucumber Scenario 3 Amigos Driven Development Tests BDD Business Tech’ Behavior Let’s try to diagnose the maturity @aloyer
  • 37. Scenario should be written using the Business Language Together What is the intent? Have I understood the expected behavior? Do I clearly understand the rule when reading a scenario? How many rules are exposed within the scenario? @aloyer Try to limit to One rule per scenario
  • 38. What level of details ? Writing better scenario @aloyer
  • 39. @BuyingProperties
 Feature: Buying properties
 
 As a player
 I want to buy properties
 So that I can ask rent when my opponents land on it
 
 Scenario: Buying property
 Given I land on unowned property
 And my funds are sufficient
 When I choose to buy the property
 Then I pay the printed price
 And I receive the title deed
 
 
 Scenario: No sufficient funds
 Given I land on unowned property
 And my funds are not sufficient
 Then I am not able to buy the property
 https://github.com/xebia/workshop-agile-testing/blob/8705e3f93270662285cd9c8ec8c24e5ac957f3ed/src/test/resources/features/BuyingProperties.feature Enough details ? @aloyer
  • 40. @BuyingProperties
 Feature: Buying properties
 
 As a player
 I want to buy properties
 So that I can ask rent when my opponents land on it
 
 Scenario: Buying property
 Given I land on unowned property
 And my funds are sufficient
 When I choose to buy the property
 Then I pay the printed price
 And I receive the title deed
 
 
 Scenario: No sufficient funds
 Given I land on unowned property
 And my funds are not sufficient
 Then I am not able to buy the property
 https://github.com/xebia/workshop-agile-testing/blob/8705e3f93270662285cd9c8ec8c24e5ac957f3ed/src/test/resources/features/BuyingProperties.feature Enough details ? too declarative which one? what does it mean? « Pay » is an outcome? Choose? @aloyer
  • 41. Scenario: Buying property
 Given I land on unowned property
 And my funds are sufficient
 When I choose to buy the property
 Then I pay the printed price
 And I receive the title deed @aloyer
  • 42. Scenario: Buying property
 Given I land on unowned property
 And my funds are sufficient
 When I choose to buy the property
 Then I pay the printed price
 And I receive the title deed 
 @default_properties
 Scenario: Buying property
 
 Given I land on unowned "west" property
 And my funds are 2000
 When I buy the property
 And I pay the printed price
 Then I should receive the "west" title deed
 And my funds should be decreased to 1800 @aloyer
  • 43. Scenario: Buying property
 Given I land on unowned property
 And my funds are sufficient
 When I choose to buy the property
 Then I pay the printed price
 And I receive the title deed to pay is an action (when) not an outcome (then) value can be changed 
 @default_properties
 Scenario: Buying property
 
 Given I land on unowned "west" property
 And my funds are 2000
 When I buy the property
 And I pay the printed price
 Then I should receive the "west" title deed
 And my funds should be decreased to 1800 can help to project to other case Can it always be applied? @aloyer
  • 44. Scenario: Buying property
 Given I land on unowned property
 And my funds are sufficient
 When I choose to buy the property
 Then I pay the printed price
 And I receive the title deed 
 @default_properties
 Scenario: Buying property
 
 Given I land on unowned "west" property
 And my funds are 2000
 When I buy the property
 And I pay the printed price
 Then I should receive the "west" title deed
 And my funds should be decreased to 1800 @Then("^my funds should be (?:decreased to |increased to )?(d+)$")
 public void my_funds_should_be_(int amount) @aloyer
  • 45. Scenario: Buying property
 Given I land on unowned property
 And my funds are sufficient
 When I choose to buy the property
 Then I pay the printed price
 And I receive the title deed @default_properties
 Scenario: Default properties - by tag
 Then the available properties should be at least:
 | name | price |
 | east | 150 |
 | west | 200 |
 | north | 100 |
 | south | 40 | 
 @default_properties
 Scenario: Buying property
 
 Given I land on unowned "west" property
 And my funds are 2000
 When I buy the property
 And I pay the printed price
 Then I should receive the "west" title deed
 And my funds should be decreased to 1800 @aloyer
  • 46. Scenario: Default properties - explicit
 Given the default properties are used
 Then the available properties should be at least:
 | name | price |
 | east | 150 |
 | west | 200 |
 | north | 100 |
 | south | 40 | Scenario: Buying property
 Given I land on unowned property
 And my funds are sufficient
 When I choose to buy the property
 Then I pay the printed price
 And I receive the title deed @default_properties
 Scenario: Default properties - by tag
 Then the available properties should be at least:
 | name | price |
 | east | 150 |
 | west | 200 |
 | north | 100 |
 | south | 40 | 
 @default_properties
 Scenario: Buying property
 
 Given I land on unowned "west" property
 And my funds are 2000
 When I buy the property
 And I pay the printed price
 Then I should receive the "west" title deed
 And my funds should be decreased to 1800 @aloyer
  • 47. Scenario: Buying property
 Given I land on unowned property
 And my funds are sufficient
 When I choose to buy the property
 Then I pay the printed price
 And I receive the title deed 
 @default_properties @default_player
 Scenario: Buying property
 
 
 Given I land on unowned "west" property that cost 180
 When I choose to buy the property
 And I pay the printed price
 Then I should receive the "west" title deed
 And my funds should be decreased by 180 
 @default_properties
 Scenario: Buying property
 
 Given I land on unowned "west" property
 And my funds are 2000
 When I buy the property
 And I pay the printed price
 Then I should receive the "west" title deed
 And my funds should be decreased to 1800 @aloyer
  • 48. Scenario: Create a Stock option Given the following option: | Property | Value | | delivery | Cash | | bo strike | no | | floor | 0 | | forex constat | - | | forex constat date | 1970-JAN-01 | | forex start date | 1970-JAN-01 | | guaranteed currency | EUR | | guaranteed rate | 0 | | initial spot | 0 | ... | maturity | 2020-FEB-05 | | option quotity | 1 | | strike | 2500 | | underlying id | SOCIETE-GLE_X | | underlying type | Stock | And the option’s restriking infos is: | Property | Value | | floating rate | no | | fixed rate | no | ... | last update | <now> | | first trading date | <now> | | rate offset | 0.0 | When I create the option Then the option id should be filled in Scenario: Create a Fund option Given the following option: | Property | Value | | delivery | Cash | | bo strike | no | | floor | 0 | | forex constat | - | | forex constat date | 1970-JAN-01 | | forex start date | 1970-JAN-01 | | guaranteed currency | EUR | | guaranteed rate | 0 | | initial spot | 0 | ... | maturity | 2020-FEB-05 | | option quotity | 1 | | strike | 2500 | | underlying id | SOCIETE-GLE_X | | underlying type | Fund | And the option’s restriking infos is: | Property | Value | | floating rate | no | | fixed rate | no | ... | last update | <now> | | first trading date | <now> | | rate offset | 0.0 | When I create the option Then the option id should be filled in ~53 properties ~20 properties @aloyer Too much details ?
  • 49. Scenario: Create an external OTC deal Given the following option: | Property | Value | | delivery | Cash | | bo strike | no | | floor | 0 | | forex constat | - | | forex constat date | 1970-JAN-01 | | forex start date | 1970-JAN-01 | | guaranteed currency | EUR | | guaranteed rate | 0 | | initial spot | 0 | ... | maturity | 2020-FEB-05 | | option quotity | 1 | | strike | 2500 | | underlying id | SOCIETE-GLE_X | | underlying type | Stock | And the option’s restriking infos is: | Property | Value | | floating rate | no | | fixed rate | no | ... | last update | <now> | | first trading date | <now> | | rate offset | 0.0 | And an external OTC deal: | Property | Value | | category | OTC | | delivery | - | | initial price | 0 | | internal market | yes | | last update | <now> | ... | quantity | 6000 | | remaining quantity | 6000 | And the deal’s counter part is: | Property | Value | | confirm mode | ST | | market maker | Nefertiti | ... And the deal’s sales part is: | Property | Value | | accounting center | - | | derogation | no | ... And the deal’s collateral is: | Property | Value | | IA | no | | currency | - | ... When I create the option And I create the deal with the created option Then the deal id should be filled in ~58 ~5 ~58 ~22 @aloyer Too much details ?
  • 50. Scenario: Standard option Given a standard option with no specifics Then the option should have the following properties: | Property | Value | | delivery | Cash | | bo strike | no | | floor | 0 | | forex constat | - | | forex constat date | 1970-JAN-01 | | forex start date | 1970-JAN-01 | | guaranteed currency | EUR | | guaranteed rate | 0 | | initial spot | 0 | ... | maturity | 2020-FEB-05 | | option quotity | 1 | | strike | 2500 | | underlying id | SOCIETE-GLE_X | | underlying type | Stock | | restriking infos | <standard> | ~53 properties Scenario: Standard option’s restriking infos Given a standard option’s restriking infos Then the option’s restriking infos should be: | Property | Value | | floating rate | no | | fixed rate | no | ... | last update | <now> | | first trading date | <now> | | rate offset | 0.0 | ~20 @aloyer Too much details ? use persona Persona is checked AND documented
  • 51. Scenario: Create a Stock option Given the following option: | Property | Value | | delivery | Cash | | bo strike | no | | floor | 0 | | forex constat | - | | forex constat date | 1970-JAN-01 | | forex start date | 1970-JAN-01 | | guaranteed currency | EUR | | guaranteed rate | 0 | | initial spot | 0 | ... | maturity | 2020-FEB-05 | | option quotity | 1 | | strike | 2500 | | underlying id | SOCIETE-GLE_X | | underlying type | Stock | And the option’s restriking infos is: | Property | Value | | floating rate | no | | fixed rate | no | ... | last update | <now> | | first trading date | <now> | | rate offset | 0.0 | When I create the option Then the option id should be filled in Scenario: Create a Stock Option Given a standard option with the following specifics: | underlying type | underlying id | | Stock | SOCIETE-GLE_X | When I create the option Then the option id should be filled in @aloyer Too much details ? use persona
  • 54. Enough details ? http://blog.thiga.fr/product-management/bdd-gherkin-pour-ecrire-vos-user-stories/ @aloyer Lot of details there, 6 decimals precision! GPS? GPS? - destination is usually an address!
  • 58. @aloyer # language: fr
 Fonctionnalité:
 
 
 
 
 
 
 @reseau_simplifié
 Scénario: Obtenir une feuille de l'itinéraire par d'arrivée
 
 2 Place de la Défense: 48.893195, 2.238945
 
 Etant donné que je veux aller de "48.893195, 2.238945" au "25 rue du Louvre, Paris"
 Et que je veux partir à 9h30 avec les options suivantes:
 | X | Transport en commun |
 | X | Le plus rapide |
 | | Le moins de changement |
 Alors je devrais obtenir la feuille de route suivante:
 | Type | Heure | Localisation | Transport | Durée | Distance |
 | départ | 9h30 | 2 Place de la Défense | Pied | ~5min | 400m |
 | - | 9h37 | La Défense | RER A vers Vincennes | 10min | - |
 | - | 9h47 | Châtelet - Les Halles | Pied | ~7min | 550m |
 | arrivée | 9h54 | 25 rue du Louve | - | - | - |
  • 59. @aloyer # language: fr
 Fonctionnalité:
 
 
 
 Scénario: Rer A dans le réseau de transport simplifié
 
 Etant donné le réseau de transport simplifié "Parisien"
 Alors le Rer A devrait passer toutes les 10mins à "la Défense" à partir de 5h37
 Alors les temps de transport cumulés depuis "la Défense" devraient être:
 | Charles de Gaulle Etoile | 5min |
 | Auber | 7min |
 | Chatelet les Halles | 10min |
 
 
 @reseau_simplifié
 Scénario: Obtenir une feuille de l'itinéraire par d'arrivée
 
 2 Place de la Défense: 48.893195, 2.238945
 
 Etant donné que je veux aller de "48.893195, 2.238945" au "25 rue du Louvre, Paris"
 Et que je veux partir à 9h30 avec les options suivantes:
 | X | Transport en commun |
 | X | Le plus rapide |
 | | Le moins de changement |
 Alors je devrais obtenir la feuille de route suivante:
 | Type | Heure | Localisation | Transport | Durée | Distance |
 | départ | 9h30 | 2 Place de la Défense | Pied | ~5min | 400m |
 | - | 9h37 | La Défense | RER A vers Vincennes | 10min | - |
 | - | 9h47 | Châtelet - Les Halles | Pied | ~7min | 550m |
 | arrivée | 9h54 | 25 rue du Louve | - | - | - |
  • 60. To be continued… @aloyer # language: fr
 Fonctionnalité:
 
 Scénario: Le métro 1 dans le réseau de transport simplifié
 
 Etant donné le réseau de transport simplifié "Parisien"
 Alors le métro 1 devrait passer dans chaque station toutes les 5mins à partir de 6h00
 
 Scénario: Rer A dans le réseau de transport simplifié
 
 Etant donné le réseau de transport simplifié "Parisien"
 Alors le Rer A devrait passer toutes les 10mins à "la Défense" à partir de 5h37
 Alors les temps de transport cumulés depuis "la Défense" devraient être:
 | Charles de Gaulle Etoile | 5min |
 | Auber | 7min |
 | Chatelet les Halles | 10min |
 
 
 @reseau_simplifié
 Scénario: Obtenir une feuille de l'itinéraire par d'arrivée
 
 2 Place de la Défense: 48.893195, 2.238945
 
 Etant donné que je veux aller de "48.893195, 2.238945" au "25 rue du Louvre, Paris"
 Et que je veux partir à 9h30 avec les options suivantes:
 | X | Transport en commun |
 | X | Le plus rapide |
 | | Le moins de changement |
 Alors je devrais obtenir la feuille de route suivante:
 | Type | Heure | Localisation | Transport | Durée | Distance |
 | départ | 9h30 | 2 Place de la Défense | Pied | ~5min | 400m |
 | - | 9h37 | La Défense | RER A vers Vincennes | 10min | - |
 | - | 9h47 | Châtelet - Les Halles | Pied | ~7min | 550m |
 | arrivée | 9h54 | 25 rue du Louve | - | - | - |
  • 61. Adjust the cursor @aloyer declarative imperative too much details not enough details
  • 62. Adjust the cursor @aloyer declarative imperative too much details not enough details Together!
  • 63. Remove ambiguities but keep scenario short Am I concrete enough on the expected behavior? Signal vs noise ratio? What if the scenario has more details? @aloyer Rely on Persona/Defaults… Do Scenario Review…
  • 64. is NOT About is About BDD ! " KLa tool for test automation communication acceptance criteriaL K behavior
  • 65. Questions? Arnauld LOYER — @aloyer QTraining Coaching /[TBD]DD/ Testing/Clean Code Mastering Software Development