You are on page 1of 7

Lab#3

Introduction to UML and Use Case Diagram


Objective
How to create use case diagrams using Unified Modeling Language (UML)

Pre Lab

Introduction
The UML is the standard language for visualizing, specifying, constructing and documenting
the artifacts of a software-intensive system. UML can be used with all processes throughout the
development life cycle and across different implementation technologies. The UML is an attempt
to standardize the artifacts of analysis and design: semantic models, syntactic notation and
diagrams. The first public draft (version 0.8) was introduced in October 1995. Feedback from the
public and Ivar Jacobson's input were included in the next two versions (0.9 in July 1996 and 0.91
in October 1996). Version 1.0 was presented to the Object Management Group (OMG) for
standardization in July 1997. Additional enhancements were incorporated into the 1.1 version of
UML, which was presented to the OMG in September 1997. In November 1997, the UML was
adopted as the standard modeling language by the OMG.

Use Case Diagram

In UML there are five diagrams available to model dynamic nature and use case diagram is
one of them. Now as we have to discuss that the use case diagram is dynamic in nature there should
be some internal or external factors for making the interaction. These internal and external agents
are known as actors. So use case diagrams consist of actors, use cases and their relationships.

Use case diagrams are used to gather the requirements of a system including internal and
external influences. These requirements are mostly design requirements. So when a system is
analyzed to gather its functionalities use cases are prepared and actors are identified.

So in brief, the purposes of use case diagrams can be as follows:

 Used to gather requirements of a system.


 Used to get an outside view of a system.
 Identify external and internal factors influencing the system.
 Actors represent the interaction among the requirements.
The behavior of the system under development (i.e. what functionality must be provided by the
system) is documented in a use case model that illustrates the system's intended functions (use
cases), its surroundings (actors), and relationships between the use cases and actors (use case
diagrams.

Actors
 Are NOT part of the system – they represent anyone or anything that must interact with the
system.
 Only input information to the system.
 Only receive information from the system.
 Both input to and receive information from the system.
 Represented in UML as a stickman.

Use Case
 A sequence of transactions performed by a system that yields a measurable result of values for
a particular actor.
 A use case typically represents a major piece of functionality that is complete from beginning
to end. A use case must deliver something of value to an actor.

Figure 3.1: A Use Case Diagram

Use Case Relationships


 Between actor and use case.
 Association / Communication.
 Arrow can be in either or both directions; arrow indicates who initiates communication.

Tasks:
 Read carefully the following problem statement:

Consider a system that controls a recycling machine for returnable bottles and cans. The
machine will allow a customer to return bottles or cans on the same occasion.
When the customer returns an item, the system will check what type has been returned. The system
will register how many items each customer returns and, when the customer asks for a receipt, the
system will print out what he deposited, the value of the returned items and the total return sum
that will be paid to the customer.
The system is also be used by an operator. The operator wants to know how many items of
each type have been returned during the day. At the end of the day, the operator asks for a printout
of the total number of items that have been deposited in the machine on that particular day. The
operator should also be able to change information in the system, such as the deposit values of the
items. If something went wrong, for example if a can gets stuck or if the receipt’s roll is finished,
the operator will be called by a special alarm signal.

After reading the above problem statement, identify:


1. Actors
 Customer
• Should be able to return deposit items (i.e. cans, bottles). The use case is returning item.
• This use case should include all the events until a receipt is given
 Operator
 Should be able to get a daily report of the items deposit. This will be one use case,
Generate daily report.
 Should be able to ask for a printout of the total number of items that have been
deposited in the machine on that particular day. We will call this use case,
printout total number of items.
 Should also be able to modify information in the system, for example, each item’s
deposit value. We will call this use case, Change item
2. Use cases with each actors
3. The main use case diagram:
Solution:

Lab Assessment

Performance /5
/10

Results /2.5

Viva /2.5
Instructor Signature

You might also like