UML Use Case Diagrams
An important part of the Unified Modeling Language (UML) is the facilities for drawing use case
diagrams. Use cases are used during the analysis phase of a project to identify and partition system
functionality. They separate the system into actors and use cases.
Actors represent roles that can are played by users of the system. Those users can be humans, other
computers, pieces of hardware, or even other software systems. The only criterion is that they must be
external to the part of the system being partitioned into use cases. They must supply stimuli to that part of
the system, and the must receive outputs from it.
Use cases describe the behavior of the system when one of these actors sends one particular stimulus. This
behavior is described textually. It describes the nature of the stimulus that triggers the use case; the inputs
from and outputs to other actors, and the behaviors that convert the inputs to the outputs. The text of the
use case also usually describes everything that can go wrong during the course of the specified behavior,
and what remedial action the system will take.
For example, consider a point of sale system. One of the actors is the customer and another is the sales
clerk. Here is just one use case from this system:
Use Case 1: Sales Clerk checks out an item
1. Customer sets item on counter.
2. Sales clerk swipes UPC reader across UPC code on item
3. System looks up UPC code in database procuring item description and price
4. System emits audible beep.
5. System announces item description and price over voice output.
6. System adds price and item type to current invoice.
7. System adds price to correct tax subtotal
Error case 1: UPC code unreadable
If after step 2, the UPC code was invalid or was not properly read, emit an audible ‘bonk’ sound.
Error case 2: No item in database
If after step 3 no database entry is found for the UPC flash the ‘manual entry’ button on the
terminal. Accept key entry of price and tax code from Sales Clerk. Set Item description to
“Unknown item”. Go to step 4.
Clearly a point of sale system has many more use cases than this. Indeed, for a complex system, the
number can reach into the thousands. The complete functionality of the system can be described in use
cases like this. This makes use cases a powerful analysis tool.
Drawing Use Case Diagrams.
Figure 1 shows what the above use case might look like in UML schematic form. The use case itself is
draws as an oval. The actors are drawns as little stick figures. The actors are connected to the use case