
The use case diagram is a visual representation of the system’s functionality as seen and understood by the users. This diagram is widely used in software engineering to model the interactions between actors and the system under development. It helps to identify the different use cases, their relationships, and the functionality they provide.
The use case diagram includes actors, use cases, and the relationships between them. Actors represent the roles that interact with the system, while use cases represent the specific tasks or goals that the system performs. The relationships between actors and use cases can be simple associations or more complex relationships like includes and extends.
Includes and extends are two types of relationships that can be captured in a use case diagram. The include relationship represents a relationship between two use cases, where the behavior of one use case is included in another use case. This relationship is used to represent common behavior that is shared between multiple use cases. On the other hand, the extend relationship represents a relationship between two use cases, where the behavior of one use case can be extended by another use case. This relationship is used to represent optional behavior that can be added to a use case based on certain conditions.
In this article, we will provide an example of a use case diagram that includes and extends use cases. We will demonstrate how these relationships can be used to model complex systems and capture the interactions between actors and use cases. This example will serve as a guide to help you understand the use of include and extend relationships in use case diagrams and how they can enhance the functionality of a system.
What is a Use Case Diagram?

A use case diagram is a visual representation of the interactions between different users (actors) and the system in a specific scenario or process. It is a powerful tool used in software engineering to analyze, design, and document the functionality of a system.
In a use case diagram, the main components are actors and use cases. Actors represent the users or entities that interact with the system, while use cases depict the specific tasks or functions that the system performs. The diagram also shows the relationships and dependencies between different use cases, as well as the flow of information between actors and use cases.
The use case diagram is beneficial in several ways. Firstly, it helps to identify all the possible interactions between actors and the system, ensuring that all the necessary functionalities are accounted for. It also aids in understanding the different roles and responsibilities of each actor, clarifying the system’s overall functionality.
In addition, the use case diagram serves as a communication tool between developers, designers, and stakeholders. It provides a clear visual representation of the system’s behavior and allows for easy discussion and feedback, ensuring that everyone involved has a shared understanding of the system’s functionality.
Key concepts in a use case diagram:

- Actors: Users or entities that interact with the system.
- Use Cases: Specific tasks or functions performed by the system.
- Relationships: Dependencies and associations between actors and use cases.
- System Boundary: The boundary that separates the system from external factors.
- Include: When one use case is included in another use case.
- Extend: When one use case extends the behavior of another use case.
In conclusion, a use case diagram is a valuable tool in software engineering that helps to analyze, design, and document the functionality of a system. It provides a visual representation of the interactions between users and the system, allowing for easy communication and understanding of the system’s behavior.
Use Case Diagram Example
A use case diagram is a visual representation of the interaction between systems and actors in a particular scenario or system. It helps to identify the different functionalities of a system and how different users interact with it. By using this diagram, one can easily understand the various use cases and their relationships within a system.
Let’s consider an example of a library management system. The primary actors in this system are the Librarian and the Library Member. The Librarian is responsible for managing books, issuing and returning books, and keeping track of the library’s inventory. On the other hand, the Library Member can search for books, borrow and return books, and view their account information.
The main use cases in this system include “Search Books,” “Issue Book,” “Return Book,” and “View Account Information.” These use cases represent the different functionalities that the system provides. The Librarian can execute all these use cases, while the Library Member can only perform actions related to borrowing and returning books.
The use case “Search Books” allows both the Librarian and the Library Member to search for books based on different criteria such as title, author, or subject. The use case “Issue Book” enables the Librarian to issue a book to a Library Member, while the use case “Return Book” allows the Librarian and the Library Member to return a borrowed book. The use case “View Account Information” allows the Library Member to view their account details such as borrowed books, due dates, and fines.
In this example, we can see that the use case “Issue Book” and “Return Book” extend the use case “Search Books.” This means that before issuing or returning a book, the Librarian or the Library Member needs to search for the book first. The “Search Books” use case is the base use case, and the “Issue Book” and “Return Book” use cases enhance its functionality by adding extra steps.
Overall, a use case diagram example helps to illustrate the functionalities of a system and the interactions between its actors. It provides a clear overview of how different use cases are related and helps stakeholders understand the system’s behavior at a higher level.
Benefits of Use Case Diagrams

Use case diagrams play a significant role in software development as they provide a visual representation of how a system or application should function from a user’s perspective. These diagrams help in capturing functional requirements and defining the scope of the system, making them an essential tool for communication between stakeholders, designers, and developers.
1. Improved Communication and Collaboration: Use case diagrams provide a clear and concise way to depict the interactions and relationships between system actors and their corresponding use cases. This visual representation allows stakeholders to easily understand the system’s behavior and functionality, fostering effective communication and collaboration.
2. Requirements Validation: By using use case diagrams, stakeholders can validate the system requirements and ensure that they accurately reflect the intended functionality. These diagrams act as a blueprint for the system, allowing stakeholders to identify any potential gaps, redundancies, or inconsistencies in the requirements, thus preventing costly errors and rework.
3. Scope Definition: Use case diagrams help in defining the scope of a system by identifying the actors (users or external systems) and their interactions with the system. This allows designers and developers to focus on the essential functionalities and prioritize their implementation, leading to a more efficient development process.
4. Test Case Generation: Use case diagrams provide a basis for generating test cases during the testing phase of software development. By mapping test scenarios to the defined use cases, testers can ensure comprehensive test coverage and verify that the system meets all the specified requirements and user expectations.
5. Design and Implementation Guidance: Use case diagrams serve as a guide for the design and implementation process by providing a high-level view of the system’s behavior and functionality. Designers and developers can refer to these diagrams to understand the user interactions, system responses, and overall flow of the system, enabling them to make informed design decisions and ensure a cohesive and user-friendly implementation.
In summary, use case diagrams offer numerous benefits throughout the software development lifecycle. From facilitating communication and collaboration to validating requirements, defining the system scope, generating test cases, and guiding the design and implementation process, use case diagrams contribute significantly to the success and efficiency of software development projects.
How to Create a Use Case Diagram

A use case diagram is a powerful tool in the field of software development and system analysis. It helps to visualize the functional requirements of a system and capture the interactions between different entities, including actors and use cases. By creating a use case diagram, you can gain a better understanding of the system’s behavior and identify any potential gaps or inefficiencies.
Here are some steps to help you create a use case diagram:
- Identify the actors: Actors are the entities that interact with the system. They can be human users, external systems, or even other software modules. Start by identifying all the actors that are relevant to your system.
- List the use cases: Use cases represent the functionalities or tasks that the system needs to perform. Think about all the possible actions that the actors can take and list them as use cases.
- Create relationships: Once you have identified the actors and use cases, you need to establish the relationships between them. Use arrows to indicate the interactions, with the arrow pointing from the actor to the use case.
- Add additional details: You can add more details to your use case diagram to enhance its clarity and usefulness. For example, you can include descriptions for each use case, indicating the steps or actions involved.
- Consider include and extend relationships: Use cases can be further enhanced by using include and extend relationships. An include relationship signifies that one use case includes the behavior of another use case, while an extend relationship indicates optional or alternative behavior.
- Review and refine: After creating the initial draft of your use case diagram, take the time to review and refine it. Make sure that all the actors and use cases are captured accurately, and that the relationships are clearly defined.
A well-designed use case diagram can be a valuable tool in the software development process. It can help you communicate the requirements of the system to stakeholders, identify potential issues or improvements, and serve as a blueprint for further development and testing. By following the steps outlined above, you can create an effective use case diagram for your system.
Use Case Diagram Symbols

A use case diagram is a visual representation of the interactions between actors and use cases within a system. It is a powerful tool for understanding and documenting the functional requirements of a system. There are several symbols used in use case diagrams to represent actors, use cases, and relationships between them.
Actors
Actors are the users or external systems that interact with the system being modeled. They are represented as stick figures in use case diagrams. Each actor has a specific role or responsibility within the system. Actors are connected to use cases using association lines.
Use Cases

Use cases represent the functionality or behavior of the system from the user’s perspective. They describe the actions or interactions that the system can perform. Use cases are represented as ovals or ellipses in use case diagrams. Each use case has a name that describes its purpose. Use cases are connected to actors using association lines.
Relationships

There are several types of relationships that can be depicted in use case diagrams:
- Association: An association line connects an actor to a use case, representing that the actor is involved in or interacts with that use case.
- Generalization: A generalization relationship is used to represent inheritance between actors or use cases. It is depicted by an arrow with an open triangle.
- Inclusion: An inclusion relationship shows that one use case includes another use case. It is represented by a dashed line with an open arrow pointing to the included use case. The included use case is a part of the behavior of the including use case.
- In addition there are several other types of relationships, such as extend, dependency, and realization, which can be used to model different dependencies and interactions between actors and use cases.
By using these symbols, a use case diagram provides a clear and concise representation of the functional requirements of a system and helps stakeholders understand the interactions between actors and use cases.
Summary
The use case diagram is a powerful tool for visualizing the functionality of a system and capturing the interactions between its actors and use cases. In this article, we have explored the concept of include and extend relationships in use case diagrams.
We have seen how include relationships allow us to incorporate common behavior into multiple use cases by drawing an arrow from the base use case to the included use case. This helps to avoid redundancy and promotes reusability in the system design.
Similarly, extend relationships allow us to define optional or extended behavior in a use case by drawing an arrow from the base use case to the extending use case. This allows for the flexibility of adding extra functionality without modifying the base use case.
To illustrate these concepts, we have provided an example of a use case diagram for an online shopping system. The diagram demonstrates how include and extend relationships can be used to model the various interactions between actors and use cases in the system.
By incorporating include and extend relationships in our use case diagrams, we can create more comprehensive and flexible system designs that accurately capture the desired functionality and interactions. These relationships help to improve the readability, maintainability, and modularity of the system, making it easier to understand and update in the future.
Overall, understanding and effectively using include and extend relationships in use case diagrams can greatly enhance our ability to design and communicate the requirements of a system. It is an invaluable technique for system analysts, designers, and developers throughout the software development lifecycle.