Software Engineering Concepts
(CSC291)
Facilitator
Dr. Faisal Shafique Butt
Today’s Agenda
Objective of Analysis Modeling
Approaches of Analysis Modeling
Elements of Analysis Model
Scenario based Modeling
Narrative based
Refining preliminary use-cases
Writing Formal use-cases
Diagrammatic use-cases
Activity Diagram as supplement
Objectives of Requirement Modeling
The requirements model must achieve three primary
objectives:
(1) to describe what the customer requires
(2) to establish a basis for the creation of a software design
(3) to define a set of requirements that can be validated once the
software is built
Requirement Modeling Approaches
Two Approaches: Structured vs O-O Approach.
Although the requirements model proposed in this
book combines features of both approaches,
software teams often choose one approach and
exclude all representations from the other.
Elements of Requirement Model
The requirements model—actually a set of
models—is the first technical
representation of a system
Scenario-based models of requirements from the point of view of
various system “actors”
Class-oriented model – represents object-oriented classes (attributes
and operations) and the manner in which classes collaborate to achieve
requirements
Flow-oriented model – represent the functional elements of the system
and how they transform data as it moves through the system
Behavioral model – represent how the software behaves as a
consequence of external “events”
5
Scenario-Based Modeling
Requirements gathering meetings, and other requirements engineering
mechanisms are used to.
identify stakeholders
define the scope of the problem
specify overall operational goals
outline all known functional requirements, and
describe the things (objects) that will be manipulated by the system
To begin developing a set of use cases, list the functions or activities
performed by a specific actor.
Scenario-Based Modeling
The SafeHome home surveillance already discussed identifies the following
functions (an abbreviated list) that are performed by the homeowner (an actor):
Select camera to view
Request thumbnails from all cameras
Control pan (left & right movement) and zoom for a specific camera
Selectively record camera output
Replay camera output
Scenario-Based Modeling
The requirements gathering team develops use cases for each of the functions
noted.
In general, use cases are written first in an informal narrative fashion.
If more formality is required, the same use case is rewritten using a structured
format.
Example: Consider the function “access camera surveillance via the Internet—
display camera views”.
Narrative of homeowner about interaction.
Scenario-Based Modeling
Use case: Access camera surveillance via the Internet—display camera views
(ACS-DCV)
Actor: homeowner
If I’m at a remote location, I can use any PC with appropriate browser software to log on to the SafeHome Products website. I enter my
user ID and two levels of passwords and once I’m validated, I have access to all functionality for my installed SafeHome system. To
access a specific camera view, I select “surveillance” from the major function buttons displayed. I then select “pick a camera” and the
floor plan of the house is displayed. I then select the camera that I’m interested in. Alternatively, I can look at thumbnail snapshots from
all cameras simultaneously by selecting “all cameras” as my viewing choice. Once I choose a camera, I select “view” and a one-frame-
per-second view appears in a viewing window that is identified by the camera ID. If I want to switch cameras, I select “pick a camera”
and the original viewing window disappears, and the floor plan of the house is displayed again. I then select the camera that I’m
interested in. A new viewing window appears.
Scenario-Based Modeling
A variation of a narrative use case presents the interaction as an ordered
sequence of user actions.
1. The homeowner logs onto the SafeHome Products website.
2. The homeowner enters his or her user ID.
3. The homeowner enters two passwords (each at least eight characters in length).
4. The system displays all major function buttons.
5. The homeowner selects the “surveillance” from the major function buttons.
6. The homeowner selects “pick a camera.”
7. The system displays the floor plan of the house.
8. The homeowner selects a camera icon from the floor plan.
9. The homeowner selects the “view” button.
10. The system displays a viewing window that is identified by the camera ID.
11. The system displays video output within the viewing window at one frame per second.
Scenario-Based Modeling
It is important to note that this sequential presentation does not consider any alternative
interactions .
Use cases of this type are sometimes referred to as primary scenarios
Refining a Preliminary Use Case
A description of alternative interactions is essential for a complete understanding of
the function that is being described by a use case.
Therefore, each step in the primary scenario is evaluated by asking the set of
questions.
Scenario-Based Modeling
Q1: Can the actor take some other action at this point?
Q2: Is it possible that the actor will encounter some error condition at this point?
If so, what might it be?
Q3: Is it possible that the actor will encounter some other behavior at this point
(e.g., behavior that is invoked by some event outside the actor’s control)? If
so, what might it be?
EXAMPLE: Next Slide
If I’m at a remote location, I can use any PC with appropriate browser software
1. The homeowner logs onto the SafeHome Products website.
to log on to the SafeHome Products website. I enter my user ID and two levels
2. The homeowner enters his or her user ID.
of passwords and once I’m validated, I have access to all functionality for my
3. The homeowner enters two passwords (each at least eight characters in length).
installed SafeHome system. To access a specific camera view, I select
4. The system displays all major function buttons.
“surveillance” from the major function buttons displayed. I then select “pick a
5. The homeowner selects the “surveillance” from the major function buttons.
6. The homeowner selects “pick a camera.” camera” and the floor plan of the house is displayed. I then select the camera
7. The system displays the floor plan of the house. that I’m interested in. Alternatively, I can look at thumbnail snapshots from all
8. The homeowner selects a camera icon from the floor plan. cameras simultaneously by selecting “all cameras” as my viewing choice. Once
9. The homeowner selects the “view” button. I choose a camera, I select “view” and a one-frame-per-second view appears in
10. The system displays a viewing window that is identified by the camera ID. a viewing window that is identified by the camera ID. If I want to switch
11. The system displays video output within the viewing window at one frame per cameras, I select “pick a camera” and the original viewing window disappears,
second. and the floor plan of the house is displayed again. I then select the camera that
I’m interested in. A new viewing window appears.
Q2: Is it possible that the actor will
Q3: Is it possible that the actor will encounter some encounter some error condition at this
Q1: Can the actor take some other
other behavior at this point? point?
action at this point?
Again the answer to the question is “yes.” Any number of error conditions can occur as
The answer is “yes.” Referring to the
As steps 6 and 7 occur, the system may encounter a computer-based system operates. In this
free-flowing narrative, the actor may
an alarm condition. This would result in the system context, we consider only error conditions
choose to view thumbnail snapshots
displaying a special alarm notification (type, location, that are likely as a direct result of the action
of all cameras simultaneously.
system action) and providing the actor with a number of described in step 6 or step 7.
Hence, one secondary scenario
options relevant to the nature of the alarm. Because Again the answer to the question is “yes.”
might be “View thumbnail snapshots
this secondary scenario can occur at any time for A floor plan with camera icons may have
for all cameras.”
virtually all interactions never been configured. Hence, selecting “pick
a camera” results in an error condition: “No
floor plan configured for this house.” This
error condition becomes a secondary
scenario. 13
Scenario-Based Modeling
Each of the situations described in the preceding slide is characterized as
a use-case exception.
An exception describes a situation that causes the system to exhibit
somewhat different behavior
(Either) an alternative chosen by the actor
(Or) a failure condition
(Or) other behavior due to any event that is out of control of actor
Writing a Formal Use-Case
Important elements of a formal use-case
The goal in context identifies the overall scope of the use case.
The precondition describes what is known to be true before the use case is
initiated.
The trigger identifies the event or condition that “gets the use case started”.
The scenario lists the specific actions that are required by the actor and the
appropriate system responses.
Exceptions identify the situations uncovered as the preliminary use case is
refined.
Diagrammatic Representation
Ease of understanding in case of complexity
17
UML Model that Supplement the Use-Case
Developing an Activity Diagram
The UML activity diagram supplements the use case by providing a graphical
representation of the flow of interaction within a specific scenario. (Similar to
the flowchart). An activity diagram uses:
Rounded rectangles to imply a specific system function
Arrows to represent flow through the system,
Decision diamonds to depict a branching decision (each arrow coming from
the diamond is labeled),
Solid horizontal lines to indicate that parallel activities are occurring
UML Model that Supplement the Use-Case
Activity Diagram for the ACS-DCV use case
1. The homeowner logs onto the SafeHome Products website.
2. The homeowner enters his or her user ID.
3. The homeowner enters two passwords (each at least eight characters in length).
4. The system displays all major function buttons.
5. The homeowner selects the “surveillance” from the major function buttons.
6. The homeowner selects “pick a camera.”
7. The system displays the floor plan of the house.
8. The homeowner selects a camera icon from the floor plan.
9. The homeowner selects the “view” button.
10. The system displays a viewing window that is identified by the camera ID.
11. The system displays video output within the viewing window at one frame per
second.
19