0
0
Software Engineeringknowledge~6 mins

Use case diagrams in Software Engineering - Full Explanation

Choose your learning style9 modes available
Introduction
When building software, it can be hard to understand what users need and how they will interact with the system. Use case diagrams help by showing these interactions clearly, making it easier to design and communicate the system's functions.
Explanation
Actors
Actors represent people or external systems that interact with the software. They show who uses the system or who the system communicates with. Actors help identify the roles involved in the system's operations.
Actors define the users or external systems interacting with the software.
Use Cases
Use cases describe specific actions or services the system provides to actors. Each use case represents a goal or task that an actor wants to achieve using the system. They help clarify what the system should do from the user's perspective.
Use cases capture the goals or tasks users want to accomplish with the system.
Relationships
Relationships connect actors and use cases to show interactions. Common types include associations (who uses what), includes (shared steps between use cases), and extends (optional or conditional steps). These links explain how parts of the system work together.
Relationships illustrate how actors and use cases interact and depend on each other.
System Boundary
The system boundary is a box that encloses all use cases, showing what is inside the system and what is outside. It helps separate the system's responsibilities from the external environment. This boundary clarifies the scope of the system.
The system boundary defines what functions belong to the system and what lies outside.
Real World Analogy

Imagine planning a party where guests (actors) want to do things like eat, dance, or chat (use cases). The party organizer draws a map showing who does what and how activities connect, helping everyone understand the plan clearly.

Actors → Guests at the party who participate in activities
Use Cases → Activities like eating, dancing, or chatting that guests want to do
Relationships → Connections showing which guests join which activities and how activities relate
System Boundary → The party area that contains all planned activities, separating it from outside
Diagram
Diagram
┌─────────────────────────────┐
│         System Boundary      │
│  ┌───────────────┐          │
│  │ Use Case 1    │◄─────┐   │
│  └───────────────┘      │   │
│  ┌───────────────┐      │   │
│  │ Use Case 2    │◄─────┘   │
│  └───────────────┘          │
│                             │
│  Actor A ──────────────►     │
│  Actor B ──────┐             │
│                └─────────►   │
└─────────────────────────────┘
This diagram shows actors outside the system boundary interacting with use cases inside the system.
Key Facts
ActorAn entity outside the system that interacts with it, such as a user or another system.
Use CaseA specific function or goal that an actor wants to achieve using the system.
AssociationA relationship showing which actors participate in which use cases.
Include RelationshipA use case that is always called as part of another use case.
Extend RelationshipA use case that adds optional or conditional behavior to another use case.
System BoundaryA box that defines the scope of the system by enclosing its use cases.
Common Confusions
Actors are often mistaken for users only.
Actors are often mistaken for users only. Actors can be any external entity interacting with the system, including other systems or devices, not just human users.
Use cases are thought to describe how the system works internally.
Use cases are thought to describe how the system works internally. Use cases focus on what the system does for actors, not the internal implementation details.
The system boundary is sometimes ignored or misunderstood as a physical boundary.
The system boundary is sometimes ignored or misunderstood as a physical boundary. The system boundary is a conceptual box that defines what is inside the system's scope, not a physical or hardware boundary.
Summary
Use case diagrams help visualize how users and external systems interact with software by showing actors and their goals.
Actors represent who interacts with the system, while use cases represent what the system does for them.
Relationships and system boundaries clarify how parts connect and what the system includes.