80
Amir Barylko MavenThought Inc. AGILE REQUIREMENTS

Agile requirements

Embed Size (px)

DESCRIPTION

Presentation done at CodePalousa 2014 about gathering requirements using User Stories and Scenarios for estimation

Citation preview

Page 1: Agile requirements

Amir Barylko MavenThought Inc.

AGILE REQUIREMENTS

Page 2: Agile requirements

Amir Barylko MavenThought Inc.

HIGH QUALITYREQUIREMENTS

Page 3: Agile requirements

Amir Barylko MavenThought Inc.

WHAT’S THE GOAL?

• (good question)

Page 4: Agile requirements

Amir Barylko MavenThought Inc.

TECHNIQUES

• Verbally

• Use Cases

• Prototyping

• User Stories

Page 5: Agile requirements

Amir Barylko MavenThought Inc.

COMPLEXITY

• Task Breakdown

• Story points

• Planning poker

• Throw a dice?

Page 6: Agile requirements

Amir Barylko MavenThought Inc.

PLANNING

• Gantt Chart

• Sprints for releases

• Continuos release

• Story Mapping

• A mix of those

Page 7: Agile requirements

Amir Barylko MavenThought Inc.

COMMON PROBLEMS

• (Your input here)

Page 8: Agile requirements

MavenThought Inc.User Stories

CAPTURING REQUIREMENTS

Page 9: Agile requirements

MavenThought Inc.User Stories

Post-It&

Sharpie!MOVIE LIBRARY SITE

•Context:• Donald likes to watch movies and tell his friends about it. He

uses a site that helps him to find movies (old, new, etc), rate them and share with others.

• He also enjoys the previews and loves to hear when his “favorites” movies are playing in theaters.

•Write a list of interesting things the site could have to provide value for someone like Donald.

Page 10: Agile requirements

User Stories MavenThought Inc.

WHY USER STORIES?•Focused on what not how

•Based on what you expect

•Manage scope (light weight)

•Don’t include many details

•They can be estimated

Page 11: Agile requirements

User Stories MavenThought Inc.

WHAT’S THE DIFFERENCE?•Capture user stories (features) to fill our backlog

•Don’t include any details

•Only a vague idea of what it should do

•It should fit in a card

•It’s not a contract

Page 12: Agile requirements

User Stories MavenThought Inc.

PLACEHOLDER FORCONVERSATION

•Documents are not a great tool for common understanding, so we tell stories

•They spark a conversation (that’s the key)

•The story records/reminds of that conversation

•They should be created with the stakeholder/owner

Page 13: Agile requirements

MavenThought Inc.User Stories

WRITING USER STORIES

Page 14: Agile requirements

User Stories MavenThought Inc.

FORMAT•As a [ROLE], I want to [ACTION], so I can [GOAL]

As a UserI want to register the movies I’ve seenSo I can show them to my friends

Who What Why

Page 15: Agile requirements

User Stories MavenThought Inc.

FORMAT II• In order to [GOAL], as a [ROLE], I want to [ACTION]

In order to show the movies I’ve seen to othersAs a UserI want to register them into the catalog

Who WhatWhy

Page 16: Agile requirements

User Stories MavenThought Inc.

INVEST GUIDELINE• Independent

• Negotiable

• Valuable

• Estimable

• Small

• Testable

Page 17: Agile requirements

User Stories MavenThought Inc.

INVEST - INDEPENDENT• One user story should be independent of another (as much as

possible). Dependencies between stories make planning, prioritization, and estimation much more difficult.

• As a User, I want to see a dashboard with new movies, my favorites and my friends movies

• As a User, I want to see new movies• As a User, I want to see my favorites• As a User, I want to see my friend’s movies

Page 18: Agile requirements

User Stories MavenThought Inc.

INVEST - NEGOTIABLE• The "Card" of the story is just a short description of the story

which do not include details. The details are worked out during the "Conversation" phase.

• As a User, I want to rate movies comparing director, actors, popularity, social aspect, etc

• As a User, I want to rate movies• As a User, I want to include actors and directors in

the reviews

Page 19: Agile requirements

User Stories MavenThought Inc.

INVEST - VALUABLE• Each story has to be of value to the customer (either the user or

the purchaser). One very good way of making stories valuable is to get the customer to write them.

• As a Developer, I want use a NoSQL db to store movies

• As a developer I want to use Twitter Bootstrap for the UI

• As a User, I want to register movies

Page 20: Agile requirements

User Stories MavenThought Inc.

INVEST - ESTIMABLE• The developers need to be able to (relative) estimate (at a

ballpark even) a user story to allow prioritization and planning of the story.

• As a User, I want to have the most secure site

• As a Reviews, I want to be the only one that sees my private reviews

Page 21: Agile requirements

User Stories MavenThought Inc.

INVEST - SMALL• The stories should be implemented in a “small” amount of time,

otherwise they are too big and should be broken down.

• As a User I want to get statistics about movies

• As a User, I want to see the top 5 searched movies

Page 22: Agile requirements

User Stories MavenThought Inc.

INVEST - TESTABLE• Each story should include the acceptance criteria that indicates the

story is implemented as expected. The owner should participate and define this criteria.

• The movie site should be easy to use

• Given I am in the home page• When I start typing in the search box• Then the auto complete should help me

Page 23: Agile requirements

User Stories MavenThought Inc.

NON FUNCTIONAL•How do we write them?

•Write tests

•Create a checklist (should be a test)

• If possible, write it as story

Page 24: Agile requirements

User Stories MavenThought Inc.

DETAILS• When’s the right time to add details?

• Avoid adding too many details until the story is prioritized to be next

• When doing Analysis, then the story gets defined

• Acceptance tests should be included at that point

• If its too big, should be split up

Page 25: Agile requirements

MavenThought Inc.User Stories

Post-It&

Sharpie!MOVIE LIBRARY SITE II

•Rewrite your statements as user stories using format I or II• As a [ROLE], I want to [ACTION], so I can [GOAL]

• In order to [GOAL], as a [ROLE], I want to [ACTION]

•Compare with your team

•General Discussion

Page 26: Agile requirements

Scenarios & Estimation MavenThought Inc.

SCENARIOS

Page 27: Agile requirements

Scenarios & Estimation MavenThought Inc.

WRITING SCENARIOS

•Each story can be described•As a sequence of steps•We call the alternatives in the flow scenarios

Page 28: Agile requirements

Scenarios & Estimation MavenThought Inc.

COMMON LANGUAGE

•How do we write scenarios?•Free form may be to confusing,•A tight syntax may be to restricting

Page 29: Agile requirements

Scenarios & Estimation MavenThought Inc.

GHERKIN DSL

•Business readable DSL

•Flush out requirements

•Automated testing

•Used by Cucumber, SpecFlow, jBehave

Page 30: Agile requirements

Scenarios & Estimation MavenThought Inc.

SCENARIOS

Scenario: List all movies Given I'm logged in And I have (some data loaded) When I (do some action) Then I (should see expected results)

Step 1

Step 2

Step 3

Step 4

Page 31: Agile requirements

Scenarios & Estimation MavenThought Inc.

EXAMPLE

Scenario: Write a review for a movie Given I'm logged in as a Critic When I write a review for a movie Then I should see the new review in the reviews section for the movie

Page 32: Agile requirements

Scenarios & Estimation MavenThought Inc.

EXAMPLE II

Scenario: See most recent movies first Given I'm logged in as a User When I order the list by release date Then I should see the movies with the release date most recent first

Page 33: Agile requirements

Scenarios & Estimation MavenThought Inc.

EXCERCISE

•Write a story and scenarios•for user login using•Given, When, Then

•And, But

Post-It&

Sharpie!

Page 34: Agile requirements

Amir Barylko MavenThought Inc.

GUIDELINES & GOALS

Page 35: Agile requirements

Amir Barylko MavenThought Inc.

?????

Scenario: Perfect world Given the application is setup When I want to use some projects Then I should be able to load data And have a great user experience but no bugs should appear

Page 36: Agile requirements

Amir Barylko MavenThought Inc.

?????

Scenario: Redirect user to originally requested page Given a User "dave" exists with password "secret" And I am not logged in When I navigate to the home page Then I am redirected to the login form When I fill in "Username" with "dave" And I fill in "Password" with "secret" And I press "Login"

Page 37: Agile requirements

Amir Barylko MavenThought Inc.

DESCRIPTIVE STYLE

Scenario: List all projects Given I'm logged in And I have some projects stored When I list the projects Then I should see all of them

Page 38: Agile requirements

Amir Barylko MavenThought Inc.

DISCOVER COMPLEXITY

• How many scenarios per feature?

• The more scenarios the more complex

• The more steps the more complex

• If scenarios are unclear, then is time to rethink the feature

Page 39: Agile requirements

Amir Barylko MavenThought Inc.

DISCOVER FUNCTIONALITY

• When is the right time to write scenarios?

• During Inception?

• During Analysis?

• During Development?

• During QA?

Page 40: Agile requirements

Amir Barylko MavenThought Inc.

SCENARIO ORDER

• What happens with dependencies?

• How do I use data if I haven’t implemented that feature?

• Can devs work independently in different scenarios?

Page 41: Agile requirements

Amir Barylko MavenThought Inc.

VOTING APP

•In teams•Choose top three user stories•Write scenarios•Share with the other teams

Post-It&

Sharpie!

Page 42: Agile requirements

Scenarios & Estimation MavenThought Inc.

ESTIMATINGUSING SCENARIOS

Page 43: Agile requirements

Scenarios & Estimation MavenThought Inc.

DISCOVER FUNCTIONALITY

•When is the right time to write scenarios?

•During Inception?

•During Analysis?

•During Development?

•During QA?

Page 44: Agile requirements

Scenarios & Estimation MavenThought Inc.

ORDER MATTERS

•Can every feature be independent?

Page 45: Agile requirements

Scenarios & Estimation MavenThought Inc.

SIZE MATTERS

•Not every story is the same size

Page 46: Agile requirements

Scenarios & Estimation MavenThought Inc.

COMPLEXITY ∝ AMOUNT

0

1

2

4

5

6

7

Simple Medium Complex WTF?

Sce

nari

os

Complexity

Page 47: Agile requirements

Scenarios & Estimation MavenThought Inc.

COMPLEXITY ∝ CLARITY

•Too many steps•Takes more than 5 minutes to write•You read it the next day and have no clue what it means

Page 48: Agile requirements

Scenarios & Estimation MavenThought Inc.

RECIPE - STEP #1

Make every story around the same size

•One or two scenarios most•If more, break it down to more stories

Page 49: Agile requirements

Scenarios & Estimation MavenThought Inc.

RECIPE - STEP #2

Put a time limit (days) to each feature•For example: A story has to be completed in 1 or two days at most

Page 50: Agile requirements

Scenarios & Estimation MavenThought Inc.

RECIPE - STEP #3

Choose the simplest story to flush out requirements and implementation•For example: User & password login, OAuth will come later

Page 51: Agile requirements

Story Mapping MavenThought Inc.

USER STORY MAPPING

Page 52: Agile requirements

Story Mapping MavenThought Inc.

User Story Mapping is an approach to

Organizing and Prioritizing user stories

Page 53: Agile requirements

Story Mapping MavenThought Inc.

STORY MAP VS BACKLOG•Clearly identifies value•Track finished stories•Helps prioritize stories•Separate stories in releases easily

Page 54: Agile requirements

Story Mapping MavenThought Inc.

Page 55: Agile requirements

Story Mapping MavenThought Inc.

Release 1

Release 2

Release 3

ManageEmail

ManageContacts

WriteEmail

ReadEmail

DeleteEmail

ManageCalendar

CreateContact

ListContacts

DeleteContact

EditContact

ViewAppt.

CreateAppt.

PlainText

HTML

Mark-down

Attach-ments

BasicRender

Deleteone by

one

Deletemultiple

AutoSpam

Page 56: Agile requirements

Story Mapping MavenThought Inc.

Release 1

Release 2

Release 3

User Activities

User Tasks

User Stories

User Stories

User Stories

Page 57: Agile requirements

Story Mapping MavenThought Inc.

Priority

Time

Release 1

Release 2

Release 3

Page 58: Agile requirements

Story Mapping MavenThought Inc.

The first releaserepresents

the minimum viablerelease

Page 59: Agile requirements

Story Mapping MavenThought Inc.

BUDGETTIME

SCOPE

Fixed

Fixed

?????

Page 60: Agile requirements

Story Mapping MavenThought Inc.

Better to have 80% 100% done

Than 100% 80% done

Page 61: Agile requirements

Amir Barylko MavenThought Inc.

NARROWING THE GAP

Page 62: Agile requirements

Amir Barylko MavenThought Inc.

ACCEPTANCE CRITERIA

•Write the expected criteria before the implementation starts

•Developers will implement the feature until the criteria is satisfied

•QA will validate against the same criteria

Page 63: Agile requirements

Amir Barylko MavenThought Inc.

BENEFITS

•Discover the feature

•Testing all the way

•Traceability

•Quality every step of the process

Page 64: Agile requirements

Amir Barylko MavenThought Inc.

ROLES

•Who writes the feature?

•Who implements the feature?

•Who validates the feature?

•What’s the role of QA, PM, etc?

Page 65: Agile requirements

Amir Barylko MavenThought Inc.

OUTSIDE IN APPROACH

Page 66: Agile requirements

Amir Barylko MavenThought Inc.

RUNNABLE FEATURES

•Features describe functionality

•What if we could run them?

•Then features would validate functionality

•Becoming live documentation

Page 67: Agile requirements

Amir Barylko MavenThought Inc.

TOOLS GALORE

• Lots of tools available that use Gherkin:

• Cucumber / rSpec

• jBehave

• Specflow

• Scalatest

• etc

Page 68: Agile requirements

Amir Barylko MavenThought Inc.

WHERE SHOULD THEY GO?

•Acceptance tests?•Integration tests?•Unit tests?

Page 69: Agile requirements

Amir Barylko MavenThought Inc.

ACCEPTANCE TEST

•Black box testing•Crossing all layers•Should cover all scenarios•External subsystems may be mocked

Page 70: Agile requirements

Amir Barylko MavenThought Inc.

INTEGRATION TEST

•More than one class•Still some parts can be mocked•Partial functionality of subsystem

Page 71: Agile requirements

Amir Barylko MavenThought Inc.

UNIT TEST

•Test for a class or method

•No external dependencies

•Small

•Clear

Page 72: Agile requirements

Amir Barylko MavenThought Inc.

TDD

•First write a test that fails (RED)

•Write code to make it pass (GREEN)

•Check if code can be improved (REFACTOR)

•Start again until it’s done

Page 73: Agile requirements

Amir Barylko MavenThought Inc.

WHEN TDD IS NOT ENOUGH

•Legacy Code•Refactoring is not viable•Verify functionality across layers•Validate feature end to end

Page 74: Agile requirements

Amir Barylko MavenThought Inc.

DEMO

Page 75: Agile requirements

Amir Barylko MavenThought Inc.

SUMMARYBenefits

ChallengesWhat’s next?

Page 76: Agile requirements

Amir Barylko MavenThought Inc.

BENEFITS

•Easier planning

•Discovers functionality and complexity

•No particular skill required

•Easy Adoption

•Puts the whole team on the same page

•Simplifies QA process

•Narrows the gap between expectations and actual implementation

Page 77: Agile requirements

Amir Barylko MavenThought Inc.

CHALLENGES

•Different approach

•The roles get blurred

•Team effort

•Others?

Page 78: Agile requirements

Amir Barylko MavenThought Inc.

WHAT’S NEXT

• Take one idea/technique that you think could be beneficial

• Use the next four weeks to implement it

• Register challenges, issues and results

• Share with your peers (and with me if possible)

Page 79: Agile requirements

Amir Barylko MavenThought Inc.

QUESTIONS?

Page 80: Agile requirements

Amir Barylko MavenThought Inc.

RESOURCES

• Contact me: [email protected], @abarylko

• Download: http://www.orthocoders.com/presentations