Include vs Extend in Use Case Diagrams (Drawn in Visio)
Include and extend are the two use case relationships analysts mix up most. Learn the difference with an online banking example, drawn step by step in Visio.
Step by step
Intro
- Include vs extend. Include and extend are the two use case relationships people mix up most. One online banking diagram in Visio shows the difference.
- UML Use Case stencil. Open the UML Use Case stencil in the Shapes pane. Include and Extend are both on it as connectors.
The set-up
- The set-up. Drop a Subsystem shape for the system boundary and name it Online Banking. Drop an Actor outside the boundary and name it Customer. Drop a Use Case inside the boundary and name it Transfer money. This is the customer's main goal. Connect Customer to Transfer money with an Association connector.
Include
- Include = always. Every transfer must verify the customer's identity, with no exceptions. A step that always happens is an include. Drop a Use Case named Verify identity. Draw the Include connector from Transfer money to Verify identity, so the arrow points at the use case it always uses.
Extend
- Extend = sometimes. Sometimes, during a transfer, the customer adds a new payee. A step that only happens sometimes is an extend. Drop a Use Case named Add payee. Here is the trick: the Extend connector goes the other way. Draw it from Add payee back to Transfer money.
- Done. Click an empty part of the page so nothing is selected, and both relationships are easy to see.
The rule
- The rule. The rule: include means always, and the arrow points to the helper. Extend means sometimes, and the arrow points back to the main use case.
Common mistakes
- Drawing the extend arrow from the main use case. The extend arrow starts at the optional use case and points to the main one, so it runs from Add payee to Transfer money. Only the include arrow starts at the main use case.
- Using include for a step that can be skipped. Ask whether the step happens every single time. If a transfer can finish without it, like Add payee, it is an extend, not an include.
- Using include to split a use case into small steps. A use case diagram shows goals, not a process flow. Use include for behaviour that is required, or shared by several use cases, like Verify identity. Put the step-by-step detail in the use case description.
When a business analyst uses this
In a scoping workshop for an online banking release, a business analyst can draw Verify identity as an include on every money movement use case. Stakeholders then see it is required every time, while flows that only happen in some cases, like Add payee, show as extends.
Questions people ask
What is the difference between include and extend in a use case diagram?
Include is a step the main use case always performs, like Verify identity in every transfer. Extend is a step that only happens sometimes, like Add payee, and its arrow points back to the main use case.
What is extend in a use case diagram?
Extend is a relationship for optional behaviour that only happens under some conditions. It is drawn as a dashed arrow labelled «extend», from the optional use case to the main use case it adds to.
Why do we use use case diagrams?
They show who uses a system and which goals each user can reach, on one page that non-technical stakeholders can read. That makes them useful for agreeing scope before writing detailed requirements.