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

What is BDD and why should I care?

Cdf378de2284d8acf137122e541caa28?s=47 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.

Cdf378de2284d8acf137122e541caa28?s=128

mattwynne

October 09, 2012
Tweet

Transcript

  1. What is BDD ...and why should I care? @mattwynne BCS,

    Edinburgh 3rd October 2012
  2. Living documentation BDD Kickstart.com mattwynne.net Coaching / blogging training Collaborating

  3. BDD: Dual Audience Stakeholders, Customers, Users Programmers, Testers

  4. Problem domain Solution domain

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

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

    Use examples to clarify their requirements • Develop and use a ubiquitous language
  7. None
  8. UBIQUITOUS LANGUAGE

  9. None
  10. DDD + NLP

  11. Language matters DDD + NLP

  12. OUTSIDE IN

  13. Outside-in

  14. Why?

  15. Why? Why? Why? Why? Why?

  16. Organisation Goal

  17. Product Features / Epics

  18. User / Stakeholder Stories

  19. VISA subscriptions In order to increase subscriptions visitors should be

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

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

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

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

    able to subscribe online with a VISA card Acceptance Criteria
  24. 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:
  25. Acceptance Criteria

  26. Are we ready yet?

  27. Really? So tell me... "Customers should be prevented from entering

    invalid credit card details"
  28. Really? So tell me... "Customers should be prevented from entering

    invalid credit card details" • What exactly makes someone's credit card details invalid?
  29. 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?
  30. 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?
  31. 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?
  32. 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?
  33. 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...
  34. EXAMPLES

  35. Acceptance Criteria

  36. Scenarios

  37. "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:
  38. "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?
  39. "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?
  40. Common understanding of Done

  41. User Story Acceptance Criteria Scenarios

  42. Scenarios

  43. AUTOMATION

  44. Behaviour = Context + Action + Outcome

  45. Behaviour = Context + Action + Outcome Given

  46. Behaviour = Context + Action + Outcome Given When

  47. Behaviour = Context + Action + Outcome Given When Then

  48. Scenario: Tickle a happy person Given I am in a

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

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

    bad mood When you tickle me Then I will giggle
  51. 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"
  52. Scenario: Tickle a grumpy person Given I am in a

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

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

    good mood When you kick me in the shins Then I will get cross
  55. Behaviour = Context + Action + Outcome

  56. Behaviour = Context + Action + Outcome Given

  57. Behaviour = Context + Action + Outcome Given When

  58. Behaviour = Context + Action + Outcome Given When Then

  59. System = ∑(Behaviour)

  60. http://cukes.info/

  61. Javascript

  62. Demo

  63. Gherkin (language)

  64. # 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
  65. # language: ja ϑΟʔνϟ: আࢉ όΧͳؒҧ͍Λආ͚ΔͨΊʹ ༗ཧ਺΋ܭࢉͰ͖Δ͜ͱ γφϦΦ: ;ͭ͏ͷ਺஋ લఏ

    3 Λೖྗ ͔ͭ 2 Λೖྗ ΋͠ divide Λԡͨ͠ ͳΒ͹ 1.5 Λදࣔ
  66. български 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 简ମதจ ൟᱪதจ תירבע !"#$%&ا
  67. 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!
  68. 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 ...
  69. FORGET THE TOOLS

  70. "Let's make toast the American way: You burn it, and

    I'll scrape it" - W. E. Demming
  71. None
  72. Plan

  73. Plan Develop

  74. Plan Develop Misery

  75. Plan Develop Testing

  76. Plan Develop Testing

  77. Plan Develop Test

  78. So... why should I care?

  79. If you're a developer

  80. If you're a developer • BDD will help you to

    focus
  81. If you're a developer • BDD will help you to

    focus • BDD will give you confidence to refactor
  82. 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
  83. If you're a product owner or business analyst

  84. 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
  85. 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
  86. 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
  87. If you're a tester

  88. If you're a tester • BDD will mean you can

    find bugs before they've even been written
  89. 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
  90. If you're a project manager

  91. If you're a project manager • BDD will help your

    team achieve a steadier, more predictable, and ultimately faster pace
  92. Thanks • matt@mattwynne.net • @mattwynne • http://blog.mattwynne.net