How to Write a Great User Story
What is a user story?
A user story represents a small piece of business value that a team can deliver in an iteration. While traditional requirements (like use cases) try to be as detailed as possible, a user story is defined incrementally, in three stages:
The brief description of the need
The conversations that happen during backlog grooming and iteration planning to solidify the details
The tests that confirm the story's satisfactory completion
Well-formed stories will meet the criteria of Bill Wake's INVEST acronym:
Why use user stories?
Keep yourself expressing business value
Avoid introducing detail too early that would prevent design options and inappropriately lock developers into one solution
Avoid the appearance of false completeness and clarity
Get to small enough chunks that invite negotiation and movement in the backlog
Leave the technical functions to the architect, developers, testers, and so on
How do I write user stories?
When getting started with stories, a template can help ensure that you don't inadvertently start writing technical tasks: As a <user type> , I want to <function>, so that <benefit>.
As a consumer, I want shopping cart functionality to easily purchase items online.
As an executive, I want to generate a report to understand which departments need to improve their productivity.
Try to avoid the generic role of User when writing user stories. User stories are about all of the role who interact with the system or who realize some value or benefit from the system. Not all actors are end users. For example, a role could be another system or someone who wants certain functionality in order to buy your product but will never actually use the product. It may be useful to create aggregate roles (such as consumer) and specialized roles (such as browser or frequent shopper).
What size should a user story be?
A story should be small enough to be coded and tested within an iteration—ideally just a few days. When a story is too large, it is called an epic. Backlog items tend to start as epics when they are lower priority. For release planning, epics should be broken down into smaller chunks, but not so small that you have moved into detailed design.
How detailed should a user story be?
A team member can view iteration status.
A team member can view a table of stories with rank, name, size, package, owner, and status.
A team member can click a red button to expand the table to include detail, which lists all the tasks, with rank, name, estimate, owner, status.
A team member can view the iteration's stories and their status with main fields.
A team member can view the current burndown chart on the status page, and can click it for a larger view.
A team member can view or hide the tasks under the stories.
A team member can edit a task from the iteration status page.
When do I add detail?
Acceptance criteria provide the Definition of Done for the story. As details about the story evolve, capture the critical ones as acceptance criteria. The product owner should list as many acceptance criteria as possible in order to clarify the intent of the story. Regardless of how detailed the acceptance criteria are, the team should have a conversation about them and adjust the acceptance criteria to capture the results of the discussion. Once an iteration has begun, testers can formalize acceptance criteria into acceptance tests.
Place the acceptance criteria directly beneath the user story to give team members a consistent experience of a single location to view the complete story. By using bullet points, you can keep each criteria item brief and clear.
Who uses user stories?
Creation: The customer, customer proxy, product owner, and anyone else who identifies a need for the product can contribute user stories.
Ownership and maintenance: The product owner owns the user stories and is responsible for writing, gathering, maintaining, and prioritizing.
Usage: Developers, testers, technical writers use user stories to be able to know what to implement and when they are done. Product owners track overall progress based on the status of the user stories. Management tends to track user stories rolled up to epics or features.
Too formal or too much detail. Product owners with good intentions often try to write extremely detailed user stories. If a team sees a story at iteration planning that looks like an IEEE requirements document, they often assume that all the details are there and will skip the detailed conversation.
Technical tasks masquerading as stories. Much of the power of Agile comes from having a working increment of software at the end of each iteration. If your stories are really just technical tasks, you often do not end up with working software at the end of each iteration, and you lose flexibility in prioritization.
Skipping the conversation. Stories are intentionally vague before iteration planning. If you skip the acceptance criteria conversation, you risk moving in the wrong direction, missing edge cases or overlooking customer needs.
Evolve the backlog
User stories are often large and feature-sized when they are rst added to the backlog. The delivery team, or a representative, provides gross-level estimates to help the product owner rank the backlog.
As the priority of such a feature rises and the functionality is better understood, it can be broken down into smaller stories. Ultimately, these smaller stories will t into a single iteration.
Break stories down
When breaking large stories into smaller stories that t into an iteration, it is important to try to write in layers, for example, like cake slices. That is, the story should require the team to develop a function that includes the GUI or presentation layer, the business or logic layer, and the data or persistence layer. This is referred to as 'vertical slicing' . When we 'slice the cake' we are getting the top layer of frosting, the layers that make up the cake, the lling between layers, and when applicable, the bottom most layer of the cake - such as the crust.
Developers' instincts are to develop layer by layer. However, multiple tables unconnected to methods or GUI does not constitute potentially shippable code. Such stories will deliver no value, however small. This is referred to as 'horizontal slicing'.
When we develop in vertical cake slices, even for a thin piece of functionality that is not in itself very valuable, there is an opportunity to learn from feedback. If we can demonstrate even a small amount of the logic or GUI, we can determine if we are satisfying our customer.