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

BDD for the IIBA meeting

BDD for the IIBA meeting

When it comes to requirements refinement, phrases such as “split the user stories”, “use the three amigos”, and “refine when necessary” are often used to describe ways of doing so, but how can you be sure that your requirements are used and even understood when it comes time to develop the software? Behavior Driven Development (BDD) does just that. It is a collaboration technique with business partners to discover details and more scenarios when refining requirements. BDD consists of discovering details through structured examples, formulating the examples into a common format, and then automating a select subset of examples through tools. BDD can be used effectively to drive requirements from a business perspective directly into acceptance test which can be used to drive or verify the correctness of developed code.

chuck suscheck

October 17, 2018
Tweet

More Decks by chuck suscheck

Other Decks in Technology

Transcript

  1. ©1993 – 2018 Scrum.org All Rights Reserved @ScrumDotOrg Dr. Charles

    (Chuck) Suscheck [email protected] 07/09/2018 Behavior Driven Development The Secret to Effective Backlog Refinement
  2. ©1993 – 2018 Scrum.org All Rights Reserved This is me

    PST Developer Doctor Strategist CAT
  3. ©1993 – 2018 Scrum.org All Rights Reserved MAX Technical Training

    delivers a wide variety of customized education solutions in Scrum as well as Scrum.Org certification training and consulting. w w w. m a x t r a i n . c o m | 51 3 - 3 2 2 - 8 8 8 8
  4. ©1993 – 2018 Scrum.org All Rights Reserved What’s the costliest

    problem with software? q Bugs q Users don’t use part of the product q Developers are highly paid q QA takes an unpredictable amount of time q Requirements are misunderstood q Technology is ever changing
  5. ©1993 – 2018 Scrum.org All Rights Reserved 1, 2 Apple

    3, 4 Potato 5, 6 Onion Type of food 1 2 3 4 5 6 7 8 9 10 Start
  6. ©1993 – 2018 Scrum.org All Rights Reserved 1, 2 Actor

    3, 4 Drama show 5, 6 Horror show Related to TV 1 2 3 4 5 6 7 8 9 10 Start
  7. ©1993 – 2018 Scrum.org All Rights Reserved 1, 2 Mountain

    Bike 3, 4 Cargo truck 5, 6 Cruise ship Vehicle 1 2 3 4 5 6 7 8 9 10 Start
  8. ©1993 – 2018 Scrum.org All Rights Reserved 1, 2 Basketball

    3, 4 Home Run 5, 6 World championship game Sports 1 2 3 4 5 6 7 8 9 10 Start
  9. ©1993 – 2018 Scrum.org All Rights Reserved 3, 4 Apple

    5, 6 Potato 1, 2 Onion Type of food 1 2 3 4 5 6 7 8 9 10 Start
  10. ©1993 – 2018 Scrum.org All Rights Reserved 3, 4 Actor

    5, 6 Drama show 1, 2 Horror show Related to TV 1 2 3 4 5 6 7 8 9 10 Start
  11. ©1993 – 2018 Scrum.org All Rights Reserved 3, 4 Mountain

    Bike 5, 6 Cargo truck 1, 2 Cruise ship Vehicle 1 2 3 4 5 6 7 8 9 10 Start
  12. ©1993 – 2018 Scrum.org All Rights Reserved 3, 4 Basketball

    5, 6 Home Run 1, 2 World championship game Sports 1 2 3 4 5 6 7 8 9 10 Start
  13. ©1993 – 2018 Scrum.org All Rights Reserved The application You

    are writing a the blue light special app When people are running the app and connected to the store Wifi, The store can activate a “blue light special” deal message that is active for a pre- determined amount of time The deal can be active for a maximum of 15 minutes The deal message is short - 500 characters
  14. ©1993 – 2018 Scrum.org All Rights Reserved Quick think of

    a story for this application Story As a store advertising manager I want to send out a blue light special to customers connected to the store wifi So they are encouraged to use the store wifi Acceptance criteria Special messages are <= 500 characters Messages only go to connected customers Messages are active a maximum of 15 minutes Title Body As a < role > I want to < do something > So that < I get business value > Acceptance criteria
  15. ©1993 – 2018 Scrum.org All Rights Reserved Write some concrete

    examples When a customer is connected to the wifi they will not receive a blue light message Customer Joe is connected to the store wifi When a blue light special with the message “dog food 15% off” is sent Joe will see the message “dog food 15% off” • Here’s an example • Here’s a concrete example
  16. ©1993 – 2018 Scrum.org All Rights Reserved Write some concrete

    examples When a customer isn’t connected to the wifi they will not receive a blue light message Customer Joe is not connected to the store wifi When a blue light special with the message “dog food 15% off” is sent Joe will not see the message • Here’s an example • Here’s a concrete example
  17. ©1993 – 2018 Scrum.org All Rights Reserved Write some concrete

    examples If a customer becomes connected to the wifi, the customer will receive messages as long as they were sent no more than 15 seconds before the connection occurred A blue light special with the message “dog food 15% off” is sent Customer Joe becomes connected to the store wifi Then Joe will see (ask the PO) • Here’s rule • Here’s a concrete example
  18. ©1993 – 2018 Scrum.org All Rights Reserved Write some concrete

    examples If a customer becomes disconnected to the wifi while receiving a message the message will not be displayed A blue light special with the message “dog food 15% off” is sent Customer Joe becomes disconnected from the wifi while receiving the message Then Joe will see (ask the PO) • Here’s rule • Here’s a concrete example
  19. ©1993 – 2018 Scrum.org All Rights Reserved Other examples to

    consider Does this work with all mobile? Can the message notification be turned off? What if the characters are > 200? What if 2 messages are active and a customer connects?
  20. ©1993 – 2018 Scrum.org All Rights Reserved Why examples are

    appropriate Inductive reasoning moves from specific instances into a generalized conclusion Deductive reasoning moves from generalized principles that are known to be true to a true and specific conclusion. Inductive reasoning is good for drawing conclusions that are not explicitly stated
  21. ©1993 – 2018 Scrum.org All Rights Reserved Pick a story

    Pick acceptance criteria Come up with examples Make new rules Split story or add ACC Purpose is to use examples to make rules
  22. ©1993 – 2018 Scrum.org All Rights Reserved BDD General interpretation

    of BDD Automation (given, when, then + tools)
  23. ©1993 – 2018 Scrum.org All Rights Reserved BDD "BDD practitioners

    explore, discover, define then drive out the desired behavior of software using conversation, concrete examples and automated tests" Matt Wynne, The Cucumber Book Automate Tools Formulate Given, when, then Discover Examples and rules
  24. ©1993 – 2018 Scrum.org All Rights Reserved The components Discovery

    Using examples to drive out story details, acceptance criteria, and new stories Formulation Using the examples to create a standardized (ubiquitous) language Automation Using the ubiquitous language to drive out automated specification verifications (tests)
  25. ©1993 – 2018 Scrum.org All Rights Reserved What to focus

    on in BDD Discover Formulate Automate Discover Formulate Automate Benefits Effort to Enact Discover Formulate Automate Effectiveness for Refinement
  26. ©1993 – 2018 Scrum.org All Rights Reserved Discover Automate Formulate

    Some BDD Tools Gherkin Given, when, then Cucumber/Specflow Regex, datatables, outlines Example Mapping Rules, acceptance criteria
  27. ©1993 – 2018 Scrum.org All Rights Reserved . . .

    . Iterative Product Backlog Refinement 100% Story Title 50% Refined with AC 70% Story Body 25% Refined again 2 sprints sprint ready Sprint Planned Story Format Title: <some title> Body: As a <role> I want <to do something> So that <value> Acceptance Criteria: -Verify that <situation> -Verify that <situation> -Verify that <situation>
  28. ©1993 – 2018 Scrum.org All Rights Reserved Backlog refinement Product

    Backlog refinement is the act of adding detail, estimates, and order to items in the Product Backlog. This is an ongoing process in which the Product Owner and the Development Team collaborate on the details of Product Backlog items. During Product Backlog refinement, items are reviewed and revised. The Scrum Team decides how and when refinement is done.
  29. ©1993 – 2018 Scrum.org All Rights Reserved Acceptance Criteria Acceptance

    Criteria The conditions that a software product must satisfy to be accepted by a user or customer. Rule One of a set of explicit or understood regulations or principles governing conduct within a particular activity or sphere. Acceptance criteria = Type of rule
  30. ©1993 – 2018 Scrum.org All Rights Reserved Developed by Matt

    Wynne https://cucumber.io/blog/2015/12/08/example-mapping-introduction
  31. ©1993 – 2018 Scrum.org All Rights Reserved Rule Rule https://cucumber.io/blog/2018/05/23/your-first-example-mapping-session

    Rule Example Story Question Example Example Example Example Example Example Example Example Story Question Question Question
  32. ©1993 – 2018 Scrum.org All Rights Reserved An alternative format

    for examples Context Action Outcome A blue light special with the message “dog food 15% off” is sent Customer Joe is not connected to the store wifi Joe will see no message
  33. ©1993 – 2018 Scrum.org All Rights Reserved Sounds like GWT

    format, doesn’t it? Given When Then A blue light special with the message “dog food 15% off” is sent Customer Joe is not connected to the store wifi Joe will see no message
  34. ©1993 – 2018 Scrum.org All Rights Reserved Basic Gherkin Syntax

    Given When Then And But * # (Comments) Scenario: Feature: Numbers become an input “quote” makes the string an input
  35. ©1993 – 2018 Scrum.org All Rights Reserved Automated Tests UI

    Acceptance Unit Rough quantity Exploratory Testing
  36. ©1993 – 2018 Scrum.org All Rights Reserved Discover with Examples

    Pick a story Discover Make the test pass Refactor Code Write a failing unit test TDD BDD Convert example into Scenario Formulate Generate Scenario Automate Implement Scenario
  37. ©1993 – 2018 Scrum.org All Rights Reserved Overview of technology

    Feature File Step Def Files Cucumber tool Business Side Implementation Side Junit tests Code Implement Step Def
  38. ©1993 – 2018 Scrum.org All Rights Reserved Stepdef Code @Given("^I

    enter (\\d+) and -?(\\d+)$") public void i_enter_and(int arg1, int arg2) throws Throwable { myCalculator.insertNumber(arg1); myCalculator.insertNumber(arg2); // throw new PendingException(); } @When("^I press \"(w*?)\"$") public void i_press(String arg1) throws Throwable { myCalculator.press(arg1); } @Then("^I will see -?(\\d+)$") public void i_will_see(int arg1) throws Throwable { int result = myCalculator.getResult(); Assert.assertEquals("Test failed", arg1, result); // throw new PendingException(); }
  39. ©1993 – 2018 Scrum.org All Rights Reserved The Secret to

    Effective Backlog Refinement https://speakerdeck.com/ chucksuscheck/bdd-iiba [email protected]
  40. ©1993 – 2018 Scrum.org All Rights Reserved References • Discovery

    by Seb Rose • The Cucumber Book by Wynne and Hellesoy • Cucumber for Java by Rose and Wynne • Cucumber.io • https://cucumber.io/blog/2015/12/08/example-mapping- introduction