modeling requirements using examples

41
Agile Requirements How to Model Lightweight Requirements using Examples 1

Upload: excella-consulting

Post on 12-May-2015

1.473 views

Category:

Technology


1 download

DESCRIPTION

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.

TRANSCRIPT

Page 1: Modeling Requirements Using Examples

Agile RequirementsHow to Model Lightweight Requirements using Examples

1

Page 2: Modeling Requirements Using Examples

Speaker Bio

2

• Excella Business Analysis Center of Excellence Lead

• CBAP, PMP, PMI-ACP, CSM, CSPO

• President of the IIBA DC Chapter

•  Contact Information:– [email protected]– http://excella.com/people/rebecca-

halstead.aspx

Page 3: Modeling Requirements Using Examples

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

Requirements using Examples

Page 4: Modeling Requirements Using Examples

4

Tooling

Documentation

Collaboration

Three Elements of this Technique

Page 5: Modeling Requirements Using Examples

5

Building in Quality

Plan Collaborate Deliver

Build the right thing

Build the thing right

Page 6: Modeling Requirements Using Examples

6

Characteristics of “good” requirements

Page 7: Modeling Requirements Using Examples

7

Communicating Requirements

Page 8: Modeling Requirements Using Examples

8

Level of Documentation

Page 9: Modeling Requirements Using Examples

9

• Using Examples:– Makes abstract

concepts more relatable

– Minimizes misinterpretation

– Highlights success, alternative and exception cases

How do you specify the right amount?

Page 10: Modeling Requirements Using Examples

10

Optimism Bias

Page 11: Modeling Requirements Using Examples

An Example of Using an Example…

Page 12: Modeling Requirements Using Examples

12

Developing examples

1. Feature 2. User Story 3. Collaborate 4. Scenarios 5. Examples

Page 13: Modeling Requirements Using Examples

13

How it all relates

Page 14: Modeling Requirements Using Examples

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 1. Feature 2. User Story 3. Collaborate 4. Scenarios 5. Examples

Page 15: Modeling Requirements Using Examples

15

Calculate Order Feature

Page 16: Modeling Requirements Using Examples

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

Stakeholders can rank

Team can estimate

1. Feature 2. User Story 3. Collaborate 4. Scenarios 5. Examples

Page 17: Modeling Requirements Using Examples

17

CollaborateHow 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

Page 18: Modeling Requirements Using Examples

18

What is Gherkin?

Page 19: Modeling Requirements Using Examples

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 1. Feature 2. User Story 3. Collaborate 4. Scenarios 5. Examples

Page 20: Modeling Requirements Using Examples

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 1. Feature 2. User Story 3. Collaborate 4. Scenarios 5. Examples

Page 21: Modeling Requirements Using Examples

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 1. Feature 2. User Story 3. Collaborate 4. Scenarios 5. Examples

Page 22: Modeling Requirements Using Examples

22

Examples:

Examples

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

Page 23: Modeling Requirements Using Examples

23

Alternate MethodStory 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: 12299Quantity: 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

Page 24: Modeling Requirements Using Examples

24

Feature: Application AccessScenario: User with valid credentials

Imperative (Narrative)GIVEN I am an unauthenticated userAND I am on the login pageAND I enter a valid name in the Name fieldAND I enter the corresponding password in the Password fieldWHEN I select the Login buttonTHEN I should see the welcome page

Imperative Style…

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?

Page 25: Modeling Requirements Using Examples

25

Feature: Application AccessScenario: User with valid credentials

Declarative (Informative)GIVEN I am an unauthenticated userAND I am on the login pageWHEN I submit valid credentialsTHEN I should see the welcome page

Declarative Style…

Page 26: Modeling Requirements Using Examples

26

Feature: Application AccessScenario: User with valid credentials

Side-by-side Comparison

Imperative (Narrative) Declarative (Informative)

GIVEN I am an unauthenticated userAND I am on the login pageAND I enter a valid name in the Name fieldAND I enter the corresponding password in the Password fieldWHEN I select the Login buttonTHEN I should see the welcome page

GIVEN I am an unauthenticated userAND I am on the login page

WHEN I submit valid credentialsTHEN I should see the welcome page

Page 27: Modeling Requirements Using Examples

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?

M

F?F

M

Page 28: Modeling Requirements Using Examples

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

Page 29: Modeling Requirements Using Examples

Exercise #1

Page 30: Modeling Requirements Using Examples

30

Okay Example:GIVEN an active user with valid credentials and that user has previously submitted a ticketWHEN that user finds a previously submitted ticket in an active statusTHEN that user has the option of sending a message

Better Example:GIVEN I am an active user with valid credentialsAND I previously submitted a ticketAND the ticket is in an active statusWHEN I find a previously submitted ticketTHEN I should see an option for sending a message

Exercise #1, Scenario 1

Page 31: Modeling Requirements Using Examples

31

Okay Example:GIVEN I am an unregistered userWHEN 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 userWHEN I successfully create a user profileTHEN I see a profile successfully created message on the Welcome page

Exercise #1, Scenario 2

Page 32: Modeling Requirements Using Examples

32

Okay Example:GIVEN I add three items costing $5.25 each to my shopping cartAND I am shipping to VAWHEN I view my shopping cartTHEN 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.98AND I am shipping to “<state>”WHEN I view my shopping cartTHEN I see an order total of “<order_total>”

Exercise #1, Scenario 3

Page 33: Modeling Requirements Using Examples

Exercise #2

Page 34: Modeling Requirements Using Examples

34

Exercise #2

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)

Page 35: Modeling Requirements Using Examples

To automate or not to automate…

Page 36: Modeling Requirements Using Examples

36

INTEGRATION TESTSTests that verify integrated components or subsystems

UNIT TESTSTests that verify components in isolation

Test PyramidExploratory

Testing

Adapted from: https://www.ibm.com/developerworks/library/j-aopwork11/

Page 37: Modeling Requirements Using Examples

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

Page 38: Modeling Requirements Using Examples

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

Page 39: Modeling Requirements Using Examples

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?

Page 41: Modeling Requirements Using Examples

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