Writing Complete User StoriesUser stories can make requirements management a lot easier. They shift some of the communication from up-front documentation to ongoing dialog. That’s the main reason they work so well for agile teams. And agile teams focus on “what’s next?” instead of an ever-changing “what’s everything?” The problem is, when those conversations are working well, it is easy to forget to make sure that what you’ve done is actually enough. Add a small dose of traceability, and you can easily validate the completeness of your user stories. Three Big User Story ProblemsOver the last few years, Alistair Cockburn surveyed a range of teams and identified that they all were facing a similar set of problems. Alistair proposed using use cases to solve those problems. The following list of problems is Alistair’s:
We agreed then (and still do) that well developed use cases can be used to address these issues. Since then, however, we’ve done more analysis of how and when to create use cases and when to create user stories. The primary drivers of the use case versus user story decision still apply, and should still sometimes point you to creating user stories. Without the context of goals, and without a notion of completeness, your team just has a haphazhard stack of stories. Not only will this reduce their motivation, but it will introduce frustration both for the implementation team and the stakeholders – no one will really know when the job is done. Validating the completness of user stories will allow you to know (and regularly revisit) when you should be done. When you are creating user stories, you need to be able to address the issues Cockburn identified. You can do that with traceability, and a very small amount of additional documentation. User Story MetadataThe cool thing about a well-written user story is that it already has metadata within it that makes tracing very easy. A well-written user story, using a format based on the work of Mike Cohn (in User Stories Applied), would read: As a [role], I want to [do something] [with some frequency] so that I can/will [achieve some goal]. If you were to build a UML Class Diagram to show the relationships that are implicit in a user story, you would get something that looks like the following:
This is what makes things pretty exciting – all of that information is already there, and in your user story. All you have to do now is leverage it. Goals and User StoriesThe following diagram shows how a use case exists to enable the achievement of a goal. A user story can exist in the same way, just replacing the use case. If you want to do a deeper dive into how interaction design and structured requirements work together, you can use the following model instead: Note that the diagram above introduces a couple additional concepts. The first additional concept is the practical goal – what the persona is attempting to do because it is the manifestation of a corporate goal. ”Take an order quickly” is the practical goal that manifests the corporate goal of “Reduce time required to take orders.” The second concept is that of a scenario. A scenario is an amalgam of user stories (or use cases) that collectively allow the persona to achieve the practical goal. We already represent this without introducing the scenario concept by acknowledging that a single goal is mapped to multiple user stories. The common element in both approaches is a strong tie between goals and user stories. Focusing on this aspect, you can visualize the relationship as follows: Note that the acceptance criteria for each user story are called out (so that you can confirm that a user story is “done” and “done well”). Each goal is achieved by enabling one or more user stories, such that the acceptance criteria are met. This is the crux of it, so I’ll write it again, but in bold for the busy people who scan this article. Each goal is achieved by enabling one or more user stories, such that the acceptance criteria are met. Note also that multiple goals can be supported by the same user story. Validating CompletenessThe important question that many developers (agile or otherwise) can not answer about their project is “If we do [everything we've been asked to do] will we meet our goals?” This is either a failure in communication of context, or a failure to validate completeness of the requirements. You have to flip things around and ask “If only these user stories are implemented, will the goal(s) be achieved?” This is the same process used to validate completeness of use cases – just applied to user stories [Ed: that completeness-validation article was written 3 years ago today. That's 28 years ago in internet time]. Incremental OverheadEach user story already identifies the goal(s) it is supporting. The incremental overhead is to recognize that this is “a backwards view” of goal satisfaction and create a simple table that shows the “forward view.” You are creating traceability from each goal to each of its supporting user stories – but you’re doing it with a simple table (or list, or tree, or whatever). You don’t have to manage your requirements in some big messy repository. If you’re using index cards, consider getting some brightly colored sticky-dots, number them for each goal, and stick them on the index cards to show the relationship. Then ask the question, for each goal, “Will this goal be achieved if all of the traced user stories (and no other stories) are completed, such that the acceptance criteria are met?” An added benefit of this simple document is that it markedly improves your engagement with internal stakeholders. You’ve created another opportunity for them to influence the scope of delivery. These stakeholders can identify user stories that don’t map to any goals (you can drop those stories), and by identifying incomplete support, you can collaborate to make sure the missing user stories are identified. The task of updating stakeholders about progress and managing stakeholder expectations just got much easier – because you can report progress in the context of completed user stories (and therefore manifested goals). Reviewing Cockburn’s IssuesDoes this approach address Cockburn’s issues (listed at the start of this article)?
ConclusionThere is value in being able to document requirements with either user stories or use cases as circumstances dictate. Cockburn identified issues that teams face when dealing with decoupled user stories. His approach of leveraging use cases to solve the issues is perfectly valid. The approach outlined above, tracing user stories, also addresses the issues. As a product manager or business analyst, you need to be able to address the very real issues with either documentation approach. |
|