Use Case Diagrams
Use Case diagrams identify the functionality provided by the system (use
cases), the users who interact with the system (actors), and the association
between the users and the functionality. Use Cases are used in the Analysis
phase of software development to articulate the high-level requirements of the
system. The primary goals of Use Case diagrams include:
-
Providing a high-level view of what the system does
-
Identifying the users ("actors") of the system
-
Determining areas needing human-computer interfaces
Use Cases extend beyond pictorial diagrams. In fact, text-based use case
descriptions are often used to supplement diagrams, and explore use case
functionality in more detail.
Graphical Notation
The basic components of Use Case diagrams are the Actor, the Use Case, and the
Association.
| Actor |
An Actor, as mentioned, is a user of the system, and is depicted using a stick
figure. The role of the user is written beneath the icon. Actors are not
limited to humans. If a system communicates with another application, and
expects input or delivers output, then that application can also be considered
an actor. |
 |
| Use Case |
A Use Case is functionality provided by the system, typically described as
verb+object (eg. Register Car, Delete User). Use Cases are depicted with an
ellipse. The name of the use case is written within the ellipse. |
 |
| Association |
Associations are used to link Actors with Use Cases, and indicate that an Actor
participates in the Use Case in some form. Associations are depicted by a line
connecting the Actor and the Use Case. |
 |
The following image shows how these three basic elements work together to form
a use case diagram.
Text Notation
Behind each Use Case is a series of actions to achieve the proper
functionality, as well as alternate paths for instances where validation fails,
or errors occur. These actions can be further defined in a Use Case
description. Because this is not addressed in UML 1.4, there are no
standards for Use Case descriptions. However, there are some common templates
you can follow, and whole books on the subject writing of Use Case descriptions
.
Common methods of writing Use Case descriptions include:
-
Write a paragraph describing the sequence of activities in the Use Case
-
List two columns, with the activities of the actor and the responses by the
system
-
Use a template (such as those from the Rational Unified Process or Alistair
Cockburn's book, Writing Effective Use Cases) identifying actors,
preconditions, postconditions, main success scenarios, and extensions.
Remember, the goal of the process is to be able to communicate the requirements
of the system, so use whichever method is best for your team and your
organization. Here are examples of a paragraph and template use case
description for our Use Case Diagram:
Create Bug Report (Paragraph Version)
The Tester initiates a new bug report. The Tester indicates the source of the
bug, a description of the problem, and the person to whom the bug should be
assigned. The System records the bug as an open issue, and notifies the
Assigned Person that a new bug has been submitted.
Create Bug Report (Template Version)
| Primary Actor: |
Tester |
| Goal in Context: |
Tester is testing an application and discovers a new bug. He/She wants to
report it so that it can be addressed. |
| Scope: |
System - the quality assurance system for the XYZ Application |
| Level: |
User |
| Stakeholders and Interests: |
Tester: wants to record a new bug
Assigned: wants to be notified of any new bugs
QA Manager: wants all bugs recorded
|
| Precondition: |
none |
| Trigger: |
Tester discovers a bug while testing an application |
| Main Success Scenario: |
1. Tester initiates a new bug report.
2. System records bug with date of submission.
3. System notifies assigned user.
|
| Extensions: |
1a. Tester does not know who to assign bug report to: System assigns bug to QA
Manager. |
|
|
|