All weeks
WEEK 5 Learning Outcome 2.3

Use-Case Modeling & Scenario Analysis

Capturing actor goals with UML diagrams and fully dressed specifications

Learning objectives

  • 1 Construct UML use-case diagrams that correctly identify actors, the system boundary and relationships.
  • 2 Write complete use-case specifications with a main success scenario, alternative flows and exception handling.
  • 3 Apply include, extend and generalisation relationships only where they clarify structure.
  • 4 Model a realistic healthcare booking system and critique its edge cases.

Foundations of Use-Case Modeling

A use case is a goal contract, not a screen flow: it states what the system must do for an actor, not how it is built inside.

1.1 Definition

A use case describes a sequence of actions that a system performs to yield an observable result of value to a particular actor. It captures a goal that a user or external system wants to achieve with the system.

1.2 Four defining qualities

Goal-oriented: it focuses on what the actor wants to accomplish. Black-box: it describes external behaviour and deliberately omits internal design. Value delivery: every use case must produce a meaningful result the actor cares about. Communication tool: it gives business stakeholders and technical teams a shared language.

1.3 Why use cases matter

They force stakeholders to articulate concrete goals and success outcomes (requirements clarity), make the system boundary visible and control scope creep, and become a natural source of test scenarios and acceptance criteria. They also support traceability from business goals through design to tests, prioritisation with MoSCoW or value ranking, and validation by non-technical readers.

1.4 Use cases versus user stories

Use cases are usually larger and multi-step, written as a structured narrative plus diagram, with primary, alternative and exception flows; they suit analysts, designers and testers and are often maintained long-term. User stories are small enough for one iteration, follow the As a... I want... So that... format, carry an acceptance criteria list, suit product owners and developers, and are often discarded after delivery. Use cases fit complex processes and regulated systems; stories fit agile, evolving products. They complement rather than replace each other.

Actors and the System Boundary

Getting the boundary right is one of the most important early modelling decisions: everything inside is built, everything outside interacts.

2.1 What counts as an actor

An actor is anything outside the system that interacts with it: a human user, an external system, a hardware device or a time-based trigger. Human actors are people in a specific role (Receptionist, not Mary), because roles matter more than individuals. System actors are external software or hardware that exchange data or events with the system.

2.2 Primary versus secondary actors

A primary actor initiates the use case to achieve a goal, such as a Patient booking an appointment. A secondary actor supports the system in completing the use case, such as a Payment Gateway or SMS service.

2.3 How to identify actors

Ask who uses the system and receives results, who gets value, which external systems are involved (payment gateways, EHR, SMS providers, identity services, printers), whether scheduled jobs or batch processes act as a Time actor, and who maintains data with special access (administrators, auditors, compliance officers). Do not split actors by job title when their goals are identical.

2.4 The system boundary

The boundary is the rectangle drawn around the use cases. Inside sits every use case the system performs plus the internal logic and data it owns; outside sit the human users, external systems, devices and organisations that interact with it. Common mistakes are placing external systems inside the boundary and treating internal modules as actors.

2.5 Practical boundary test

Ask: if we outsource or replace this component, is it still part of our system? If the answer is no, it belongs outside the boundary as an actor.

Diagram Notation and Relationships

A small, precise vocabulary carries the whole diagram; the direction of each arrow is meaningful and frequently misused.

3.1 Core symbols

An actor is a stick figure or labelled box placed outside the boundary. A use case is an oval containing a short verb-phrase name such as Book Appointment. The system boundary is a rectangle enclosing all use cases. An association is a solid line connecting an actor to a use case it participates in, optionally with multiplicity.

3.2 Naming use cases well

Good names are short, active and goal-focused: Book Appointment, Cancel Booking, View Medical History, Process Payment, Send Reminder, Register New Patient. Poor names are vague, technical or describe internal steps: Manage Data, Use the System, Click Submit, Database Update, Handle Errors, Process Form.

3.3 Association and generalisation

Association shows participation between an actor and a use case. Generalisation means one use case or actor is a specialised form of another: the child inherits behaviour and may override it.

3.4 Include

Use include when a base use case always needs another use case, and the behaviour is mandatory and factorable. The dashed arrow points from the base to the included use case. Examples: Book Appointment, Cancel Booking and Process Payment all include Authenticate User; Process Payment includes Validate Card Details; Generate Report includes Fetch Patient Data.

3.5 Extend and the include-versus-extend decision

Use extend when additional behaviour is optional or conditional and is added at a defined extension point; the arrow points from the extending use case to the base. Examples: Request Special Assistance and Add Dependent extend Book Appointment; Collect Insurance Details extends Check In Patient. Choose include when the behaviour is always required, several base use cases share the steps, you want to avoid repeated logic, and the included case stands alone. Choose extend when the behaviour is optional or rare, triggered by a condition, the base is complete without it, and you want to keep the base simple.

Writing Detailed Scenarios

The diagram shows the big picture; the fully dressed specification supplies the detail needed for design and testing.

4.1 Anatomy of a specification

Every specification carries a unique name and ID, the primary and supporting actors, preconditions (what must be true before the use case starts), postconditions (what is true after successful completion), the trigger event, the numbered main success scenario, extensions and alternatives, and any business rules or policies that apply.

4.2 Rules for the main success scenario

Number every step clearly. Use active voice: Patient selects a date, not A date is selected. Keep each step to one action or system response. Show the dialogue as actor action, system response, actor action. End with a clear success outcome that delivers value. Avoid UI details such as buttons and colours unless they are essential to the goal.

4.3 Alternative versus exception flows

Alternative flows are valid variations that still reach success or a controlled different outcome, for example paying by a different method, booking for a dependent, accepting the next available slot, or saving a draft. Exception flows are error or failure conditions that prevent the normal goal: a declined payment, a slot taken by another user, three failed authentication attempts, or an unavailable external system.

4.4 Numbering extensions

Link each extension to the main scenario step it branches from. If step 4 shows available slots, extension 4a might read: no slots available, so 4a1 the system offers the next available date, 4a2 the patient accepts, 4a3 the use case continues from step 5. A second branch 4b might record that the patient cancels the search, 4b1 the system returns home, 4b2 the use case ends.

4.5 Choosing the level of detail

Brief or summary: name plus one paragraph, useful for early scoping and prioritisation. Casual: a few paragraphs covering the main flow and major alternatives, good for workshops. Fully dressed: the complete template with preconditions, postconditions, numbered steps and all extensions, required for complex or regulated systems.

Worked Example: MediBook Clinic

MediBook is a multi-clinic outpatient service where patients book, reschedule and cancel online or by mobile app, receptionists handle walk-ins and phone bookings, and the system integrates with an EHR and SMS reminders.

5.1 Context, actors and constraints

Primary actors are the Patient, Receptionist and Clinic Admin. Secondary actors are the EHR System, SMS Gateway and Payment Gateway. Key goals are reducing no-shows, improving slot utilisation and giving patients self-service. Constraints are GDPR compliance, a 24/7 availability target and integration with a legacy EHR.

5.2 Candidate use cases

Register Patient and Check In Patient; Book, Reschedule and Cancel Appointment; View Upcoming Appointments; Process Co-Payment; Send Reminder; Configure Clinic Schedule; Retrieve Patient Record. Each is owned by the relevant actor, with Send Reminder driven by Time or the System.

5.3 Diagram structure

A rectangle labelled MediBook Appointment System holds the core use cases. Patient, Receptionist and Clinic Admin sit on the left; EHR, SMS Gateway and Payment Gateway sit on the right. Book, Reschedule and Cancel all include Authenticate User and Log Activity. Request Special Assistance and Add Dependent extend Book Appointment. Association lines connect each actor to the use cases it participates in.

5.4 Book Appointment header

UC-01, primary actor Patient, secondary actors EHR System and SMS Gateway with an optional Payment Gateway. Preconditions: the patient is registered and authenticated and at least one clinic has open slots. Postconditions: the appointment is reserved, confirmation is sent and the slot is no longer available to others. Trigger: the patient selects Book Appointment from the home screen or menu.

5.5 Main success scenario and extensions

The patient selects a clinic and specialty or doctor; the system shows dates for the next 28 days; the patient chooses a date; the system shows open slots; the patient selects a slot; the system presents a summary and any co-payment; the patient confirms; the system reserves the slot, writes to the EHR and generates a confirmation; an SMS confirmation is sent; a success message with reference number is displayed. Extensions cover no dates in 28 days (3a, waiting list), no slots with the preferred doctor (4a, offer other doctors), the slot being taken during the session (5a, refresh and choose again) and a required co-payment (7a, include Process Co-Payment, then retry or cancel).

Quality and Common Mistakes

6.1 Quality checklist

Does every use case deliver a clear result of value to an actor? Is the boundary correct, with no external systems inside? Are actor names roles rather than job titles or personal names? Is the main scenario free of UI implementation detail? Are alternative and exception paths linked to specific steps? Are include and extend used only when justified? Can a non-technical stakeholder read and validate the scenario? Are preconditions and postconditions precise and testable?

6.2 Common mistakes

Treating internal modules as actors instead of only entities outside the boundary. Naming use cases after pages or buttons instead of user goals. Writing one giant use case that does everything instead of splitting by distinct goals. Omitting exception paths instead of asking what can go wrong at each step. Over-using extend for every variation when a simple alternative flow inside the same use case is clearer. Leaving out postconditions instead of stating what changed after success.

6.3 Myths worth correcting

Use cases are not only for Waterfall; they remain valuable for complex behaviour and regulated domains alongside user stories. Not every variation needs its own use case; most belong as alternative or exception flows. Diagrams alone are not enough, because scenarios carry the detail. Actors need not be human: systems, devices and time triggers qualify. Include and extend are not interchangeable: they point in opposite directions and mean different things.

6.4 Practice and tooling

A workshop cycle is: list at least four actors and classify them, produce six to ten goal-oriented use case names, draw the boundary, add associations, then add at least one justified include and one extend. For scenarios, write the header, an eight to twelve step main success path in active voice, and at least three extensions with correct 4a and 4a1 numbering, then peer review against the checklist. Suitable tools include StarUML, Visual Paradigm, draw.io, Lucidchart, Miro and PlantUML; paper and a photograph are perfectly valid for workshops.

Key takeaways

  • Use cases capture actor goals that deliver value, not internal functions or UI screens.
  • Actors are roles, external systems, devices or time triggers outside the boundary, never internal modules.
  • A good diagram shows the structure; a fully dressed scenario supplies the detail needed for design and testing.
  • Include covers mandatory shared behaviour; extend covers optional or conditional behaviour.
  • Always write alternative and exception paths, because the happy path alone is not enough.
  • Quality comes from clear goal-based naming, precise preconditions and postconditions, and stakeholder validation.

Key terms

Actor
An external entity such as a person, system or device that interacts with the system under design.
Use case
A description of a sequence of actions that yields an observable result of value to an actor.
System boundary
The rectangle that separates the system under design from its environment.
Include
A relationship showing that a base use case always incorporates the behaviour of another use case; the arrow points from base to included.
Extend
A relationship showing optional or conditional behaviour added to a base use case at an extension point; the arrow points from extending to base.
Main success scenario
The primary happy-path sequence of numbered steps that achieves the actor goal.
Extension
A numbered branch from the main scenario describing alternative or exception behaviour, such as 4a and 4a1.
Precondition
A condition that must be true before the use case can start.
Postcondition
A condition guaranteed to be true after the use case completes successfully.
Fully dressed use case
The complete specification template with preconditions, postconditions, numbered steps and all extensions.