You are on page 1of 11

3/1/2021

Faculty of Engineering, Science and Technology


Department of Computer Science

CPT305 Data and Process Modeling

LECTURE 4 & 5
USE CASE DIAGRAM & USE CASE
SPECIFICATIONS

Learning Objectives
2

 Demonstrate and Understand the notations used in


a use case diagram.
 The Essentials of Use Case Models- Stereotypes,
Extends, Includes
 Learn how to write the use case descriptions.
 Identify the normal flow, alternative flows and
exceptional flows.

1
3/1/2021

Use Case Diagrams


 A picture
 describes how actors relate to use cases
 and use cases relate to one another

 Diagrams are not essential


 They are helpful in giving an overview, but only
secondary in importance to the textual description
 They do not capture the full information of the actual use
cases
 In contrast, text is essential

Basic elements of Use Case Diagram

2
3/1/2021

System
 As a part of the use-case modeling, the boundaries of
the system are developed.
 System in the use-case diagram is a box with the
name appearing on the top.
 Define the scope of the system that you are going to
design

Actors
 An actor is something or someone that interacts with
the system.
 Actor communicates with the system by sending and
receiving messages.
 An actor provides the stimulus to activate an Use-case.
 Message sent by an actor may result in more
messages to actors and to Use-cases.
 Actors can be ranked: primary and secondary; passive
and active.
 Actor is a role not an individual instance.

3
3/1/2021

Finding Actors
 The actors of a system can be identified by answering
a number of questions:
 Who will use the functionality of the system?
 Who will maintain the system?

 What devices does the system need to handle?

 What other system does this system need to interact?

 Who or what has interest in the results of this system?

Use cases
 A Use case in UML is defined as a set of sequences of
actions a system performs that yield an observable result of
value to a particular actor.
 Actions can involve communicating with number of actors
as well as performing calculations and work inside the
system.
 A Use case
 is always initiated by an actor.
 provides a value to an actor.
 must always be connected to at least one actor.
 must be a complete description.

4
3/1/2021

Finding Use cases


 For each actor ask these questions:
 Which functions does the actor require from the system?
 What does the actor need to do?

 Could the actor’s work be simplified or made efficient by


new functions in the system?
 What events are needed in the system?

 What are the problems with the existing systems?

 What are the inputs and outputs of the system?

Example: Use Case Diagram

5
3/1/2021

Relationships
 Include
 The base use case explicitly incorporates the behavior of
another use case at a location specified in the base.
 The included use case never stands alone. It only occurs as
a part of some larger base that includes it.
 Extend
 The base use case implicitly incorporates the behavior of
another use case at certain points called extension points.
 Generalization
 Represents is-a relationship between use cases
 Is also used between actors
 Represented with a arrow with a triangular head

Online Shopping System


 For Example: in an online shopping system, where
the customer can place order online.

Login
Order Online

Print
Receipt

Customer

6
3/1/2021

Use Case Description


 Is a part of the use case specification
 Can be written as a paragraph
 Or a step by step actions of the actor and the
response of the system
 Write the happy day scenario

7
3/1/2021

Order online Description


 The customer opens the website and selects the
item he wants to purchase. Then places the order
and makes the payment. And a receipt is sent to
the email and shown on the screen
 Or
Actor’s Action System’s Response
1. Opens the website 2. Shows a list of items
3. Selects Items one by one 4. Adds items to a cart
5. Choses to place the order for the 6. Shows the payment form
items selected
7. Posts the credit card details 8. Shows a receipt on the screen and
sends a copy to the user email

Use Case Specification


 Contains the following components
 Name
 Name of the use case
 Actor(s)
 The list of actors that participate in the use case
 Description
 The description of the use case in either of the above format
 Goal
 The business goal that the initiating actor wants to achieve
 Preconditions
 The states in which the system must be before the use case can
start

8
3/1/2021

Use Case Specification


 Assumptions
 List of assumptions, if there are any
 Frequency
 How often the use case is realized
 Normal Flow
 Step by step description of how the things will happen
 Alternate Flow
 Step by step description how the goal may be achieved
alternatively
 Exceptional Flow
 Step by step description of how exceptional cases, the goal is not
achieved

Use Case Specification


 Post conditions
 The states in which the system can be when this use case
ends
 Included Use Cases
 The list of use cases that this use case includes
 Extended Use Cases
 The list of use cases that this use case extends
 Notes
 To-dos, concerns to be addressed…

9
3/1/2021

19

Exercise
 Draw a use case diagram to drop a subject in
student registration system, and write a use case
specification.

10
3/1/2021

Drop a subject in student registration system

 Name:
 Actor(s):
 Description:
 Goal:
 Preconditions:
 Assumptions:
 Frequency:
 Normal Flow:
 Alternate Flow:
 Exceptional Flow:
 Post conditions:
 Included Use Cases:
 Extended Use Cases:
 Notes:

11

You might also like