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.

Modeling Requirements Using Examples

3,261 views

Published on

Agile Requirements are lightweight by design, so what can you do as the BA to convey requirements in a concise yet comprehensive way? How can you include real examples in your requirements to increase clarity and reduce ambiguity when working with your team?

In this presentation, Rebecca Halstead shares how to incorporate examples in your requirements as a way to encourage collaboration and build a shared understanding about the acceptance criteria. Rebecca delivered this presentation on Agile Requirements at the International Institute of Business Analysis, DC Chapter meeting on March 20, 2014.

Published in: Technology

Modeling Requirements Using Examples

  1. 1. Agile Requirements How to Model Lightweight Requirements using Examples 1
  2. 2. Speaker Bio 2 • Excella Business Analysis Center of Excellence Lead • CBAP, PMP, PMI-ACP, CSM, CSPO • President of the IIBA DC Chapter • Contact Information: – rebecca.halstead@excella.com – http://excella.com/people/rebecca- halstead.aspx
  3. 3. • Specification by Example • Executable Specifications • Scenarios • Automated Acceptance Tests (AAT) • Behavior Driven Development (BDD) • Acceptance Test Driven Development (AATDD) • Gherkin Syntax Today’s Topic 3 Requirements using Examples
  4. 4. Tooling Documentation Collaboration Three Elements of this Technique 4
  5. 5. Building in Quality 5 Plan Collaborate Deliver Build the right thing Build the thing right
  6. 6. Characteristics of “good” requirements 6
  7. 7. Communicating Requirements 7
  8. 8. Level of Documentation 8
  9. 9. • Using Examples: – Makes abstract concepts more relatable – Minimizes misinterpretation – Highlights success, alternative and exception cases How do you specify the right amount? 9
  10. 10. Optimism Bias 10
  11. 11. An Example of Using an Example…
  12. 12. Developing examples 12 1. Feature 2. User Story 3. Collaborate 4. Scenarios 5. Examples
  13. 13. How it all relates 13
  14. 14. Background: You are developing an online ordering website for a local company that grows, harvests and sells botanicals directly to customers. Feature: Calculate customer order Feature 14 1. Feature 2. User Story 3. Collaborate 4. Scenarios 5. Examples
  15. 15. Calculate Order Feature 15
  16. 16. User Story: As a customer, I want to review shipping costs in my shopping cart before checking out, so that I can see if I will receive free shipping. User Story 16 1. Feature 2. User Story 3. Collaborate 4. Scenarios 5. Examples
  17. 17. Collaborate 17 How do I describe what I want? How do I validate that this work is done? How do I code this feature? What are the details of this feature? 1. Feature 2. User Story 3. Collaborate 4. Scenarios 5. Examples
  18. 18. What is Gherkin? 18
  19. 19. Scenario: Standard Shipping Rate Given I am a customer And my order amount is $49.99 When I view my cart Then I see that shipping costs are $3.99 Scenarios 19 1. Feature 2. User Story 3. Collaborate 4. Scenarios 5. Examples
  20. 20. Scenario: Free Shipping Rate Given I am a customer And my order amount is $50.00 When I view my cart Then I see no shipping costs Scenarios 20 1. Feature 2. User Story 3. Collaborate 4. Scenarios 5. Examples
  21. 21. Scenario Outline: Shipping Rate Given I am a customer And my order amount is “<order_total>” When I view my cart Then I see the “<shipping_cost>” Scenarios 21 1. Feature 2. User Story 3. Collaborate 4. Scenarios 5. Examples
  22. 22. Examples: Examples 22 order_total shipping_cost $12.79 $3.99 $49.99 $3.99 $50.00 $0.00 $250.00 $0.00 1. Feature 2. User Story 3. Collaborate 4. Scenarios 5. Examples
  23. 23. Alternate Method 23 Story As a customer, I want to review shipping costs in my shopping cart before checking out, so that I can see if I will receive free shipping. Scenario Customer adds less than $50.00 worth of botanicals to his cart. Business Rule Standard shipping for orders under $50.00 and free for orders over $50.00. GIVEN Precondition(s) Order amount: $49.99 Fixed Data Product Id: 12299 Quantity: 3 WHEN Action View cart Input Data THEN Output Data Shipping cost = $3.99 Postcondition Shipping rate determined Based on examples from: http://ebgconsulting.com
  24. 24. Feature: Application Access Scenario: User with valid credentials Imperative (Narrative) GIVEN I am an unauthenticated user AND I am on the login page AND I enter a valid name in the Name field AND I enter the corresponding password in the Password field WHEN I select the Login button THEN I should see the welcome page Imperative Style… 24 Implementation Detail – what if decide to use Token-based authentication or single sign-on? UI Detail – what if the user interface changes and you select name from a drop-down list or select a radio button?
  25. 25. Feature: Application Access Scenario: User with valid credentials Declarative (Informative) GIVEN I am an unauthenticated user AND I am on the login page WHEN I submit valid credentials THEN I should see the welcome page Declarative Style… 25
  26. 26. Feature: Application Access Scenario: User with valid credentials Side-by-side Comparison 26 Imperative (Narrative) Declarative (Informative) GIVEN I am an unauthenticated user AND I am on the login page AND I enter a valid name in the Name field AND I enter the corresponding password in the Password field WHEN I select the Login button THEN I should see the welcome page GIVEN I am an unauthenticated user AND I am on the login page WHEN I submit valid credentials THEN I should see the welcome page
  27. 27. —If the user interface is constantly changing, it is better to use imperative. —Declarative is easier to maintain. —Developers prefer the imperative style. —If a stakeholder is concerned about the user’s interaction experience, use imperative. —Declarative specifies implementation details. Myth or Fact? 27
  28. 28. • Make each line of the acceptance criteria stand on its own • Use active voice, not passive • Have a single action trigger the expected behavior (WHEN condition) • Use parameters to allow concise expression of examples Guidelines 28
  29. 29. Exercise #1
  30. 30. Okay Example: GIVEN an active user with valid credentials and that user has previously submitted a ticket WHEN that user finds a previously submitted ticket in an active status THEN that user has the option of sending a message Better Example: GIVEN I am an active user with valid credentials AND I previously submitted a ticket AND the ticket is in an active status WHEN I find a previously submitted ticket THEN I should see an option for sending a message Exercise #1, Scenario 1 30
  31. 31. Okay Example: GIVEN I am an unregistered user WHEN I enter username “jsmith” and password “secret123!” THEN I see a profile successfully created message on the Welcome page Better Example: GIVEN I am an unregistered user WHEN I successfully create a user profile THEN I see a profile successfully created message on the Welcome page Exercise #1, Scenario 2 31
  32. 32. Okay Example: GIVEN I add three items costing $5.25 each to my shopping cart AND I am shipping to VA WHEN I view my shopping cart THEN I see an order total of $20.69 Better Example: GIVEN I add these items to my shopping cart: | item_id | quantity | price | 10000 | 2 | $2.49 | 29901 | 1 | $11.98 AND I am shipping to “<state>” WHEN I view my shopping cart THEN I see an order total of “<order_total>” Exercise #1, Scenario 3 32
  33. 33. Exercise #2
  34. 34. Exercise #2 34 Product Name: CoffeeSpot Mobile Application Vision: The CoffeeSpot application allows customers to request a spot to decrease wait time at a specified location. It allows administrators to provide an alternate work location to the remote workforce while minimizing unclaimed inventory. Personas Big Picture Product Details Joe Cupps (Administrator) Indicate Available Spots Show Available Spots Track Usage Details Claim Spot View Usage Details Release Spot Lisa Java (Customer)
  35. 35. To automate or not to automate…
  36. 36. ACCEPTANCE TESTS End-to-end system tests INTEGRATION TESTS Tests that verify integrated components or subsystems UNIT TESTS Tests that verify components in isolation Test Pyramid 36 Exploratory Testing Adapted from: https://www.ibm.com/developerworks/library/j-aopwork11/
  37. 37. • Consistency makes it easier to automate • BAs need to continue to own acceptance tests • Involve developers early • Use a Gherkin editor • Automate an end-to-end user journey Tips for Automation 37
  38. 38. • Automated acceptance tests does not mean no manual testing • Business users find G-W-T difficult to understand • No all Product Owners see the value in automation • Factor in reduced team capacity due to instrumenting the tests • Automate by user journeys • Provide BAs with a tool for maintaining Lessons Learned 38
  39. 39. Books • Gojko Adzic, Specification by Example: How Successful Teams Deliver the Right Software • Mario Cardinal, Executable Specifications with Scrum: A Practical Guide to Agile Requirements Discovery Blogs • http://ebgconsulting.com/blog • http://dannorth.net • http://watirmelon.com/ • http://gojko.net/ Want to learn more? 39
  40. 40. Benefits of Failure: http://www.ted.com/talks/tim_harford Optimism Bias: http://www.ted.com/talks/tali_sharot_the_optimism_bias Gherkin Syntax: http://docs.behat.org/guides/1.gherkin.html http://www.concordion.org/Technique.html Expert Panel: http://www.infoq.com/articles/virtual-panel-bdd More resources 40
  41. 41. • Advanced Certified Scrum Product Owner (CSPO) – Agile Business Analysis (BA) 3/31/14 9AM - 4/1/14 5PM – Discount Code: IIBADC • Certified ScrumMaster (CSM) Training 4/23/14 9AM - 4/24/14 5PM • Advanced Certified Scrum Product Owner (CSPO) 4/28/14 9AM - 4/29/14 5PM For more details: http://www.eventbrite.com/o/excella-consulting- 2232953017 Excella Agile Courses 41

×