SlideShare une entreprise Scribd logo
1  sur  23
Télécharger pour lire hors ligne
Fabian Kiss




               THE CONCEPT OF
BEHAVIOR-DRIVEN DEVELOPMENT
Unit
Testing
test-first


  Unit
 Testing
test-first


        Unit
       Testing

TDD
BDD



      test-first


        Unit
       Testing

TDD
BDD




     ?



“TDD done right”
BDD IS NOT ABOUT TOOLS




      (ALTHOUGH THERE ARE TOOLS FOR BDD)
BDD




  actices
pr
BDD




  actices
pr




            maybe you already practice it
             (without being aware of it)
BDD




  actices
pr




            maybe you already practice it
             (without being aware of it)
BDD




  actices
pr
   awaren
          ess
SYNTACTIC CONVENTIONS
 method names are complete sentences
 public class CustomerLookupTest extends TestCase {
     testFindsCustomerById() {
         ...
     }
     testFailsForDuplicateCustomers() {
         ...
     }
     ...
 }




 “should” instead of “test”
 testShouldFailForMissingSurname
 testShouldFailForMissingTitle



 ...

                                    http://dannorth.net/introducing-bdd/
WHAT TO TEST?
WHAT TO TEST? UNITS
CODE COVERAGE ...




Picture by PeterJBellis, licensed under the CC BY 2.0
… A FALSE SENSE
                                                              OF SECURITY




Picture by Salim Virji, licensed under the CC BY-SA 2.0
WHAT TO TEST? UNITS
WHAT TO TEST?
WHAT TO TEST? UNITS
WHAT TO TEST? BEHAVIOR
BEHAVIOR
 constituted by scenarios (descriptions of them)
BEHAVIOR
 constituted by scenarios (descriptions of them)




 acceptance criteria


           extract



 User story
  As a ...
  I want …
  So that ...
BEHAVIOR
 constituted by scenarios (descriptions of them)


                     describe in DSL → executable


 acceptance criteria


           extract



 User story
  As a ...
  I want …
  So that ...
BEHAVIOR
 constituted by scenarios (descriptions of them)


                     describe in DSL → executable


 acceptance criteria


           extract                             Gherkin:
                                               Given a precondition
 User story                                    When an event occurred
                                               Then an outcome is achieved
  As a ...
  I want …
  So that ...
BEHAVIOR
 constituted by scenarios (descriptions of them)


                     describe in DSL → executable


 acceptance criteria


           extract                             Gherkin:
                                               Given a precondition
 User story                                    When an event occurred
                                               Then an outcome is achieved
  As a ...
  I want …
  So that ...                                 execute


                                    tool

Contenu connexe

Similaire à The concept of Behavior-Driven Development

Alexander Litvinok (software engineer) "bdd wtf"
Alexander Litvinok (software engineer) "bdd wtf"Alexander Litvinok (software engineer) "bdd wtf"
Alexander Litvinok (software engineer) "bdd wtf"
EPAM Systems
 
2010 06-24 karlsruher entwicklertag
2010 06-24 karlsruher entwicklertag2010 06-24 karlsruher entwicklertag
2010 06-24 karlsruher entwicklertag
Marcel Bruch
 
David Nuescheler: Igniting CQ 5.3: What's New and Roadmap
David Nuescheler: Igniting CQ 5.3: What's New and RoadmapDavid Nuescheler: Igniting CQ 5.3: What's New and Roadmap
David Nuescheler: Igniting CQ 5.3: What's New and Roadmap
Day Software
 
Leveraging Adobe JavaScript Virtual Machine
Leveraging Adobe JavaScript Virtual MachineLeveraging Adobe JavaScript Virtual Machine
Leveraging Adobe JavaScript Virtual Machine
Z Chen
 

Similaire à The concept of Behavior-Driven Development (13)

Behavior Driven Development by Example
Behavior Driven Development by ExampleBehavior Driven Development by Example
Behavior Driven Development by Example
 
Behaviour Driven Development
Behaviour Driven DevelopmentBehaviour Driven Development
Behaviour Driven Development
 
Behavior Driven Development - WPC 2011
Behavior Driven Development - WPC 2011Behavior Driven Development - WPC 2011
Behavior Driven Development - WPC 2011
 
What's new in CQ 5.3? Top 10 features.
What's new in CQ 5.3? Top 10 features.What's new in CQ 5.3? Top 10 features.
What's new in CQ 5.3? Top 10 features.
 
Mspec talk
Mspec talkMspec talk
Mspec talk
 
BDD: WTF?@#
BDD: WTF?@#BDD: WTF?@#
BDD: WTF?@#
 
Alexander Litvinok (software engineer) "bdd wtf"
Alexander Litvinok (software engineer) "bdd wtf"Alexander Litvinok (software engineer) "bdd wtf"
Alexander Litvinok (software engineer) "bdd wtf"
 
2010 06-24 karlsruher entwicklertag
2010 06-24 karlsruher entwicklertag2010 06-24 karlsruher entwicklertag
2010 06-24 karlsruher entwicklertag
 
NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...
NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...
NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...
 
David Nuescheler: Igniting CQ 5.3: What's New and Roadmap
David Nuescheler: Igniting CQ 5.3: What's New and RoadmapDavid Nuescheler: Igniting CQ 5.3: What's New and Roadmap
David Nuescheler: Igniting CQ 5.3: What's New and Roadmap
 
Introduction to directshow II
Introduction to directshow IIIntroduction to directshow II
Introduction to directshow II
 
Leveraging Adobe JavaScript Virtual Machine
Leveraging Adobe JavaScript Virtual MachineLeveraging Adobe JavaScript Virtual Machine
Leveraging Adobe JavaScript Virtual Machine
 
An Introduction to Behaviour Driven Development with Cucumber Java
An Introduction to Behaviour Driven Development with Cucumber JavaAn Introduction to Behaviour Driven Development with Cucumber Java
An Introduction to Behaviour Driven Development with Cucumber Java
 

Plus de Fabian Kiss

Plus de Fabian Kiss (7)

#noprojects (digest version)
#noprojects (digest version)#noprojects (digest version)
#noprojects (digest version)
 
#noprojects (full version)
#noprojects (full version)#noprojects (full version)
#noprojects (full version)
 
Relatives Schätzen - SwissICT Agile Breakfast Bern
Relatives Schätzen - SwissICT Agile Breakfast BernRelatives Schätzen - SwissICT Agile Breakfast Bern
Relatives Schätzen - SwissICT Agile Breakfast Bern
 
BDD in open source projects - Is it really beneficial?
BDD in open source projects - Is it really beneficial?BDD in open source projects - Is it really beneficial?
BDD in open source projects - Is it really beneficial?
 
Collocation in Distributed Scrum Teams - Lessons Learned
Collocation in Distributed Scrum Teams - Lessons LearnedCollocation in Distributed Scrum Teams - Lessons Learned
Collocation in Distributed Scrum Teams - Lessons Learned
 
Documentation for Program Comprehension in Agile Software Development
Documentation for Program Comprehension in Agile Software DevelopmentDocumentation for Program Comprehension in Agile Software Development
Documentation for Program Comprehension in Agile Software Development
 
Documentation in the agile software development process
Documentation in the agile software development processDocumentation in the agile software development process
Documentation in the agile software development process
 

Dernier

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Dernier (20)

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
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
 
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
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
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...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 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
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
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
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 

The concept of Behavior-Driven Development

  • 1. Fabian Kiss THE CONCEPT OF BEHAVIOR-DRIVEN DEVELOPMENT
  • 3. test-first Unit Testing
  • 4. test-first Unit Testing TDD
  • 5. BDD test-first Unit Testing TDD
  • 6. BDD ? “TDD done right”
  • 7. BDD IS NOT ABOUT TOOLS (ALTHOUGH THERE ARE TOOLS FOR BDD)
  • 9. BDD actices pr maybe you already practice it (without being aware of it)
  • 10. BDD actices pr maybe you already practice it (without being aware of it)
  • 11. BDD actices pr awaren ess
  • 12. SYNTACTIC CONVENTIONS method names are complete sentences public class CustomerLookupTest extends TestCase { testFindsCustomerById() { ... } testFailsForDuplicateCustomers() { ... } ... } “should” instead of “test” testShouldFailForMissingSurname testShouldFailForMissingTitle ... http://dannorth.net/introducing-bdd/
  • 14. WHAT TO TEST? UNITS
  • 15. CODE COVERAGE ... Picture by PeterJBellis, licensed under the CC BY 2.0
  • 16. … A FALSE SENSE OF SECURITY Picture by Salim Virji, licensed under the CC BY-SA 2.0
  • 17. WHAT TO TEST? UNITS WHAT TO TEST?
  • 18. WHAT TO TEST? UNITS WHAT TO TEST? BEHAVIOR
  • 19. BEHAVIOR constituted by scenarios (descriptions of them)
  • 20. BEHAVIOR constituted by scenarios (descriptions of them) acceptance criteria extract User story As a ... I want … So that ...
  • 21. BEHAVIOR constituted by scenarios (descriptions of them) describe in DSL → executable acceptance criteria extract User story As a ... I want … So that ...
  • 22. BEHAVIOR constituted by scenarios (descriptions of them) describe in DSL → executable acceptance criteria extract Gherkin: Given a precondition User story When an event occurred Then an outcome is achieved As a ... I want … So that ...
  • 23. BEHAVIOR constituted by scenarios (descriptions of them) describe in DSL → executable acceptance criteria extract Gherkin: Given a precondition User story When an event occurred Then an outcome is achieved As a ... I want … So that ... execute tool