DEV Community

Cover image for Use case and user story - friend or foe?
Bertil Muth
Bertil Muth

Posted on

Use case and user story - friend or foe?

Are use cases and user stories the same?
And if not, what are the differences?
Can you combine them in practice?
Should you rather choose a side?

First, they are not the same.

Use cases
Use cases are about describing user interactions with a system in a way that makes the user's goals clear. Users can be humans or other technical systems.

As a customer of an online retailer, it is my goal to buy a book, for example.
Which interaction steps are necessary to reach the goal?
The happy day scenario could look like this:

  1. Find book.
  2. Put book in shopping cart.
  3. Checkout.
  4. Enter address data and payment details.
  5. Confirm purchase.
  6. Show confirmed purchase and send confirmation email.

Depending on the intended use, you can also describe use cases in much greater detail. In particular, of course, a description of the error cases is necessary.

User Stories
User stories are particularly popular in agile development. For the description of user stories, many people use the following template:
As a <role>, I want <system function> so that <benefit for role>

Example: As a customer of an online retailer, I want to read reviews from other customers so that I can decide about the purchase of a book.

What are the differences between use cases and user stories?

  • Traditionally, use cases are often described in great detail to be used as a requirements specification or documentation of system functionality. By contrast, user stories are primarily not used as a tool for documentation, but as a basis for talking personally about requirements.
  • User stories are used as a planning tool. That is, they are sliced until they can be put into a time-boxed iteration. As a result, they are small and compact. But they often lack contextual information compared to use cases.

These differences make it look like comparing apples to oranges: a heavy-weight documentation tool with a lightweight planning tool.
Well-known agilists such as Martin Fowler and Alistair Cockburn speak of use cases and stories as two different practices that are not mutually exclusive.

Use cases or stories can be chosen depending on the purpose. And they are complementary to each other. I agree with that.
But how do you use them together, in a smart way? What is the connection? Unfortunately, you rarely get an answer to this question.

The connection between use cases and user stories
The connection between use cases and stories becomes clear when you add the missing pieces of the puzzle: you supplement use cases with planning aspects and user stories with context aspects. I will give you two examples, surely you will find more in the universe of practices.

  • Ivar Jacobsen's Use Case 2.0 approach uses the term Use Case Slice. Slices serve to plan the implementation of use cases. A slice is essentially a cut through a use case that can be implemented in an iteration. A slice is, like a user story, a planning tool - it can consist of one or more interaction scenarios, or of the whole use case.
  • In agile development, epics are often used as coarse-grained narratives to put fine-grained user stories in context. Deriving user stories from epics can be done by using story maps, for example. Interestingly, these epics are sometimes referred to as activities and are arranged horizontally along a process. Do you recognize the similarity to the happy day scenario described above for a use case?

Combination of use cases and user stories

A combined use of both practices in the agile domain could look like this:

  • The use cases are only roughly described, similar to the example above. Instead of a use case document, you can also use cards.
  • Use case slices are first used as a rough planning tool, e.g. for release planning: which slices should be implemented in Release X?
  • The slices are used to develop epics, for example the epic "Find book".
  • Story maps get you from the epics to the user stories. You can use stories as a detailled planning tool (for iteration planning). For example, there could be a user story customer finds book by searching, and another story for customer finds book on personal recommendation of system.

Users of stories as well as use cases can benefit from a change of perspective. If you like use cases: do you really need to write a document, or would it be sufficient to make a brief list of the steps on a map to understand the context? If you like user stories: are you having trouble understanding the context, and if so, would use cases be a supplement that would help you?

This article was first published on HOOD blog in German.

Top comments (0)