You are on page 1of 17

Use Case Diagram

1. Introduction:
 Use Case Diagram is used to model functional requirement of the proposed
system.
 Functional Requirement or function or operation or capability to be performed
by system is represented in the form of use cases in use case diagram. Use Case
diagram does not cover the nonfunctional requirement.
 Name of Use Case Should always start with Verb Phrase.

2. Components of Use Case Diagram:

i) Actor: It interacts with the functionality provided by system. It can be person,


system, office. e.g. Customer, Admin, Bank.
ii) Use Case: Function or Operation to be performed by the system. Example:
Withdraw Money, Enquire Balance, Transfer Fund, Make Order, Make Payment,
Add to Cart.
iii) System Boundary Box: All use cases are included within system boundary box
and actors are placed around system boundary box.
iv) Relationship Between Actor and Use Case
v) Relationship among Use Cases: include, extend, generalization
vi) Relationship among Actor(s): generalization

1
3. Symbols Used in Use Case Diagram
SN Components Symbols Used Remarks
1 Actor Stick Man Symbol

2 Use Case Ellipse

3 Interaction Between Straight Line


Actor and Use Case
4 System Boundary Box Rectangle

Relationship Among Use Cases


4 include Dotted Arrow with
include stereotype
above. The arrow
should be pointed
towards
dependent use
case.
extend Dotted Arrow with
extend stereotype
above. The arrow
should be pointed
towards base use
case.
Generalization Inheritance Arrow
pointed towards
parent use case

Relationship Among Actors


4 Generalization Inheritance Arrow
pointed towards
parent Actor

2
4. Steps to Draw Use Case Diagram

i. Draw System Boundary Box


ii. Write the name of system at the top center corner of system boundary box
iii. Identify Actor(s) in the system and put actor(s) around the system boundary box
iv. Identify the Functional Requirement Actor wise.
v. Identify Relationship Between Actor and Use Case
vi. Identify Relationship among use cases(s).
vii. Identify Relationship Among Actor(s), if any.

5. Types of Relationship in a Use Case Diagram


i. include: It is used in following condition:
 While executing a particular use case, another use case must be compulsorily
executed. Without executing the second use case, first use case is not complete.
 Whenever a use case expects certain functionality from another use case.

Figure: (a)

Figure: (b)

3
Figure: (c)

Figure: (d)
ii. extend: It is used in following condition:

 While executing a particular use case, some use cases are optionally executed
 While executing a particular use case, some error might occur.

Figure: a

Figure: b

4
iii. Generalization: It is used in following situation:

There exists many option(s) while executing a particular use case.

6. Relationship among Actor(s)


Relationship among actor can be represented using Generalization as following:

Figure: a

Figure: b

5
7. Relationship between Actor and Use Case.
In following situation, there exists relationship between an actor and use case.
 Whenever an actor receives information provided by a use case.
 Whenever an actor provides information to use case.
 Whenever a use case is executed by an actor.

8. Types of Actors

 Primary Actor: Whenever a use case is directly executed by an actor, then such actor is
called Primary Actor. Example: Librarian is primary actor for Add Books use case since
adding books in Library is done by Librarian .
 Secondary Actor: Whenever a use case is not directly executed by the actor. For example:
Librarian is secondary actor to Borrow Book use case. The reason is: Book is not borrowed
by Librarian, but by the Student. So, whenever user wishes to borrow a book from library,
he asks librarian and librarian makes borrowing related functionality into the system.
Note: Primary Actor(s) is usually represented at Left Side of Use Case Diagram and
Secondary actor(s) are represented at right side of the use case diagram. However, this is not
the UML convention. It means even if u keep Secondary Actor at Left Side, it will not make
your use case diagram incorrect.

6
Case Study#1: E-Commerce System
There are two types of customers in an e-commerce system. They
are: New Customer and Old customer. There is facility in the
system for user to view product. User can view product without
logging into the system. However, user must have to login to the
system while placing an order. While placing order, sometimes
users are provided an attractive discount. Customers can make
payment to the order that he/she has placed. Payment can be
made online or offline. User must have to login to the system in
order to cancel the order that has been already placed. Once an
order has been confirmed by customer, Bank will receive
notification.
Once an admin user login to the system, he should be able to view
status of various orders that has been placed by customer as well
as view overall e-commerce transaction recorded in the system in
the form of some report.
Example #1: Use Case Diagram for E-Commerce System

7
Example#2: Draw Use Case Diagram
College Student Records System
You have been asked to look into developing a new system for a College. Currently the Student
Records System is entirely manual. When a new student enrols, he/she completes an enrolment
form, pays fees and the Registrar places the form in a filing cabinet.
When a student leaves, he/she completes a withdrawal form and the registrar files this with the
enrolment form. If the student's details change, the registrar will record this on the form. When a
student passes a course, the lecturer records this into the system – this result form is stored with
the enrolment record.

8
Example #3 Draw Use Case Diagram for following case Study

9
Solution: Example#3

10
Example #4

11
Solution: Example#4: Saloon Management System

12
Case Study# Darpan Dental Home Application
List of Functional Requirement
Actor Use Case
Patient Book Appointment
Register Patient
Set Reminder
View Appointment
Update Appointment
View Profile
Update Profile
Send Feedback
Generate Report
Update Record
Admin
Send Auto Reminder Message
Generate Report
Cancel Appointment
Register Staff
Deregister Staff
Automatically De-Register Staff
Staff Maintain Payment Details
Maintain Patient Checkup Details
Confirm Registration

Solution:

13
Develop High Level and Expanded level description for following use case of College Student
Record System Case Study above:
a )Enroll Student
b) Withdraw Student
High Level Description
 Name: Enroll Student
 Actor(s): Registrar(Initiator), Student
 Description: A new student wishing to enroll on his desired course fills enrollment form
and gives it to the registrar. Registrar collects the required fee and enrolls student on his
choosen course.

14
Expanded Level Description
 Name: Enroll Student
 Actor(s): Registrar
 Purpose: Record Student’s enrollment details
 Overview: A student completes enrollment form and gives it to the Registrar. The Registrar
informs the student of the enrollment fee and after student has paid, the Registrar records
student details and issues and id card-with a unique student id number.
 Type: Primary, Essential
 Action Steps:

Actor Action System Response


1. Student arrives at the college office with a
complete enrollment form and gives it to the
registrar. Registrar makes enquiry regarding the
course fee for student’s desired course.
2. Shows the course fee for the
desired course
3. Student pays the fee and Registrar records this.
4. Registrar records student details from the
enrollment form
5. Stores/Updates student and
enrollment details
6. Generate a unique student id
together with confirmation of
student enrollment details
7. Registrar issues and id card to the student.

 Alternative Course of action:


Line 2:
If the fee is requested for a non-existent course, the system will flag an error and the
Registrar will check t correct course details and re-request.
Line-5:
If the student appears to have enrolled previously at the college (by comparing old details
on the data base and new details on the form), the Registrar is asked to confirm this and
the student's old id number is allocated to the chosen subject again.

15
Action Steps for Withdraw Student Use Case
Actor Action System Response
1. Student arrives at the college Office
with a completed withdrawal form and
presents it to the Registrar.
2. The Registrar makes an enquiry
regarding to which course that
particular student is enrolled
3. System displays Enrollment
information
4. Registrar goes through the withdrawal
form submitted by student and removes
student from the particular course
5. Withdraws student from the selected
subject
6. Confirms Withdrawal
7. Student gets withdrawal notification

16

You might also like