SlideShare une entreprise Scribd logo
1  sur  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

Contenu connexe

En vedette

The Secret to Mapnik Mastery
The Secret to Mapnik MasteryThe Secret to Mapnik Mastery
The Secret to Mapnik MasterySafe Software
 
OpenStreetMap, l'open data du territoire
OpenStreetMap, l'open data du territoireOpenStreetMap, l'open data du territoire
OpenStreetMap, l'open data du territoireAntoine Riche
 
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.jsNick Kridler
 
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 2016Loic Ortola
 
OpenStreetMap pour les collectivités territoriales
OpenStreetMap pour les collectivités territorialesOpenStreetMap pour les collectivités territoriales
OpenStreetMap pour les collectivités territorialesAntoine Riche
 
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 Jean-Christophe Elineau
 
La cartographie indoor sur OpenStreetMap
La cartographie indoor sur OpenStreetMapLa cartographie indoor sur OpenStreetMap
La cartographie indoor sur OpenStreetMapAntoine Riche
 
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 AdventureNick Kridler
 
Rendering OpenStreetMap Data using Mapnik
Rendering OpenStreetMap Data using MapnikRendering OpenStreetMap Data using Mapnik
Rendering OpenStreetMap Data using MapnikGraham Jones
 
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 prospectsAntoine Riche
 
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 PythonJoe Cabrera
 
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 WebAntoine Riche
 
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 PythonAndrii Mishkovskyi
 
D3 in Jupyter : PyData NYC 2015
D3 in Jupyter : PyData NYC 2015D3 in Jupyter : PyData NYC 2015
D3 in Jupyter : PyData NYC 2015Brian Coffey
 
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 SIGmapali
 

En vedette (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
 

Plus de 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 PhelanSyncConf
 
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 RobinsonSyncConf
 
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 PloskerSyncConf
 
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 AsproniSyncConf
 
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 GaleSyncConf
 
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 HumeSyncConf
 
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 KellySyncConf
 

Plus de 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
 

Dernier

GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
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, Adobeapidays
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
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...Martijn de Jong
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
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 TerraformAndrey Devyatkin
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 

Dernier (20)

GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
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
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
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...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
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
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.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.