Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Introduction to BDD - shortened

4,243 views

Published on

Ever looked at a requirement and wondered exactly what you should be testing?
Ever wasted time trying to figure out which of your tests are impacted by a change in the requirements?
Are your automated tests so clear that anyone on the team can read and write them - even the Product Owner?!
These are not unicorns, there is a better way to write clean, simple, easily maintainable tests.

Published in: Technology
  • Be the first to comment

Introduction to BDD - shortened

  1. 1. @sebrose http://cucumber.io Seb Rose Can we reduce the stress of maintaining a high quality product?
  2. 2. @sebrose http://cucumber.io How Projects Really Work (version 1.5) Create your own cartoon at www.projectcartoon.com How the customer explained it How the project leader understood it How the analyst designed it How the programmer wrote it What the beta testers received How the business consultant described it How the project was documented What operations installed How the customer was billed How it was supported What marketing advertised What the customer really needed www.projectcartoon.com
  3. 3. @sebrose http://cucumber.io Business needs are not well understood by the people who want the software
  4. 4. @sebrose http://cucumber.io Business needs are not well understood by the people who want the software
  5. 5. @sebrose http://cucumber.io Business needs are not well understood by the people who will deliver and test the software
  6. 6. @sebrose http://cucumber.io Business needs are not well understood by the people who will deliver and test the software
  7. 7. @sebrose http://cucumber.io Business needs are not well understood by the people who will deliver and test the software
  8. 8. @sebrose http://cucumber.io The software is low quality with lots of bugs
  9. 9. @sebrose http://cucumber.io The cost of change over time increases rapidly CostofChange Time
  10. 10. @sebrose http://cucumber.io Successful Projects
  11. 11. @sebrose http://cucumber.io Successful Projects Shared understanding
  12. 12. @sebrose http://cucumber.io Successful Projects Shared understanding Know when youare done
  13. 13. @sebrose http://cucumber.io Successful Projects Shared understanding Know when youare done Know what to do next
  14. 14. @sebrose http://cucumber.io Successful Projects Shared understanding Know when youare done Know what to do next The codebase supports the inevitable changes as theproject evolves
  15. 15. @sebrose http://cucumber.io Successful Projects Shared understanding Know when youare done Know what to do next The codebase supports the inevitable changes as theproject evolves Know quickly when new changes break existing behaviour
  16. 16. @sebrose http://cucumber.io Three practices
  17. 17. @sebrose http://cucumber.io Discovery Create a shared understanding of the requirements through collaboration, typically achieved through a structured conversation centred on rules and examples Three practices
  18. 18. @sebrose http://cucumber.io Discovery Create a shared understanding of the requirements through collaboration, typically achieved through a structured conversation centred on rules and examples Formulation Examples of system behaviour are documented using business terminology Three practices
  19. 19. @sebrose http://cucumber.io Discovery Create a shared understanding of the requirements through collaboration, typically achieved through a structured conversation centred on rules and examples Formulation Examples of system behaviour are documented using business terminology Automation The documentation is automated, creating living documentation that verifies the system’s behaviour Three practices
  20. 20. @sebrose http://cucumber.io Discovery Create a shared understanding of the requirements through collaboration, typically achieved through a structured conversation centred on rules and examples Formulation Examples of system behaviour are documented using business terminology Automation The documentation is automated, creating living documentation that verifies the system’s behaviour Three practices
  21. 21. @sebrose http://cucumber.io Discovery https://cucumber.io/blog/2015/12/08/example-mapping-introduction https://www.youtube.com/watch?v=VwvrGfWmG_U Example Mapping
  22. 22. @sebrose http://cucumber.io Feature: Team Scoring Teams start with zero score. Correct answer gets points depending on 
 how difficult it is. Scenario: Score starts at 0 Given I register a team Then my score is 0 Scenario: Correct easy answer scores 10 Given I register a team When I submit a correct easy answer Then my score is 10 Scenario: Correct hard answer scores 50 Given I register a team When I submit a correct hard answer Then my score is 50 Formulation
  23. 23. @sebrose http://cucumber.io Feature: Team Scoring Teams start with zero score. Correct answer gets points depending on 
 how difficult it is. Scenario: Score starts at 0 Given I register a team Then my score is 0 Scenario: Correct easy answer scores 10 Given I register a team When I submit a correct easy answer Then my score is 10 Scenario: Correct hard answer scores 50 Given I register a team When I submit a correct hard answer Then my score is 50 Formulation
  24. 24. @sebrose http://cucumber.io Feature: Team Scoring Teams start with zero score. Correct answer gets points depending on 
 how difficult it is. Scenario: Score starts at 0 Given I register a team Then my score is 0 Scenario: Correct easy answer scores 10 Given I register a team When I submit a correct easy answer Then my score is 10 Scenario: Correct hard answer scores 50 Given I register a team When I submit a correct hard answer Then my score is 50 Formulation
  25. 25. @sebrose http://cucumber.io Feature: Team Scoring Teams start with zero score. Correct answer gets points depending on 
 how difficult it is. Scenario: Score starts at 0 Given I register a team Then my score is 0 Scenario: Correct easy answer scores 10 Given I register a team When I submit a correct easy answer Then my score is 10 Scenario: Correct hard answer scores 50 Given I register a team When I submit a correct hard answer Then my score is 50 Formulation
  26. 26. @sebrose http://cucumber.io Feature: Team Scoring Teams start with zero score. Correct answer gets points depending on 
 how difficult it is. Scenario: Score starts at 0 Given I register a team Then my score is 0 Scenario: Correct easy answer scores 10 Given I register a team When I submit a correct easy answer Then my score is 10 Scenario: Correct hard answer scores 50 Given I register a team When I submit a correct hard answer Then my score is 50 Formulation
  27. 27. @sebrose http://cucumber.io Feature: Team Scoring Teams start with zero score. Correct answer gets points depending on 
 how difficult it is. Scenario: Score starts at 0 Given I register a team Then my score is 0 Scenario: Correct easy answer scores 10 Given I register a team When I submit a correct easy answer Then my score is 10 Scenario: Correct hard answer scores 50 Given I register a team When I submit a correct hard answer Then my score is 50 Formulation
  28. 28. @sebrose http://cucumber.io Feature: Team Scoring Teams start with zero score. Correct answer gets points depending on 
 how difficult it is. Scenario: Score starts at 0 Given I register a team Then my score is 0 Scenario: Correct easy answer scores 10 Given I register a team When I submit a correct easy answer Then my score is 10 Scenario: Correct hard answer scores 50 Given I register a team When I submit a correct hard answer Then my score is 50 Formulation
  29. 29. @sebrose http://cucumber.io Automation
  30. 30. @sebrose http://cucumber.io Features Automation
  31. 31. @sebrose http://cucumber.io Features -Scenarios Automation
  32. 32. @sebrose http://cucumber.io Features -Scenarios -Steps Automation
  33. 33. @sebrose http://cucumber.io Features -Scenarios -Steps -Gherkin Automation
  34. 34. @sebrose http://cucumber.io Features -Scenarios -Steps -Gherkin Each scenario is an example Automation
  35. 35. @sebrose http://cucumber.io Features -Scenarios -Steps -Gherkin Glue code Each scenario is an example Automation
  36. 36. @sebrose http://cucumber.io Features -Scenarios -Steps -Gherkin Glue code -Step definitions Each scenario is an example Automation
  37. 37. @sebrose http://cucumber.io Features -Scenarios -Steps -Gherkin Glue code -Step definitions -Java / C# Each scenario is an example Automation
  38. 38. @sebrose http://cucumber.io Features -Scenarios -Steps -Gherkin Glue code -Step definitions -Java / C# Automation
  39. 39. @sebrose http://cucumber.io Features -Scenarios -Steps -Gherkin Glue code -Step definitions -Java / C# Automation
  40. 40. @sebrose http://cucumber.io Features -Scenarios -Steps -Gherkin Glue code -Step definitions -Java / C# Application Automation
  41. 41. @sebrose http://cucumber.io Pulling it all together
  42. 42. @sebrose http://cucumber.io http://bddbooks.com
  43. 43. Seb Rose 
 Twitter: @sebrose Blog: http:/cucumber.io/blog E-mail: seb@cucumber.io

×