I’ve been reading a great book lately called Writing Effective Use Cases by Alastair Cockburn. I won’t go into details about how to write use cases, because the book does a better job of that than I could. One thing that isn’t clear in the book is how use cases relate to user stories. Since the book was published in 2003, user stories have become ubiquitous in sprints and agile culture, but not so much for use cases, which IMO is a shame, because this book has really changed the way I think about writing software.
Use cases are about a sequence of steps that need to happen in order to achieve a goal, and the branches of sub-sequences (i.e. extensions) spawned from something happening that wouldn’t occur in the main success scenario. Serializing these sequences and sub-sequences into use cases is mentally taxing work IMO (as Cockburn also points out in his book). Conversely, user stories, are usually a single sentence that sums up a single goal that an actor wants to achieve. User stories tend to be fairly easy to write; far fewer details are needed to write a user story than a use case.
Essentially, user stories are a specific way of writing a goal. Goals are a necessary component of use cases that can demonstrate the purpose of a use case. User stories also require a subject, which is necessary to elucidate a use case (i.e. the actor).
Given all that, based on my own experience, use cases and user stories relate to each other in the following ways:
- User stories can be used to sum up the Main Success Scenarios of use cases.
- User stories can help identify the primary actors of use cases.
Main success scenarios are really the most critical component of use cases; main success scenarios are the steps to get from the initial state to the goal’s state. How does one sum up a main success scenario into a single sentence? You guessed it: a user story. So, at the start of the sequence of steps in the main success scenario, one can write a user story as a mechanism of summarizing the entire sequence.
One thing that I’ve occasionally had issues visualizing is who the primary actor of a use case actually is. By quickly writing a single sentence user story in the form of “As a whoever, I can do whatever“, one can often identify who the primary actor actually is faster than they otherwise would have.
Hopefully this post helps you to successfully incorporate user stories into your use cases.