An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... ·...

60
An Introduction to User Stories

Transcript of An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... ·...

Page 1: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

An Introduction toUser Stories

Page 2: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

Founding member and director of Agile Alliance and Scrum AllianceFounder of Mountain

Goat SoftwareRan my first Scrum project back in 1995Typical programmer to

manager etc. progression

Mike Cohn - background

© Mountain Goat Software, LLC

Agile coachand trainer

Page 3: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

• Software requirements is a communication problem

What problem do stories address?

• Those who want the software must communicate with those who will build it

Page 4: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

Balance is critical

• If either side dominates, the business loses

• If the business side dominates…

• …functionality and dates are mandated with little regard for reality or whether the developers understand the requirements

• If the developers dominate…

• …technical jargon replaces the languageof the business and developers lose the opportunity to learn from listening

Page 5: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

Resource allocation

• We need a way of working together so that resource allocation becomes a shared problem

• Project fails when the problem of resource allocation falls too far to one side

Page 6: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

Responsibility for resource allocation

• May trade quality for additional features• May only partially implement a feature• May solely make decisions that should involve the

business side

If developers shoulder the responsibility...

• Lengthy upfront requirements negotiation and signoff

• Features are progressively dropped as the deadline nears

If the business shoulders the responsibility...

Page 7: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

Imperfect schedules

• We cannot perfectly predict a software schedule

• As users see the software, they come up with new ideas

• Too many intangibles

• Developers have a notoriously hard time estimating

• If we can’t perfectly predict a schedule, we can’t perfectly say what will be delivered

Page 8: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

So what do we do?

...but do it oftenWe make decisions

based on the information we have

...we spread decision-making across the project

Rather than making one all-encompassing set of

decisions

This is where user stories

come in

Page 9: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

What Stories Are

Page 10: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

Ron Jeffries’ Three Cs

Card

•Stories are traditionally written on note cards.

•Cards may be annotated with estimates, notes, etc.

Conversation•Details behind the story come

out during conversations with product owner

Confirmation •Acceptance tests confirm the story was coded correctly

Source: XP Magazine 8/30/01, Ron Jeffries.

Page 11: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

Samples from a travel website

As a user, I want to reserve a hotel room.

As a user, I want to cancel a reservation.

As a vacation planner, I want to see photos of the hotels.

As a frequent flyer, I want to rebook a past trip, so that I save time booking trips I take often.

Page 12: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

Where are the details?

• As a user, I can cancel a reservation.

• Does the user get a full or partial refund?

• Is the refund to her credit card or is it site credit?

• How far ahead must the reservation be cancelled?

• Is that the same for all hotels?

• For all site visitors? Can frequent travelers cancel later?

• Is a confirmation provided to the user?

• How?

Page 13: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

Details as conditions of satisfaction

• The product owner’s conditions of satisfaction can be added to a story

• These are essentially tests

As a user, I can cancel a reservation.

Page 14: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

Details as conditions of satisfaction

• The product owner’s conditions of satisfaction can be added to a story

• These are essentially tests

As a user, I can cancel a reservation. Verify that a premium member can

cancel the same day without a fee.Verify that a non-premium member is charged 10% for a same-day cancellation.Verify that an email confirmation is sent.Verify that the hotel is notified of any cancellation.

Page 15: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

Details added in smaller sub-stories

As a user, I can cancel a reservation.

As a premium site member, I can cancel a reservation up to the last minute.

As a non-premium member, I can cancel up to 24 hours in advance.

As a site visitor, I am emailed a confirmation of any cancelled

Page 16: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

Techniques can be combined

• These approaches are not mutually exclusive

• Write stories at an appropriate level

• By the time it’s implemented, each story will have conditions of satisfaction associated with it

Page 17: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

The product backlog iceberg

Sprint

Release

FutureReleases

Priority

Page 18: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

The product backlog iceberg

Sprint

Release

FutureReleases

Priority

Page 19: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

Stories, themes and epicsUser StoryA description of desired functionality told from the perspective of the user or customer.

ThemeA collection of related user stories.

EpicA large user story.

Page 20: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

An example

As a VP Marketing, I want to review the performance of historical promotional campaigns so that I can identify and repeat profitable ones.

As a VP Marketing, I want to select the timeframe to use when reviewing the performance of past promotional campaigns, so that I can identify and repeat profitable ones.

As a VP Marketing, I can select which type of campaigns (direct mail, TV, email, radio, etc.) to include when reviewing the performance of historical promotional campaigns.

Clearly an epic

Epics??

Page 21: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

An exampleAs a VP Marketing, I want to see information on direct mailings when reviewing historical campaigns.

As a VP Marketing, I want to see information on television advertising when reviewing historical campaigns. As a VP Marketing, I want to

see information on email advertising when reviewing historical campaigns.

Page 22: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

Usersand

User Roles

Page 23: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

“The User”

• Many projects mistakenly assume there’s only one user:

• “The user”

• Write all stories from one user’s perspective

• Assume all users have the same goals

• Leads to missing stories

Page 24: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

Common attributes

Frequent flyer who never knows where

she’ll be

A frequent flyer’s assistant; books her

reservations

Wants to schedule her family’s annual

vacation

Hotel chain Vice President; wants to

monitor reservations

Frequent flyer who flies every week but always to the same

place

Page 25: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

Common attributes

Frequent flyer who never knows where

she’ll be

A frequent flyer’s assistant; books her

reservations

Wants to schedule her family’s annual

vacation

Hotel chain Vice President; wants to

monitor reservations

Frequent flyer who flies every week but always to the same

place

Frequent flyer

Page 26: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

Common attributes

Frequent flyer who never knows where

she’ll be

A frequent flyer’s assistant; books her

reservations

Wants to schedule her family’s annual

vacation

Hotel chain Vice President; wants to

monitor reservations

Frequent flyer who flies every week but always to the same

place

Frequent flyer

Repeat Traveler

Page 27: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

Common attributes

Frequent flyer who never knows where

she’ll be

A frequent flyer’s assistant; books her

reservations

Wants to schedule her family’s annual

vacation

Hotel chain Vice President; wants to

monitor reservations

Frequent flyer who flies every week but always to the same

place

Frequent flyer

SchedulerRepeat Traveler

Page 28: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

Common attributes

Frequent flyer who never knows where

she’ll be

A frequent flyer’s assistant; books her

reservations

Wants to schedule her family’s annual

vacation

Hotel chain Vice President; wants to

monitor reservations

Frequent flyer who flies every week but always to the same

place

Frequent flyer

Infrequent Vacation Planner

SchedulerRepeat Traveler

Page 29: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

Common attributes

Frequent flyer who never knows where

she’ll be

A frequent flyer’s assistant; books her

reservations

Wants to schedule her family’s annual

vacation

Hotel chain Vice President; wants to

monitor reservations

Frequent flyer who flies every week but always to the same

place

Frequent flyer

Infrequent Vacation Planner

InsiderSchedulerRepeat Traveler

Page 30: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

User roles

• Broaden the scope from looking at one user

• Allows users to vary by

• What they use the software for

• How they use the software

• Background

• Familiarity with the software / computers

• Used extensively in usage-centered designSource: Software for Use by Constantine and Lockwood (1999).

Page 31: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

System and programmer usersAs the payment verification system, I want all transactions to be well-formed XML.

As a programmer, I want an API for deleting widgets from the database.

Page 32: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

Advantages of using roles

Users become tangible

Start thinking of software as solving needs of real people.

Avoid saying “the user”

Instead we talk about “a frequent flyer” or “a repeat

traveler”

Incorporate roles into stories

“As a <user role>, I want to <goal> so that <benefit>.”

Page 33: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

WritingStories

Page 34: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

A horrible question

• A problem:

• The question is closed

• {Yes | No}

“Would you like it in a browser?”

Page 35: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

A horrible question

• A problem:

• The question is closed

• {Yes | No}

“Of course, now that you mention it!”

“Would you like it in a browser?”

Page 36: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

We can do better

• It’s open

• Full range of answers

• But it has too much context

“What would you think of having this app in a browser rather than as a native

Windows application, even if it means reduced performance, a poorer overall user experience, and less interactivity?”

Page 37: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

A better way to ask

• We want to ask questions that are

• Open-ended

• Context-free

“What would you be willing to give up in order to have it in a browser?”

Page 38: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

“Dad, make it warmer.”

My context isn’t your context

Page 39: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

“Dad, make it warmer.”

My context isn’t your context

You hear “Increase the temperature.”

He meant “Move the temperature closer to what we call warm.”

Page 40: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

It’s my problem, I know the solution

• Having a problem does not uniquely qualify you to solve it

• “It hurts when I go like this…”

Page 41: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

We need to stop asking users

• Since users don’t know how to solve their problems, we need to stop asking

• We need to involve them instead

Empiricaldesign

• Designers of the new system make decisions by studying prospective users in typical situations

Participatory design

• The users of the system become part of the team designing the behavior of the system

Page 42: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

Story-writing workshops

• Includes developers, users, customer, others

• Brainstorm to generate stories

• Goal is to write as many stories as possible

• Some will be “implementation ready”

• Others will be “epics”

• No prioritization at this point

Page 43: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

Start with epics and iterateAs a frequent flyer, I want to see check my account.

As a frequent flyer, I want to ...

Frequent flyer

As a frequent flyer, I want to book a trip.

Page 44: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

Start with epics and iterateAs a frequent flyer, I want to see check my account.

As a frequent flyer, I want to ...

Frequent flyer

As a frequent flyer, I want to book a trip using miles.

As a frequent flyer, I want to rebook a trip I take often.

As a frequent flyer, I want to request an upgrade.

As a frequent flyer, I want to see if my upgrade cleared.

As a frequent flyer, I want to book a trip.

Page 45: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

INVESTin

Good Stories

Page 46: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

What makes a good story?

INVEST

Independent

Negotiable

Valuable

Estimatable

Sized appropriately

TestableThanks to Bill Wake for the acronym. See www.xp123.com.

Page 47: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

Copyright Mountain Goat Software, LLC

INVESTing in good stories• Independent

• Dependenices lead to problems estimating and prioritizing

• Can ideally select a story to work on without pulling in 18 other stories

• Negotiable• Stories are not contracts

• Leave or imply some flexibility

• Valuable

• To users or customers, not developers

• Rewrite (most) developer stories to reflect value to users or customers

Page 48: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

Copyright Mountain Goat Software, LLC

INVESTing in good stories

• Estimatable

• Because plans are based on user stories, we need to be able to estimate them

• Sized Appropriately

• Complex stories are intrinsically large

• Compound stories are multiple stories in one

• Testable

• Stories need to be testable

Page 49: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

Why User Stories

Page 50: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

If requirements are written down

The user will get what she wants

then

Stories shift the focus from writing to talking.

1

Page 51: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

If requirements are written down

The user will get what she wants

then

At best she’ll get what was written

Stories shift the focus from writing to talking.

1

Page 52: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

If requirements are written down

The user will get what she wants

then

At best she’ll get what was written

“You built what I asked for, but it’s not what I need.”

Stories shift the focus from writing to talking.

1

Page 53: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

Words are imprecise

Main dish comes withsoup or salad and bread.

• (Soup or Salad) and Bread• (Soup) or (Salad and Bread)

Page 54: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

Examples

The user can enter a name. It can be 127

characters.

• Must the user enter a name?

• Can it be other than 127 chars?

The system should prominently display a

warning message whenever the user enters invalid data.

• What does should mean?• What does prominently

display mean?• Is invalid data defined

elsewhere?

Page 55: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

Stories are equally understandable by developers and customers.

2

Stories support and encourage iterative development.

3

Stories are the right size for planning.4

Stories support participatory design.5

Page 56: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

Stories emphasize the user’s goals not the system’s attributes.

6

What are we building?1.The product shall have a gas engine.2.The product shall have four wheels.

2.1.The product shall have a rubber tire mounted to each wheel.

3.The product shall have a steering wheel.4.The product shall have a steel body.

Source: Adapted from The Inmates are Running the Asylum by Alan Cooper (1999).

Page 57: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

What if we had stories instead?

As a user, I want to mow my lawn quickly and easily.

As a user, I want to be comfortable while mowing my lawn.

Page 58: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

The product

Page 59: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

Most importantly...

The story text we write on cards is less important than the conversations we have.

Don’t forget the purpose

Page 60: An Introduction to User Stories - Meetupfiles.meetup.com/169191/2007-10-01 Mike Cohn - User... · • The product owner’s conditions of satisfaction can be added to a story •

© Mountain Goat Software, LLC

[email protected]

www.mountaingoatsoftware.com

(720) 890-6110 (office)

(303) 810-2190 (mobile)

Mike Cohn contact info