UML Use Case Diagrams: Symbols, Relationships, and Examples

Explore how to effectively use a UML use case diagram to map out system functionalities. This guide provides step-by-step instructions to improve system design and communication.
Zac Jenkins
Zac Jenkins Oct 14, 26

Transcript with AI

ChatGPT ChatGPT
Perplexity
Grok
Claude
article banner flowchart

A UML use case diagram shows the goals a system supports and the external actors that interact with it. Use it to define system scope and discuss functional requirements. It complements written use cases and other UML diagrams rather than capturing every requirement by itself.

In this article
  1. What is a Use Case Diagram?
  2. Purposes of Use Case Diagrams
  3. Use Case Diagram Relationships
  4. Use Case Diagram Components
  5. Use Case Diagram Symbols and Notations
  6. How to Draw a Use Case Diagram
  7. Use Case Diagram Examples
  8. Conclusion

What is a Use Case Diagram?

A UML use case diagram represents actors, use cases, and their relationships around a defined system boundary. An actor is an external role; a use case describes behavior the system provides to achieve a goal for that role. Unified Modeling Language.

  • Actors represent users or other systems that interact with the system. 
  • Use cases describe system behavior that produces a useful result for an actor.

These diagrams are helpful for both developers and stakeholders. They help to clarify the requirements of the system. They show what the system should do from the user's perspective. This makes it easier to design and build the system.

A use case diagram UML includes several components.

  • Actors are usually represented by stick figures.
  • Use cases are shown as ovals.
  • Lines connect actors to the use cases they interact with.

These connections show the relationships between actors and use cases.

Use case diagrams also help in identifying the scope of the system. They show the boundaries of what the system will do. This helps in setting clear expectations for the system's capabilities.

Use a use case diagram for the overview of actors and goals. Use a written use case for preconditions, main and alternative flows, and postconditions; use an activity diagram to show the sequence and branching of a workflow.

Purposes of Use Case Diagrams

A UML use case diagram serves many important purposes in system development. Following are some of the purposes of the UML use case diagram:

Specify the Context of a System

A UML use case diagram example helps specify the context of a system. It shows how users interact with the system. This helps in understanding the boundaries of the system. It also shows what is outside the system’s scope.

Capture the Requirements of a System

A use case diagram summarizes functional goals and actor participation. Review it with stakeholders to identify missing goals, then document detailed scenarios and nonfunctional requirements separately.

Furthermore, it also helps in identifying missing requirements.

Support Architecture Review

Use cases provide scenarios to discuss during architecture reviews. The diagram alone cannot validate an architecture; detailed requirements, design analysis, and testing are also needed.

Guide Implementation and Test Planning

Use cases can guide implementation and test planning when supported by written scenarios, preconditions, exceptions, and expected results. A diagram by itself does not generate a complete test suite.

Developed by Analysts Together with Domain Experts

Analysts and domain experts develop use case diagrams together. This ensures that the diagrams are accurate. It also ensures that the system meets business needs. Collaboration helps in creating a system that works well for all users.

Use Case Diagram Relationships

An association connects an actor to a use case. Between use cases, include, extend, and generalization express different relationships. Choose them by meaning rather than using arrows to imply a sequence of actions.

Extend

extends use case

An «extend» relationship adds conditional or optional behavior to a base use case that is meaningful on its own. For example, Add Gift Wrap can extend Checkout when the shopper requests wrapping. The dashed arrow points from the extending use case to the base use case.

Include

include use case

An «include» relationship means that an including use case incorporates the behavior of another use case. The dashed arrow points from the including use case to the included use case.

For example, Withdraw Funds and Deposit Funds could both include Update Balance if that behavior is required by both scenarios. Describe the shared behavior in the included use case, and avoid using include merely to show which activity occurs next.

Generalization

generalize use case

Generalization connects a specialized actor or use case to a more general one. A solid line with a hollow triangle points toward the general element. Use it when the specialized element inherits the general behavior or participation, not simply when two elements are related.

Use Case Diagram Components

A UML use case diagram includes several key components that help illustrate the interactions within a system. Here are the main components:

Actors

actor use case diagram

Actors represent users or other systems that interact with the system being designed. They are shown as stick figures in the diagram. There are two types of actors: primary actors, who initiate interactions, and secondary actors, who assist in the interactions. For example, in a banking system, a Customer could be a primary actor, while a Bank Employee could be a secondary actor.

Use Case

case uml use case diagram

A use case describes a specific action or interaction between the actor and the system. Use cases are represented by ovals. Each use case should achieve a goal for the actor. For example, in the banking system, Open Accounts and Deposit Funds are use cases. They show the different ways users can interact with the system.

System

system use case diagram

The system is the boundary that defines what is inside and outside the scope of the system being modeled. It is represented by a rectangle that contains the use cases. Everything inside the rectangle is part of the system. The interactions between actors and use cases occur at the boundary. This helps to clearly define what the system will do.

Note

note use case diagram uml

Notes are used to add extra information to the diagram. They can be connected to any part of the diagram to provide explanations or comments. Notes are represented by a rectangle with a folded corner. For example, a note might explain a specific business rule or condition that affects a use case.

Use Case Diagram Symbols and Notations

Understanding the symbols and notations in a UML use case diagram is crucial for creating clear and effective diagrams. Here are some symbols and notations:

Use Case

A use case is a specific action or interaction between an actor and the system. It is represented by an oval shape. Each use case should achieve a goal for the actor. They describe what the system should do from the user's perspective.

Actors

Actors represent the users or other systems that interact with the system. They are depicted as stick figures. Actors can be people, organizations, or external systems.

Associations

Associations show the relationships between actors and use cases. They are represented by solid lines connecting actors to use cases. These lines indicate that an actor participates in the use case.

System Boundary Boxes

The system boundary box defines the scope of the system. It is represented by a rectangle that encloses all the use cases. Everything inside the box is part of the system being modeled, while everything outside is not. This helps to clearly delineate what is included in the system and what is not.

How to Draw a Use Case Diagram

Creating a UML use case diagram involves a series of steps to accurately represent the system's interactions and functionalities.

1. Identify Actors

First, identify all the actors who will interact with the system. Actors can be users, external systems, or devices that interact with your system. Think about who or what will use the system.

2. Identify Use Cases

Identify the goals actors need the system to support, such as Borrow Book or Withdraw Cash. Name each use case with a verb phrase and keep it at a consistent level of detail. Record main and alternative flows in a written description.

3. Define Relationships

Connect actors to the use cases they participate in with associations. Add include for required reused behavior, extend for conditional additions, and generalization for specialization. Check the direction of each relationship.

4. Draw the System Boundary

Draw a rectangle to represent the system boundary. This boundary defines what is inside the system and what is outside. Place all the use cases inside this boundary. The actors should be outside the boundary, connected to the use cases they interact with.

5. Review and Refine

Finally, review the diagram to make sure it accurately represents the system. Make any necessary changes to improve clarity. Ensure that all actors and use cases are correctly represented and that the relationships are clear. This step is important to ensure the diagram is useful and accurate.

Use Case Diagram Examples

Examining examples of UML use case diagrams can help you understand how to apply these concepts in real-world scenarios. Here are some examples:

1. ATM System

An ATM system use case diagram might include actors like Customers and Bank Servers. Use cases could include Withdraw Cash, Check Balance, and Deposit Funds. This diagram shows how customers interact with the ATM to perform various banking functions.

2. Online Shopping System

An online shopping system use case diagram might include actors like Shopper and Payment Gateway. Use cases could include Browse Products, Add to Cart, and Make Payment. This diagram illustrates how shoppers interact with the online store to purchase products.

3. Library Management System

A library management system use case diagram might include actors like Librarians and Members. Use cases could include Borrow Book, Return Book, and Catalog Search. This diagram shows how members and librarians interact with the library system to manage book borrowing and returns.

Conclusion

Creating and interpreting a UML use case diagram is an essential skill for software developers and system designers. These diagrams help to capture user requirements and show how users will interact with the system. By following the steps outlined in this guide and understanding the key components and relationships, you can create effective use case diagrams that contribute to successful system development. Remember to review and refine your diagrams to ensure they accurately represent the system's intended functionality.

AI Diagram Generatorhot

Enter your prompt. Upload files if needed. Generate diagrams, charts, or slides instantly.

Start free trial for unlimited edit
Create a file anyway
Free & Easy Powered ChatGPT, Gemini, Nano Banana Pro2 Upload files