Use Case Diagram Explained
Use cases and use case diagrams are invaluable tools for business analysts and developers, providing the essence of design and usage requirements. They are also useful overviews to present to project stakeholders and management. Once properly understood, use cases are powerful instruments for those assessing the function and value of a system.
In simple terms, a use case is a list of interactions between a user and a system, which must be performed to achieve a specific goal.
A use case encompasses a list of sequential actions that provide a measurable value to a user, who is trying to achieve a certain goal by interacting with a system. A use case can be thought of as a collection of possible scenarios related to a particular goal. Creating the use case is a fundamental methodology used in system analysis to identify, simplify, clarify, and organize system requirements.
Things to consider when writing a use case:
- Who is the user, and what is the system that the user is interacting with?
- What goal is a user – in the role of an actor – trying to accomplish?
- To fulfill their role as actors, what do users need to be able to do?
- What must the system be capable of, in order to enable users to do these things?
- What information must be exchanged between the user and the system?
- What are the main tasks of the actor and the system?
Identify the Actor
Actors are the users that interact with the system. In order to fulfill their role as an actor in a given use case, users must perform tasks relevant to the system’s capacity to help them achieve their goal. An actor can be a human being, an entity, a different (external) system, or simply the passage of time.
Identify the Goal
Use cases are initiated by a user trying to fulfill a goal by interacting with a system. The goal should be a specific “verb” or “verb+noun” that the actor is using the system to achieve. This will clarify the system's function – that is, the specific options that the system must be provide, to enable the the user to achieve their goal.
Outline the System
The system is what that the actor is interacting with in order to achieve a specific goal. The use case should capture functional requirements that specify the intended behavior of the system.
List the Interactions
The list consists of a set of possible sequences of interactions between the system and the actor, in a given environment, and pertaining to a particular goal. The use case should include all potential system activities that have significance to all potential users.
Use Case Example:
Suppose you want to write a use case for a system like an online marketplace, such as eBay or Amazon. With systems this complex, there are many users and many goals, but for this exercise, we will stick with the two primary actors: buyers and sellers. Once we’ve determined who the actors are, we must determine what goals the actors are trying to achieve through the system: They buyers are trying to make a purchase, and the sellers are trying to make a sale.
Let’s make a list of possible actors, goals, and interactions between the actors and the system (the website), that are necessary for each actor to achieve his or her goal.
System: Online Marketplace
Actor’s Goal: Make a purchase
Actors’s Interactions with the System:
- Buyer Creates Account
- Buyer Searches Listings
- Buyer Places Order
- Buyer Purchases Item
System: Online Marketplace
Actor’s Goal: Make a sale
Actor’s Interactions with the System:
- Seller Creates Account
- Seller Searches Listings
- Seller Creates Listing
- Seller Ships Item
This use case has clearly identified the actors and the system, defined their goals, and listed the interactions necessary for the goals to be achieved.
Use Case Diagram
Once you’ve outlined your use case, you can assemble this information in the form of a use case diagram. Use case diagrams are the “blueprints” of your system. Use case diagrams are meant to be simple and clear, and function on the level of abstraction appropriate for your current analysis.
This is a use case diagram for the previous example:
The use case diagram is a visual representation of the use case, which clearly defines the users, and the interactions that they can have with the system, with respect to their goals. The diagram follows a general format: