SlideShare ist ein Scribd-Unternehmen logo
1 von 20
Liz Keogh
@lunivore
BDD uses examples to illustrate behaviour

  Conversations are the most important aspect

  Examples can help you discover things early

Sometimes you discover that you don’t know
An Example of an Example


Given Fred has bought a microwave
   And the microwave cost £100
  When we refund the microwave
Then Fred should be refunded £100.
Examples



       Given a context
   When an event happens
Then an outcome should occur
Cucumber

Feature: Addition
  In order to avoid silly mistakes
       This is what most people
  As a math idiot
  I want to be told the sum of two numbers
          associate with BDD
  Scenario: Add two numbers
    Given I have entered 50 into the calculator
    And I have entered 70 into the calculator
    Then the result should be 120 on the screen
Having conversations
Boring!
      Given Fred bought a microwave
     And has receipt number 1857123
     And receipt 1857123 list it at £100
         When we scan the receipt
Then the screen should show the list of items
      When we select the microwave
              And we refund it
         And scan Fred’s credit card
    Then Fred should be refunded £100.
Examples



       Given a context
   When an event happens
Then an outcome should occur
Make sure you get it right

Assume you got it wrong
Is there a context in which
    this event will create
    a different outcome?
Examples

  Given Fred has bought a microwave
     And the microwave cost £100
And the microwave was on 10% discount
    When we refund the microwave
  Then Fred should be refunded £90.
Is this the only outcome
           that matters?
If we could achieve it with pixies,
       would it be enough?
Examples


Given Fred has bought a microwave
   And the microwave cost £100
 When we refund the microwave
  Then the microwave should be
    added to the stock count.
And you can keep going…

Given Fred has bought a microwave
   And the microwave cost £100
    And the microwave is faulty
  When we refund the microwave
Then a fault ticket should be printed.
Liz Keogh
http://lizkeogh.com
@lunivore

Weitere ähnliche Inhalte

Andere mochten auch

Making use of OpenStreetMap data with Python
Making use of OpenStreetMap data with PythonMaking use of OpenStreetMap data with Python
Making use of OpenStreetMap data with Python
Andrii Mishkovskyi
 

Andere mochten auch (15)

The Secret to Mapnik Mastery
The Secret to Mapnik MasteryThe Secret to Mapnik Mastery
The Secret to Mapnik Mastery
 
OpenStreetMap, l'open data du territoire
OpenStreetMap, l'open data du territoireOpenStreetMap, l'open data du territoire
OpenStreetMap, l'open data du territoire
 
Pyxley: Easy Web Applications with Flask and React.js
Pyxley: Easy Web Applications with Flask and React.jsPyxley: Easy Web Applications with Flask and React.js
Pyxley: Easy Web Applications with Flask and React.js
 
Map as a Service OVH Summit 2016
Map as a Service OVH Summit 2016Map as a Service OVH Summit 2016
Map as a Service OVH Summit 2016
 
OpenStreetMap pour les collectivités territoriales
OpenStreetMap pour les collectivités territorialesOpenStreetMap pour les collectivités territoriales
OpenStreetMap pour les collectivités territoriales
 
Présentation Brocas Open Data - Congrès Association des Maires de France
Présentation Brocas Open Data - Congrès Association des Maires de France Présentation Brocas Open Data - Congrès Association des Maires de France
Présentation Brocas Open Data - Congrès Association des Maires de France
 
La cartographie indoor sur OpenStreetMap
La cartographie indoor sur OpenStreetMapLa cartographie indoor sur OpenStreetMap
La cartographie indoor sur OpenStreetMap
 
A Year of Pyxley: My First Open Source Adventure
A Year of Pyxley: My First Open Source AdventureA Year of Pyxley: My First Open Source Adventure
A Year of Pyxley: My First Open Source Adventure
 
Rendering OpenStreetMap Data using Mapnik
Rendering OpenStreetMap Data using MapnikRendering OpenStreetMap Data using Mapnik
Rendering OpenStreetMap Data using Mapnik
 
OSM goes indoors: usages, tools and prospects
OSM goes indoors: usages, tools and prospectsOSM goes indoors: usages, tools and prospects
OSM goes indoors: usages, tools and prospects
 
Building a data processing pipeline in Python
Building a data processing pipeline in PythonBuilding a data processing pipeline in Python
Building a data processing pipeline in Python
 
Communiquez avec des cartes : a cartographie interactive sur le Web
Communiquez avec des cartes : a cartographie interactive sur le WebCommuniquez avec des cartes : a cartographie interactive sur le Web
Communiquez avec des cartes : a cartographie interactive sur le Web
 
Making use of OpenStreetMap data with Python
Making use of OpenStreetMap data with PythonMaking use of OpenStreetMap data with Python
Making use of OpenStreetMap data with Python
 
D3 in Jupyter : PyData NYC 2015
D3 in Jupyter : PyData NYC 2015D3 in Jupyter : PyData NYC 2015
D3 in Jupyter : PyData NYC 2015
 
Zoom sur OpenStreetMap - De l'Open Data dans vos SIG
Zoom sur OpenStreetMap - De l'Open Data dans vos SIGZoom sur OpenStreetMap - De l'Open Data dans vos SIG
Zoom sur OpenStreetMap - De l'Open Data dans vos SIG
 

Mehr von SyncConf

The Multimap Journey and How to raise Angel Investment by Sean Phelan
The Multimap Journey and How to raise Angel Investment by Sean PhelanThe Multimap Journey and How to raise Angel Investment by Sean Phelan
The Multimap Journey and How to raise Angel Investment by Sean Phelan
SyncConf
 

Mehr von SyncConf (7)

The Multimap Journey and How to raise Angel Investment by Sean Phelan
The Multimap Journey and How to raise Angel Investment by Sean PhelanThe Multimap Journey and How to raise Angel Investment by Sean Phelan
The Multimap Journey and How to raise Angel Investment by Sean Phelan
 
Tackling Complex Data with Neo4j by Ian Robinson
Tackling Complex Data with Neo4j by Ian RobinsonTackling Complex Data with Neo4j by Ian Robinson
Tackling Complex Data with Neo4j by Ian Robinson
 
Next Top Data Model by Ian Plosker
Next Top Data Model by Ian PloskerNext Top Data Model by Ian Plosker
Next Top Data Model by Ian Plosker
 
Writing Usable APIs in Practice by Giovanni Asproni
Writing Usable APIs in Practice by Giovanni AsproniWriting Usable APIs in Practice by Giovanni Asproni
Writing Usable APIs in Practice by Giovanni Asproni
 
The Ubiquitous Digital Map (Abridged) by Gary Gale
The Ubiquitous Digital Map (Abridged) by Gary GaleThe Ubiquitous Digital Map (Abridged) by Gary Gale
The Ubiquitous Digital Map (Abridged) by Gary Gale
 
Breaking News and Breaking Software by Andy Hume
Breaking News and Breaking Software by Andy HumeBreaking News and Breaking Software by Andy Hume
Breaking News and Breaking Software by Andy Hume
 
The 90 minute Guide to Agile – What, Why, How by Allan Kelly
The 90 minute Guide to Agile – What, Why, How by Allan KellyThe 90 minute Guide to Agile – What, Why, How by Allan Kelly
The 90 minute Guide to Agile – What, Why, How by Allan Kelly
 

Kürzlich hochgeladen

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Kürzlich hochgeladen (20)

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 

Behaviour Driven Development by Liz Keogh

  • 2. BDD uses examples to illustrate behaviour Conversations are the most important aspect Examples can help you discover things early Sometimes you discover that you don’t know
  • 3.
  • 4. An Example of an Example Given Fred has bought a microwave And the microwave cost £100 When we refund the microwave Then Fred should be refunded £100.
  • 5. Examples Given a context When an event happens Then an outcome should occur
  • 6. Cucumber Feature: Addition In order to avoid silly mistakes This is what most people As a math idiot I want to be told the sum of two numbers associate with BDD Scenario: Add two numbers Given I have entered 50 into the calculator And I have entered 70 into the calculator Then the result should be 120 on the screen
  • 7.
  • 9. Boring! Given Fred bought a microwave And has receipt number 1857123 And receipt 1857123 list it at £100 When we scan the receipt Then the screen should show the list of items When we select the microwave And we refund it And scan Fred’s credit card Then Fred should be refunded £100.
  • 10.
  • 11. Examples Given a context When an event happens Then an outcome should occur
  • 12.
  • 13.
  • 14. Make sure you get it right Assume you got it wrong
  • 15. Is there a context in which this event will create a different outcome?
  • 16. Examples Given Fred has bought a microwave And the microwave cost £100 And the microwave was on 10% discount When we refund the microwave Then Fred should be refunded £90.
  • 17. Is this the only outcome that matters? If we could achieve it with pixies, would it be enough?
  • 18. Examples Given Fred has bought a microwave And the microwave cost £100 When we refund the microwave Then the microwave should be added to the stock count.
  • 19. And you can keep going… Given Fred has bought a microwave And the microwave cost £100 And the microwave is faulty When we refund the microwave Then a fault ticket should be printed.