SlideShare a Scribd company logo
1 of 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

More Related Content

Viewers also liked

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
 

Viewers also liked (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
 

More from 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
 

More from 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
 

Recently uploaded

Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 

Recently uploaded (20)

Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 

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.