Upgrade to Pro — share decks privately, control downloads, hide ads and more …

What is BDD and why should I care?

mattwynne
October 09, 2012

What is BDD and why should I care?

There's a lot of hype around about BDD. Here Matt talks through the basic philosophy behind BDD, how it relates to existing agile practices, and what impact it can have on your team.

mattwynne

October 09, 2012
Tweet

More Decks by mattwynne

Other Decks in Technology

Transcript

  1. "Behaviour-Driven Development (BDD) builds upon Test-Driven Development (TDD) by formalising

    the good habits of the best TDD practitioners." -- The Cucumber Book, 2011
  2. The best TDD practitioners... • Work from the outside-in •

    Use examples to clarify their requirements • Develop and use a ubiquitous language
  3. VISA subscriptions In order to increase subscriptions visitors should be

    able to subscribe online with a VISA card User / Stakeholder Story
  4. VISA subscriptions In order to increase subscriptions visitors should be

    able to subscribe online with a VISA card User / Stakeholder Story
  5. VISA subscriptions In order to increase subscriptions visitors should be

    able to subscribe online with a VISA card User / Stakeholder Story
  6. VISA subscriptions In order to increase subscriptions visitors should be

    able to subscribe online with a VISA card User / Stakeholder Story
  7. VISA subscriptions In order to increase subscriptions visitors should be

    able to subscribe online with a VISA card Acceptance Criteria
  8. Acceptance Criteria •Must support VISA •Does not need to support

    MasterCard, Switch •... •Customers should be prevented from entering invalid credit card details • ... Credit Card Processing Acceptance criteria:
  9. Really? So tell me... "Customers should be prevented from entering

    invalid credit card details" • What exactly makes someone's credit card details invalid?
  10. Really? So tell me... "Customers should be prevented from entering

    invalid credit card details" • What exactly makes someone's credit card details invalid? • Can they use spaces?
  11. Really? So tell me... "Customers should be prevented from entering

    invalid credit card details" • What exactly makes someone's credit card details invalid? • Can they use spaces? • Should we checksum the digits?
  12. Really? So tell me... "Customers should be prevented from entering

    invalid credit card details" • What exactly makes someone's credit card details invalid? • Can they use spaces? • Should we checksum the digits? • How do we feed back that the details are invalid?
  13. Really? So tell me... "Customers should be prevented from entering

    invalid credit card details" • What exactly makes someone's credit card details invalid? • Can they use spaces? • Should we checksum the digits? • How do we feed back that the details are invalid?
  14. Really? So tell me... "Customers should be prevented from entering

    invalid credit card details" • What exactly makes someone's credit card details invalid? • Can they use spaces? • Should we checksum the digits? • How do we feed back that the details are invalid? An example would be handy right about now...
  15. "Customers should be prevented from entering invalid credit card details"

    1. Customer enters a credit card number that contains only 15 digits 2. Customer tries to submit the form 3. form is re-displayed with an error message advising Customer that the correct number of digits is 16 For example, imagine this scenario:
  16. "Customers should be prevented from entering invalid credit card details"

    1. Customer enters a credit card number that contains only 15 digits 2. Customer tries to submit the form 3. form is re-displayed with an error message advising Customer that the correct number of digits is 16 For example, imagine this scenario: Really? Always?
  17. "Customers should be prevented from entering invalid credit card details"

    1. Customer enters a credit card number that contains only 15 digits 2. Customer tries to submit the form 3. form is re-displayed with an error message advising Customer that the correct number of digits is 16 For example, imagine this scenario: What if...? Really? Always?
  18. Scenario: Tickle a happy person Given I am in a

    good mood When you tickle me Then I will giggle
  19. Scenario: Tickle a happy person Given I am in a

    good mood When you tickle me Then I will giggle
  20. Scenario: Tickle a grumpy person Given I am in a

    bad mood When you tickle me Then I will giggle
  21. Scenario: Tickle a grumpy person Given I am in a

    bad mood When you tickle me Then I will giggle expected: "tee hee hee", got: "bugger off"
  22. Scenario: Tickle a grumpy person Given I am in a

    bad mood When you tickle me Then I will get cross
  23. Scenario: Attack a happy person Given I am in a

    good mood When you kick me in the shins Then I will get cross
  24. Scenario: Attack a happy person Given I am in a

    good mood When you kick me in the shins Then I will get cross
  25. # language: en Feature: Division In order to avoid silly

    mistakes Cashiers must be able to calculate a fraction Scenario: Regular numbers Given I have entered 3 into the calculator And I have entered 2 into the calculator When I press divide Then the result should be 1.5 on the screen
  26. български català Cymraeg Česky dansk Deutsch English Australian LOLCAT Texan

    español eesti keel ೔ຊޠ 한국어 lietuvių kalba latviešu Nederlands norsk polski português română suomi français hrvatski magyar Bahasa Indonesia italiano русский Svenska Slovensky Узбекча Tiếng Việt 简ମதจ ൟᱪதจ תירבע !"#$%&ا
  27. OH HAI: STUFFING MISHUN: CUCUMBR I CAN HAZ IN TEH

    BEGINNIN "3" CUCUMBRZ WEN I EAT "2" CUCUMBRZ DEN I HAZ "2" CUCUMBERZ IN MAH BELLY AN IN TEH END "1" CUCUMBRZ KTHXBAI!
  28. Gherkin Fundamentals Feature: Feature name Description of feature goes here

    Scenario: Scenario name Description of scenario goes here Given a certain context When something happens Then an outcome And something else But not this though Scenario: Another scenario name Description of another scenario goes here ...
  29. If you're a developer • BDD will help you to

    focus • BDD will give you confidence to refactor
  30. If you're a developer • BDD will help you to

    focus • BDD will give you confidence to refactor • BDD will help you to understand the business-facing people on your team better
  31. If you're a product owner or business analyst • BDD

    will give you a greater insight into the complexity of what you're asking for
  32. If you're a product owner or business analyst • BDD

    will give you a greater insight into the complexity of what you're asking for • BDD will give you transparency about what the team are doing in each iteration
  33. If you're a product owner or business analyst • BDD

    will give you a greater insight into the complexity of what you're asking for • BDD will give you transparency about what the team are doing in each iteration • BDD will help your team ship faster
  34. If you're a tester • BDD will mean you can

    find bugs before they've even been written
  35. If you're a tester • BDD will mean you can

    find bugs before they've even been written • BDD will free you to do interesting, creative, exploratory testing
  36. If you're a project manager • BDD will help your

    team achieve a steadier, more predictable, and ultimately faster pace