SEN2022 · Week 7 · Use Case Descriptors

Use case descriptions: from brief to fully dressed

Writing a use case as text: trigger, preconditions, normal flow, subflow, alternate and exception flows. On the exam you are asked to write a use case description from start to finish.

use case descriptionbrief descriptioncasual use casefully dressed use casetriggerexternal triggertemporal triggerpreconditionspostconditionsnormal flow of eventssubflowalternate flowexceptional flowstakeholders and interestsimportance leveloverview use casedetail use caseessential use casereal use case

A use case diagram shows what will be done but gives no detail. The use case description gives the detail: how the actor interacts with the system step by step, what can go wrong, and what is true when it ends. This text is the input for both the designer and the tester: every alternate flow turns into a test case. A typical exam question: “Write a fully dressed use case description for X.” Know the template by heart, write the steps in proper sentences, and don’t skip the alternate flows.

Golden rules:

  1. The normal flow is a single successful scenario. Errors and options go under a separate heading.
  2. The subject of every step must be clear: “The student …”, “The system …”. No passive sentences.
  3. Deviations are written with a step number: “4a. If the book is already reserved …”.
  4. The same level of abstraction. One step shouldn’t be “selects a book” and another “moves the mouse to the right”.

Three levels of detail

LevelLengthWhen
Brief2-4 sentences, main scenario onlyEarly analysis, to introduce the use case list
CasualA few paragraphs, alternatives in plain textUse cases of medium importance
Fully dressedFull template, numbered stepsImportant, risky, complex use cases

There are also two further distinctions:

  • Overview vs detail: An overview use case is high level (usually a brief), a detail use case gives the full flow.
  • Essential vs real: An essential use case is independent of technology (“The student selects the book”). A real use case describes a specific interface (“The student taps the ‘Reserve’ button”). In analysis, write essential.

The fully dressed template

FieldContent
Use case nameVerb + object
IDUC-xx
Importance levelHigh / Medium / Low
Primary actorThe role that starts it
Use case typeOverview/detail, essential/real
Stakeholders and interestsEveryone interested in the outcome and their expectation
Brief description1-2 sentences
TriggerThe event that starts it
Trigger typeExternal / temporal
RelationshipsAssociation, include, extend, generalization
PreconditionsWhat must be true before it starts
Normal flow of eventsNumbered main success steps
SubflowsDetails of long steps (S-1, S-2)
Alternate / exceptional flowsDeviations (4a, 6a …)
PostconditionsThe state that is true when it ends successfully

Some templates also include a “special requirements” field: the nonfunctional requirements belonging to this use case (e.g. “The reservation confirmation within 3 s”).

Rules for writing steps

  1. The SVDPI pattern: Subject - Verb - Direct object - Preposition - Indirect object. “The system (S) sends (V) the confirmation e-mail (D) to the student (I).” Word order may vary; what matters is that the subject and the object are clear.
  2. Make clear who starts it. Every step is an action of either the actor or the system.
  3. Write like an independent observer. Not “I press the button” but “The student submits the request.”
  4. The same level of abstraction. Screen details (color, button position) do not go into an analysis description.
  5. A reasonable number of steps. 3-9 steps is ideal. If it is too long, split it into a subflow or a separate use case.
  6. Keep it simple (KISS). Don’t stuff every possible case into the normal flow.
  7. Write the return instruction. At the end of an alternate flow, state where to go back to: “return to step 4” or “the use case ends”.

PITFALL · writing the normal flow with if/else. A sentence like “If the book is available, it reserves it; otherwise it adds to the waiting list” does not belong in the normal flow. The normal flow describes the available case; the not-available part is written as “4a” in the alternate flows.

Worked example: Reserve Book (fully dressed)

Context: The reservation system of a campus library. The student reserves an available book for 48 hours, and the book is held at the lending desk.

Use case name : Reserve Book
ID            : UC-04
Importance    : High
Primary actor : Student
Use case type : Detail, essential

Stakeholders and interests:

  • Student: to get the book they want without waiting in a queue.
  • Librarian: orderly reservations and few no-shows.
  • Library manager: fair use of resources.

Brief description: The student searches for a book and reserves an available copy for 48 hours; the system sets the copy aside and sends the confirmation.

Trigger: The student wants to reserve a book. Trigger type: External.

Relationships:

  • Association: Student
  • Include: Verify Membership
  • Extend: Join Waiting List
  • Generalization: none

Preconditions:

  • The student is logged in to the system.
  • The library catalog is up to date.

Normal flow of events:

1. The student searches for the book by title,
   author or ISBN.
2. The system lists the matching books and the
   number of available copies of each.
3. The student selects a book and a pickup branch.
4. The system runs the S-1: Check Eligibility
   subflow.
5. The system sets aside an available copy
   in the student's name for 48 hours.
6. The system creates the reservation record and
   generates a reservation code.
7. The system sets the status of the copy to
   "On Hold".
8. The system shows the confirmation on screen and
   sends an e-mail to the student.

Subflows:

S-1: Check Eligibility
 1. The system verifies that the student's
    membership is active (Verify Membership).
 2. The system checks that the student has
    no unpaid fines.
 3. The system checks that the student's number
    of active reservations is less than 3.

Alternate / exceptional flows:

2a. If there is no matching book:
    2a1. The system says "No results found".
    2a2. Return to step 1.
3a. If the selected book has no available copy:
    3a1. The system offers to join the waiting
         list (extend: Join Waiting List).
    3a2. If the student accepts, they are
         added to the list; the use case ends.
S-1.2a. If there is an unpaid fine:
    The system shows the fine amount and
    rejects the reservation; the use case ends.
S-1.3a. If the number of active reservations is 3:
    The system shows a limit message;
    the use case ends.
5a. If the copy was set aside by someone else
    in the meantime:
    The system informs the student, return to step 2.

Postconditions:

  • Success: A copy is “On Hold” in the student’s name for 48 hours, and the reservation record and code exist.
  • Failure: The status of no copy has changed.

Analyzing the example

  • The normal flow has 8 steps. The subject of every step is clear: the Student (1, 3), the System (2, 4-8).
  • The eligibility check was put into a subflow, and the main flow stays readable.
  • Verify Membership is an include because it is also used in other use cases (Borrow Book).
  • Join Waiting List runs only if there is no copy: an extend, triggered in alternate flow 3a.
  • 5a catches a concurrency problem. Deviations of this kind turn into a locking requirement in the design.

From the description to other models

The description is the raw material for the following weeks:

In the descriptionWhere it goes
Nouns (book, copy, reservation, student)Class diagram candidates (week 8)
Steps and their orderActivity and sequence diagrams (week 10)
State change (“On Hold”)State machine diagram (week 10)
Alternate/exception flowsTest cases (week 13)

Common mistakes

Wrong ideaThe truth
Writing if/else in the normal flowThe normal flow is the single success path; deviations go to alternates
Passive steps (“is checked”)Write the subject: “The system checks”
Trigger = preconditionThe trigger is the event that starts it, a precondition is a state that was true beforehand
Writing interface details (button color)Write essential in analysis, independent of technology
Not writing the return point in an alternate flowWrite “return to step 2” or “the use case ends”
A normal flow of 25 stepsSplit into subflows or break up the use case
Postcondition = the last stepIt is the state that is true after it ends (the record exists, the status changed)
Stakeholder = only the actorsInterested parties who are not actors are written too (manager, auditor)

Test yourself

Exam-style questions. Solve them on paper first, then reveal the answer.

Question 1easy

What is the difference between a brief and a fully dressed use case description?

Show answer
Brief: a short paragraph (a few sentences) of the main success scenario. Fully dressed: a complete template with actors, stakeholders, trigger, pre/postconditions, numbered normal flow, subflows and alternate/exception flows.

A brief is written in early analysis to describe the use case list quickly. A casual one is a few paragraphs, with alternatives in plain text. A fully dressed one is a template with all fields filled in and numbered steps, for important and risky use cases.

Question 2easy

'Every night at 23:00 the system sends reminder e-mails for books due tomorrow.' What type of trigger is this?

  1. External trigger
  2. Temporal trigger
  3. Exceptional trigger
  4. Include trigger
Show answer
B) Temporal trigger

An event triggered by time is a temporal trigger (the actor is usually Time). An external trigger is an action of an outside actor: "The student presses the reservation button."

Question 3easy

Which part of a use case description lists what must be true before the use case can start?

  1. Trigger
  2. Postconditions
  3. Preconditions
  4. Normal flow
Show answer
C) Preconditions

Preconditions are the states that must be true before it starts: "The student must have logged in to the system." The trigger is the event that starts it, and postconditions are the states that are true when it ends.

Question 4medium

In the Reserve Book description on this page, which flow handles 'the book is already reserved by someone else'?

  1. Normal flow
  2. Subflow S-1
  3. Alternate/exceptional flow
  4. Postcondition
Show answer
C) Alternate/exceptional flow

Situations that deviate from the main success scenario are written in the alternate/exceptional flow, and the step they leave from is indicated by a number (e.g. 4a). A subflow, in contrast, is a part called from within the normal flow whose details are written separately.

Question 5medium

What is wrong with this step: 'The system is used to check the fine'?

Show answer
It is passive and unclear who acts; write it as 'The system checks whether the student has unpaid fines.'

A good step is written in the SVDPI pattern: Subject (who), Verb, Direct object, Preposition, Indirect object. A passive sentence hides the actor. "The system checks whether the student has unpaid fines." It is clear who does it.

Question 6medium

What is the difference between an alternate flow and an exceptional flow?

Show answer
An alternate flow is a valid different path that still reaches the goal; an exceptional flow handles an error and usually ends without reaching the goal.

Alternate: "The student chooses shipping instead of branch pickup", and the goal is still achieved. Exception: "The book has been reserved by someone else", and the use case does not end successfully or returns with an error message. Some templates write both under one heading.

Question 7easy

The normal flow of 'Reserve Book' on this page has how many numbered steps?

Show answer
8

1 The student searches ... 8 The system shows the confirmation and sends an e-mail. The example on the page has eight steps. A good normal flow is usually 3-9 steps; if it goes beyond 15-20 steps, the use case should be split.

Question 8easy

Which field records who cares about the use case and why, e.g., 'Librarian: wants fewer no-shows'?

  1. Primary actor
  2. Stakeholders and interests
  3. Relationships
  4. Importance level
Show answer
B) Stakeholders and interests

The primary actor is the role that starts the use case. Stakeholders and interests lists everyone interested in the outcome (even if they are not actors) and their expectations. This field helps capture hidden requirements.

Question 9medium

Write a brief description for the use case 'Track Order' in a food-delivery app.

Show answer
e.g., 'The customer views the current status and estimated delivery time of an active order; the system shows the courier's position once the order is picked up.'

A brief description is one or two sentences: who does what, and what they get. Technical details (API, screen color) are not written. On the exam, a single sentence containing the actor and the result earns full marks.

Question 10hard

An essential use case and a real use case differ how?

Show answer
Essential: describes only the minimum essential steps, technology-independent. Real: describes the steps with specific technology/interface (screens, buttons).

In analysis an essential use case is written: "The student selects the book." In design it can turn into a real use case: "The student taps the 'Reserve' button in the list." Committing to the interface in analysis is deciding too early.

Question 11hard

In the fully dressed 'Reserve Book', step 3 says 'Perform S-1: Check Eligibility'. Why use a subflow instead of writing the checks inline?

Show answer
To keep the normal flow short and readable at one level of detail; the subflow holds the details (and can be reused).

The normal flow should stay at the same level of abstraction. The three sub-steps of the eligibility check (fine, limit, membership) would bloat the main flow. The subflow (S-1) writes the details separately. If several use cases perform the same check, that is a candidate for an include relationship.

Verification: Conceptual and writing questions; the template fields, flow types and trigger types were checked against the standard use case description definitions (the Dennis, Wixom and Tegarden template and Cockburn's brief / casual / fully dressed distinction). Step numbers and counts were counted by hand on the example on the page.

Review card

Brief: 2-4 sentences; Casual: a few paragraphs; Fully dressed: the full template Template: name, ID, importance, primary actor, stakeholders & interests, brief description, trigger, trigger type, relationships, preconditions, normal flow, subflows, alternate/exceptional, postconditions Trigger: external (actor action) / temporal (time) Pre: true before it starts; Post: true after it ends Normal flow: the main success path, numbered, 3-9 steps Subflow: split off a long part (S-1), "Perform S-1" from the normal flow Alternate: a different but valid path; Exception: an error, the goal is not reached Numbering: 4a, 4b = a deviation from step 4 Step pattern SVDPI: who + verb + what + to whom/where Independent observer view; same level of abstraction; no passive Essential (no technology) vs real (screens, buttons) Include = "Perform/Include X" in the description; extend = a condition in an alternate