Analysis: Use Cases



index
Disabled back button Next Section
printable version




Section 0: Module Objectives or Competencies
Course Objective or Competency Module Objectives or Competency
The student will be able to assess and apply Object-Oriented analysis and design methods like use cases to express user requirements, UML modeling, and other OO approaches. Understand the process used to create use case diagrams.


Section 1: Overview

Here is a Use Case Introduction:

The Unified Process is said to be Use-Case Driven:


A use case diagram is a depiction of a system’s behavior or functionality under various conditions as the system responds to requests from users.

Example Use Case.

Functional requirements are specified in a collection of use case diagrams. Each feature or user goal of the system must have a use case diagram written for it.


Video Overview

Here is a video overview of Use Cases:

This video provides a few more details:


Confusing Terms

The use of similar terms can be confusing – there are use case elements, use case diagrams, and collections of use case diagrams.

From a graphical standpoint...

From the standpoint of what they represent...

We will also discuss use case descriptions, which provide a textual means to more fully document the different aspects of each individual use case diagrams.


Use cases also involve happy paths. No wonder the stick figures look so happy!



Section 2: Benefits of Use Case Diagrams


Section 3: Elements of Use Case Diagrams
Use Case Syntax.

Basic Concepts

Sequences of actions

System performs

An observable result of value

A particular actor


Use Case Components

A use case diagram contains four components.

Note that each use case must include


Elements

Actors

What exactly is an actor?

An actor is something that interacts with the system

Types of Actors

Use Case (element)

Use case represents a single system function.

Subject boundary

Subject boundary includes all the relevant use cases.

Association

Association is a connection between an actor and a use case.

Extend relationship is an association between two use cases where one adds new behaviors or actions to the other.

Include relationship is an association between two use cases where one use case uses the functionality contained in the other.



Section 4: Identifying Major Use Cases

Note that the average number of Use Cases per project is 88 (source).

Video Example

Here is a video demonstrating modeling use case elements:



Section 5: Create a Use Case Diagram

Building the Use Case Model

Let's start with a video:


Steps in Building the Use Case Model

  1. Identify and Describe the Actors: Identify all actors that interact with the system.
    • Who uses the system?
    • Who gets information from the system?
    • Who provides information to the system?
    • Where in the organization is the system used?
    • Who supports and maintains the system?
    • What other systems use the system?
  2. Identify the Use Cases and Write a Brief Description: Identify what actors need to do to accomplish their tasks.
    • What will the actor use the system for?
    • Will the actor create, store, change, remove, or read data in the system?
    • Will the actor need to inform the system about external events or changes?
    • Will the actor need to be informed about certain occurrences in the system?
    Choose Use Case names carefully – a few words beginning with a verb is usually a good idea, e.g., “Change Password”.
    • Consider the following template:
      Use case template
  3. Identify the Actor and Use Case Relationship: Although only one actor can initiate a use case, many use cases involve the participation of multiple actors. Each use case must be analyzed to see what actors interact with it.
  4. Outline the Individual Use Cases: Before developing detailed use cases for the system, outlines of each should be developed. Of particular interest at this point is the flow of events, including the basic and alternate flows.
    • Basic flow:
      • What event starts the use case?
      • How does the use case end?
      • How does the use case repeat some behavior?
    • Alternate flow:
      • Are there optional situations in the use case?
      • What odd cases might happen?
      • What variants might happen?
      • What may go wrong?
      • What may not happen?
      • What kind of resources can be blocked?
  5. Refine the Use Cases: At some point later in the project lifecycle, the time will be right to refine the use cases developed. At that time there are a number of additional factors to be considered.
    • All alternate flows, including exception conditions: Identifying primary alternate flows is straightforward, but flows due to exception conditions may not be clear initially.
    • Pre- and Post-conditions: The refinement process will start to identify state information that controls the behavior of the system. (More on pre- and post-conditions)

Drawing a Use Case Diagram:


Graphical Example

Patient Appointment System Use Case Diagram

Example Use Case.

Video Example #1

Here is a video demonstrating a use case diagram for an ATM:

Video Example #2

Here is a video demonstrating a use case diagram for a Maintain Curriculum process:



Section 6: Types of Use Cases
Types of Use Cases.

Overview Use Case

An overview use case is used to enable the analyst and user to agree on a high-level overview of the requirements.

Detail Use Case

Once the user and the analyst agree upon a high-level overview of the requirements, the overview use cases are converted to detail use cases.

Essential Use Case

An essential use case is one that describes only the minimum essential issues necessary to understand the required functionality.

Real Use Case

A real use case goes farther than an essential use case and describes a specific set of steps.



Section 7: Levels of Granularity

Use cases exist at different levels of granularity, or degree of detail in the use case description.

Alistair Cockburn (2000), leading authority on use cases, describes five levels of granularity, also referred to as altitude metaphors known as Cloud level, Kite level, Sea level, Underwater level and Clam level.

Use case level refers to degree of detail in the use case description, and there are five suggested levels (Cockburn, 2000):

  1. Cloud – as seen from clouds: enterprise level
  2. Kite – "birds-eye view": business unit or department level
  3. Sea – sea-level view: user goals
  4. Fish – below sea-level: functional or sub-functional
  5. Clam – bottom of the sea: most detailed

Levels of granularity.

Cloud Level

The Cloud Level is the highest level, or enterprise level. At this level a use case represents ways of getting to highly summarized goals, such as “advertise goods”, “sell goods to customers”, “manage inventory”, “manage the supply chain”, and “optimize shipping”. There may only be four to five cloud-level use cases for the entire organization.

These are very high level and involve multiple user goals. Too high up to be of interest to software development projects, and far too high level to generate code.

Cloud Level.

Kite Level

The Kite Level is lower than the Cloud Level but still a high level, providing an overview. This level is still mostly concerned with summary goals, but is slightly more detailed. The kite-level use case may be at the business unit or department level and is a summary of goals. Examples of kite-level use cases would be to “register students”, or if working with a travel company, “make an airline reservation”. Kite-level use cases represent high level processes that take place over several hours, days, or weeks and involve many steps. They are generally too high level to be interesting to software development projects and generating code.

Kite-level use cases show how the sea-level use cases fit into wider business interactions. Kite-level use cases are usually business use cases, whereas sea and fish levels are system use cases. Most use cases should be at the sea level.

Kite Level.

Sea Level

Sea-level use cases are usually created for user goals. These often have the greatest interest for users and are easiest for a business to understand. They are usually written for a business activity. Examples are “register a continuing student”, “add a new customer”, “place an item in a shopping cart”, and “order checkout”.

A single use case at this level describes a single elementary business process, and realizes a single user (actor) goal. The core use cases are at “sea level.” Sea-level use cases typically represent a discrete interaction between a primary actor and the system. Such use cases will deliver something of value to the primary actor and usually take from a couple of minutes to half an hour for the primary actor to complete.

Fish Level

At the Fish Level a use case shows lots of detail, often at a functional or subfunctional level. Examples are “choose a class”, “pay academic fees”, “save as file”, “look up the airport code for a given city”, and “produce a list of customers after entering a name”.

This level is concerned with the implementation of the system, underlying the diagram at sea level. Fish-level use cases are needed to accomplish user goals, typically can be used and reused. These use cases, along with sea-level use cases, provide a good basis for generating code that handles the software's behavior.

Clam Level

Clam-level use cases are the most detailed use cases, at a subfunction level. Examples might be a “secure logon validation”, “insert record into database”, or “add new field using dynamic HTML”. These are not usually written out in detail as use cases, but rather appear as steps in another use case, most likely at the fish level.


Video Explanation

Here is an excruciating video demonstrating use case levels:


Related Links



Section 8: Verification and Validation

Use cases must be verified and validated before beginning structural and behavioral modeling.

Walkthroughs are often used.


Rules for Verification & Validation

  1. Ensure one recorded event in the flows of the use case description for each action/activity on the activity diagram
  2. All objects in an activity diagram must be mentioned in an event of the use case description
  3. The sequence of the use case description should match the sequence in the activity diagram
  4. One and only one description for each use case
  5. All actors listed in a use case description must be shown on the use case diagram
  6. Stakeholders listed in the use case description may be shown on the use case diagram (check local policy)
  7. All relationships in the use case description must be depicted on the use case diagram
  8. All diagram-specific rules must be enforced


Section 9: Resources