UML use case diagrams
The diagram for scope, not design. Who uses the system, what they use it for, and where the boundary of the thing you are building actually sits - drawn before a single class exists.
13 min readUML 2.5.111 of 35
The short answer
- A use case diagram is a map of scope: who interacts with the system, what goals they come with, and where the line between inside and outside falls.
- A use case is a goal that delivers something an actor values, not a step or a screen. Actors are roles, and they always sit outside the boundary.
- «include» points from the base to behaviour that always runs; «extend» points from the optional extra back to the base. The directions are opposite and this is what people get wrong.
- The diagram is the table of contents. The deliverable is the use case description behind each ellipse - primary actor, preconditions, main success scenario, extensions, postconditions.
01What it shows, and what it deliberately does not#
A use case diagram is a map of scope. It names the people and systems that interact with what you are building, the goals they come to it with, and the line between inside and outside. That is all it does, and its restraint is the point.
It says nothing about order. Nothing about screens, fields, or algorithms. Nothing about how anything works. Every one of those is a different diagram, and the temptation to smuggle them onto this one is what produces the sprawling, useless use case diagrams that gave the notation a bad reputation.
02Finding the actors and the use cases#
Nobody hands you a list. The diagram above looks obvious once drawn and was not obvious at all beforehand, and the gap between a blank page and that picture is four questions you can ask in a room in twenty minutes.
- Who starts something here?Every one of them is a candidate primary actor. Ask for the role rather than the name - the person who said "I do that" is one holder of a role that will outlast them.
- Who or what receives something without asking? Reports, files, notifications, settlement runs. These are the supporting actors on the right-hand side of the boundary, and they are the half of the diagram most first drafts miss.
- What has to be there for this to work? Payment providers, identity services, the mainframe, a fraud engine. Anything you would raise a ticket with another team about is outside the boundary and belongs on the diagram - drawing it is often the moment somebody realises the dependency was never agreed.
- What happens because time passed? A nightly reconciliation, a fourteen-day expiry, a monthly invoice run. Time is an actor, drawn as a stick figure labelled
ClockorScheduler, and processes that leave it off end up with use cases nobody appears to start.
Then name each goal from the actor's side of the counter, verb first, in their vocabulary: Submit payment, not Payment submission handling and certainly not PaymentController. If the name only makes sense to somebody who has seen the code, it is a step in a use case rather than a use case.
03The four marks#
| Element | Notation | What it means |
|---|---|---|
| Actor | stick figure | A role outside the system - a person, another system, or a clock. A role, not a named individual: Merchant, never Anna. |
| Use case | ellipse | A goal the system delivers, named verb-first. |
| System boundary | rectangle | The subject. Use cases go inside it, actors always outside. Its name is the thing you are building. |
| Association | This actor participates in this use case. No arrowhead needed. | |
| Include | Dashed arrow from the base to the included case. The included behaviour always runs. | |
| Extend | Dashed arrow from the extension to the base. The behaviour runs only sometimes. | |
| Generalization | Hollow triangle at the general one. Works between actors and between use cases. |
04Include and extend, without the confusion#
These two are the reason use case diagrams get drawn wrong. Both are dashed arrows with a keyword, and they point in opposite directions.
«include» points from the base to the thing it always does. Read it as "calls". In the diagram above, Submit payment includes Authorize payment: you cannot submit without authorizing. It exists to factor out behaviour shared by several use cases - which is exactly why Refund payment includes it too.
«extend» points from the optional extra back to the base. Read it as "may interrupt". Log audit trail extends Refund payment: refunds work without it, and it happens under some condition. The base use case does not know its extensions exist.
05Behind the bubble: the use case description#
The diagram is the table of contents. The thing that gets built from is the use case description behind each ellipse - and a project that draws the diagram and never writes the descriptions has produced a picture of work rather than a specification of it. This is the part the notation says nothing about, which is why so many teams stop at the picture.
There are three useful depths, and choosing one is a project decision rather than a modelling one. A brief description is two sentences in the backlog. A casual one is a paragraph per scenario. A fully dressed one has the fields below, and is worth the effort for the handful of use cases that carry real money or real risk.
- Name. The ellipse's label, verb first:
Authorize payment. - Primary actor. Whoever wants the result.
Merchant. - Stakeholders and interests. Who else cares and what they need out of it. The acquirer wants a valid authorization code; the fraud team wants the attempt recorded whether it succeeds or not. This field is where most missed requirements turn up.
- Preconditions. What is already true before the use case starts - the merchant is authenticated, the order exists. Not a list of steps, a list of guarantees.
- Main success scenario. The numbered happy path, actor step then system step, in the language of the business. Somewhere between five and twelve steps; more than that and the use case is really two.
- Extensions. Numbered against the step they branch from - 4a, 4b, 7a - each with its condition and what happens. This is the field that actually earns the format, because it is a systematic prompt for every way the happy path fails.
- Postconditions.What is true afterwards, on success and on each failure. "An authorization is recorded and the funds are held" is testable in a way that "the payment is processed" is not.
Worked small, for Authorize payment: the main success scenario is (1) the merchant submits the payment, (2) the system validates the order total, (3) the system requests authorization from the acquirer, (4) the acquirer returns an approval, (5) the system records the hold and confirms. The extensions are where the work is - 3a the acquirer times out, 4a the acquirer declines, 4b the acquirer requests a step-up challenge - and each of those is a conversation somebody would otherwise have had six weeks later in a defect triage.
06When to draw one#
Reach for it when
- Agreeing scope at the start of a project, with people who do not read code
- Working out which external systems you actually depend on
- Producing a checklist that a test plan or a backlog can be derived from
- Showing that a requirement belongs to somebody else's system, not yours
Reach for something else when
- You want to show a sequence of steps - that is an activity or sequence diagram
- The system has one actor and four use cases; a bulleted list is clearer
- You are tempted to decompose use cases into sub-use-cases three levels deep
- The audience is engineers who need the design, not the scope
A useful use case diagram fits on one page and has somewhere between three and ten ellipses. It is a table of contents, not the book. The detail belongs in use case descriptions - the numbered main flow and its alternatives - or, if the flow is branchy enough to be worth drawing, in an activity diagram per use case.
07Common mistakes#
- Functional decomposition. Twenty ellipses named after buttons. Use cases are goals; if it is not something an actor wants, it does not belong.
- Actors named after people or job titles in your org chart. Model the role. One person can be several actors, and one actor can be a batch job.
«include»and«extend»arrows reversed. They point opposite ways. Apply the removal test above.- Actors inside the boundary. The boundary is what you are building. An actor is by definition outside it.
- Sequencing implied by vertical position. A use case diagram has no time axis. Nothing about the layout says what happens first.
In one line each
- 01Use case diagrams answer who and what for - never how or in what order.
- 02A use case is a goal that delivers value to an actor, named verb-first.
- 03Actors are roles and always sit outside the boundary rectangle.
- 04«include» points from the base to behaviour that always runs.
- 05«extend» points from the optional extra back to the base.
- 06Three to ten use cases on one page; the detail lives in descriptions, not on the canvas.
08Common questions#
What is the difference between include and extend?
Include means the base use case always runs the included one, so it is factored-out behaviour, and the arrow points from base to included. Extend means the extending use case runs only under a condition, and the arrow points the other way, from the extension to the base. The direction is the part people most often get backwards.
What is an actor in a use case diagram?
Anything outside the system that interacts with it: a person in a role, another system, or a scheduled trigger. An actor is a role rather than an individual, so one person may be two actors and one actor may be many people.
What should not go in a use case diagram?
Sequence, data and design. A use case diagram answers who uses this and what for, not in what order or with which fields. If you find yourself drawing steps, you want an activity diagram.
What is the system boundary box for?
The rectangle around the use cases marks what you are building. Actors sit outside it and use cases inside. It is the element that turns the diagram into a statement about scope, which is the main reason to draw one at all.
What goes into a use case description?
A fully dressed one has a name, the primary actor, the stakeholders and what each needs, preconditions, a numbered main success scenario, extensions numbered against the step they branch from, and postconditions. The extensions field is the one that earns the format, because it is a systematic prompt for every way the happy path can fail.
In this series
- 01What is UML?
- 02UML symbols
- 03Choosing a diagram
- 04Class diagrams
- 05Class diagram examples
- 06How to draw a class diagram
- 07Class diagram symbols
- 08Sequence diagrams
- 09Sequence diagram examples
- 10How to draw a sequence diagram
- 11Use case diagrams
- 12Use case examples
- 13Activity diagrams
- 14Activity examples
- 15State machine diagrams
- 16State machine examples
- 17Component diagrams
- 18Component examples
- 19Drawing a component diagram
- 20Component symbols
- 21Deployment diagrams
- 22Deployment examples
- 23Object diagrams
- 24Package diagrams
- 25Composite structure diagrams
- 26Communication diagrams
- 27Sequence vs communication
- 28Timing diagrams
- 29Interaction overview diagrams
- 30Profile diagrams
- 31UML with AI
- 32E-commerce example
- 33Banking example
- 34Microservices example
- 35AWS example
Related reading
Foundations
Behaviour diagrams
Behaviour diagrams
Structure diagrams
Behaviour diagrams
Behaviour diagrams