In the previous article, we learned that the role of the Use Case drawing is very important, it helps us understand the requirements, the functional architecture of the system and governs all the remaining drawings. In this article we will learn about the components that make up this drawing, how to build and use it.
Viewing: What is a use case?
1. Components in the Use Case drawing
First, let’s see an example of a Use Case Diagarm.
Figure 1. Use Case drawing of ATM application
Looking at this drawing, we see that there are two users, Customer and ATM Technician, and one user of the system is Bank. Besides, it describes the functions of the system and which users use which functions. This helps us to imagine what functions we will build the system with? For anyone to use.
Now we will take a closer look at the components of the drawing.
Actor is used to refer to a user or an external object that interacts with the system we are considering. Note, we often forget about objects that interact with the system, such as Bank above.
Actor is represented as follows:
Figure 2. Actors’ symbols
1.2 Use Cases
Use Case is the function that Actors will use. It is denoted as follows:
Figure 3. Symbol for Use Case
By defining the functions that the Actor uses, you will determine the Use Cases needed in the system.
Relationship, also known as connector, is used to connect objects to each other to create a Use Case drawing. There are the following basic types of relationships:
We will learn about the following types of relationships in turn.
+ Association Relations
Association is often used to describe the relationship between Actor and Use Case and between Use Cases.
Figure 4. Example showing Actor User using Use Case Login
Generalization is used to show inheritance relationships between actors or between use cases.
Figure 5. Example Actor User inherits all rights of Actor Guest
+ Relationship Include
Include is the relationship between use cases, it describes how a large use case is divided into small use cases for ease of implementation (modularization) or to demonstrate reuse.
Figure 6. Example of Include relationship between Use Cases
We see Use Case “Verify Password” can be included in Use Case Login, but here we separate it for other Use Cases to use or to modularize for easy understanding and installation.
+ Extend relationship
Extend is used to describe the relationship between two use cases. Extend relationship is used when a Use Case is created to add functionality to an existing Use Case and is used under a certain condition.
Figure 7. Example of Extend relationship between Use Cases
In the above example “Open Account” is the basic Use Case for the customer to open an account. However, there is an additional condition that if the customer is a company, an owner can be added to this account. Add Account Holder is an extension of Use Case “Open Account” for a specific case if the Actor is a Company, so its relationship is an Extend relationship.
1.4 System Boundary
System Boundary is used to define the scope of the system we are designing. Objects outside this system that interact with the system are called Actors.
System Boundary will make it easier for us to understand when dividing large systems into subsystems for analysis and design.
See also: What is Btcv?
2. Steps to build Use Case Diagram
Now that we know the symbols of the Use Case drawing, it’s time to figure out how to put them back together to create the complete drawing. Follow these steps to build a Use Case drawing:
+ Step 1: Find the Actor
Answer the following questions to determine the Actor for the system:
– Who uses this system?
– What systems interact with this system?
Considering the ATM example above we see:
– Who uses the system? -> Customer, ATM Technician
– What systems interact with this system? -> Bank
Thus, there are 03 Actors: Customer, ATM Technician and Bank
+ Step 2: Find the Actor
Answer the question What functions do Actors use in the system? We will define the necessary Use Cases for the system.
Looking at the example above, we see:
Customer uses the functions: Check Balance, Deposit, Withdraw and TransferATM technician uses: Maintenance and RepairBank to interact with all the above functions.
In short, we must build a system with functions: Check Balance, Deposit, Withdraw, Transfer, Maintenance and Repair to meet the needs of users and interactive systems.
+ Step 3: Identify relationships
Analyze and define the relationship types between Actors and Use Cases, between Actors, between Use Cases and then join them together, we will get Use Case drawings.
Figure 8. Use Case drawing of ATM
3. Use Case Specification
Looking at the drawing above, we know what functions the system needs and who uses it. However, we do not know how they work? How to use them? To better understand our system Use cases need to be specified.
There are two ways to specify use cases.
Method 1: Write specifications for Use Cases
We can write the Use Case specification in the following pattern:
Use Case Name //Account DetailsUse Case Number //UCSEC35 Brief Description// Display detailed information of AccountExecution steps // List execution steps Exit condition // When user clicks Close buttonSpecial requirements special // Specify if yes Pre-requirements // Must login Conditions after implementation // Specify the conditions if any after executing this Use Case
Method 2: Use drawings for specification
We can use drawings like Activity Diagram, Sequence Diagram to specify Use case. We will discuss these drawings in the next articles.
4. Using UseCase Diagram
As we all know Use Case Diagram has a particularly important role in system analysis, design and development process. Below we list some typical uses of Use Case Diagram.
– Analyze and understand the system
– System design.
– As a basis for developing and checking drawings such as Class Diagram, Activity Diagram, Sequence Diagram, Component Diagram.
– Serve as a basis to communicate with customers and investors.
Help with functional testing, acceptance testing.
At this point, we have learned the first and very important use case diagram, you need to continue practicing to better understand this drawing as well as how to build and use them in the process. software product development.
See also: What is a Scenario – Meaning of the word Scenario
To help you better understand the Use Case drawing in the next lesson, we will go through step by step practice building Use Case Diagram.