REQ - Lecture 4

Download as pdf or txt
Download as pdf or txt
You are on page 1of 34

61FIT3REQ – Software Requirements Analysis

Lecture 4

Use case modeling


Activity diagram

Faculty of Information Technology


Hanoi University
Part 1

USE CASE MODELING


Use case diagram
• Purpose: Analyze/record the functional
requirements of a system.
• Use case: a function that the system performs
– Usually in response to a trigger from an actor
• Actor: An external entity that interacts with a
system
– An actor is usually a user role but can also be an
external system
• Use case modeling is part of the Unified Modeling
Language (UML)
Example use case diagram
Hotel room reservation system
Association System boundary

Example use case diagram

A part of the project


control system

Actor
Use Case Symbols
• Actor is a role, not an individual.
– Involved with the functioning of the system at
some basic level
– Represented by stick figures
• Use case represents a single system function.
– Represented as an eclipse
Use Case Symbols
• System boundary includes all the relevant use
cases.
– A boundary is the dividing line between the
system and its environment
– Use cases are within the boundary
– Actors are outside of the boundary
– Represented as a box
• It is presented as use case subject in the UML
standard.
Use Case Symbols
• Connection is an association between an actor
and a use case.
– Depicts a usage relationship
– Connection does not indicate data flow
– Actors are connected to use cases with lines
– Use cases are connected to each other with
arrows
Generalization
• Generalization in use case diagram
– Similar to generalization between classes in class
diagram.
• Two usages:
– Between actors
– Between use cases
Generalization
<<include>> and <<extend>>
• <<include>>
– In a system, certain actions may be repeated
– Such a general-purpose action can be written as a
separate use case and then be used by / contained
in other use cases
• <<extend>>
– An extend relationship extends a use case by
adding new behaviors or actions
– The extending use case has all the actions in the
original one, and some more
– Specialized use case extends the general use case
<<include>> relationship
• <<include>> can be used to decompose a use
case into smaller use cases.
• The source use case is incomplete without the
included use cases.

Image Credit: uml-diagrams.org


<<include>> relationship
• <<include>> can be used to reuse a common
use case.

Image Credit: uml-diagrams.org


<<include>> example
<<extend>> example
Written use cases
• Document containing detailed specifications
for a use case
• Contents can be written as simple text or in a
specified format
• Step-by-step description of what must occur
in a successful use case
• Each ellipse in the use case diagram should
have a corresponding written use case.
A template for written use cases
Written Use Case Guidelines
• ID & Name – descriptive name, matches name
in use case diagram

• Primary Actor – usually a user role

• Stakeholders – any group or individual with an


interest in the function of the use case
Written Use Case Guidelines
• Trigger – an event or action that initiates the
use case

• Pre-conditions – conditions that must be


satisfied in order to execute the use case

• Post-conditions – outputs that can be


expected if the service succeeds
Written Use Case Guidelines
• Normal Flow – description of sequence of
interactions between actor and use case
during the use case execution

• Alternative flows – scenarios which are


different from normal flow but still deliver the
same business outcome

• Exceptions – potential conditions that prevent


a use case from succeeding
Example written
use case:
Make reservation
Part 2

ACTIVITY DIAGRAM
Process Modeling: Activity Diagrams
• Activity Diagrams
– Show the conditional logic for the sequence of
system activities needed to accomplish a business
process.
– Clearly show parallel and alternative behaviors.
– Can be used to show the logic of a use case.
A simple activity diagram
for ordering pizza
Use Activity Diagrams to:
• Depict the flow of control from activity to
activity.
• Help in use case analysis to understand what
actions need to take place.
• Help in identifying extensions in a use case.
• Model work flow and business processes.
• Model the sequential and concurrent steps in
a computation process.
Basic notations for Activity Diagrams
Elements of Activity Diagrams
• Activity: a behavior that an object
carries out while in a particular state
• Branch: a diamond symbol
containing a condition whose results
provide transitions to different paths
of activities
• Merge: a circular symbol where
different paths converge
Elements of Activity Diagrams
• Fork: the beginning of parallel activities

• Join: the end of parallel activities

• Swimlanes: columns representing different


organizational units of the system
Example of an Activity Diagram
with 4 Swimlanes
Purchasing, Fulfillment,
Customer Service, Accounting
From Use Case to Activity Diagram
• A flowchart or a UML activity diagram
is a useful way to visualize a (complex)
use case

• These diagrams show the decision points


and conditions that cause a branch from
the normal flow into an alternative flow
References
• Valacich, J. S., George, J. F., & Valacich, J. S.
(2020). Modern Systems Analysis and Design, 9th
Edition. Pearson.
• Wiegers, K., & Beatty, J. (2013). Software
requirements, 3rd Edition. Microsoft Press.

You might also like