Chapter2_ModelingWithUML
Chapter2_ModelingWithUML
• What is UML?
• A more detailed view on
Use case diagrams
Class diagrams
Sequence diagrams
Activity/Statecharts diagrams
2
UML Basic Notation
UML provides a wide variety of notations for
modeling many aspects of software systems
UML diagrams cover the three fundamental
models for software design:
• Functional model: Use case diagrams
• Object model: Class diagrams
• Dynamic model: Sequence diagrams, statechart diagram
3
UML
• Use case diagrams
• Describe the functional behavior of the system as seen
by the user
• Class diagrams
• Describe the static structure of the system: Objects,
attributes, associations
• Sequence diagrams
• Describe the dynamic behavior between objects of the
system
• Statechart diagrams
• Describe the dynamic behavior of an individual object
• Activity diagrams
• Describe the dynamic behavior of a system, in
particular the workflow.
4
UML Use Case
Diagram
5
UML :Use case diagrams
Classifier
Use
Case
Actor
.
System
boundary
7
Actors
An actor is a model for an
external entity which interacts
(communicates) with the system:
• User
• External system (Another system)
• Physical environment (e.g. Weather)
8
Use
A use case represents a class of
Case
functionality provided by the
system
Use cases can be described
textually, with a focus on the
event flow between actor and
system
PurchaseTicket The textual use case description
consists of 6 parts:
1. Unique name
2. Participating actors
3. Entry conditions
4. Exit conditions
5. Flow of events
6. Special requirements.
9
Textual Use Case
Description PurchaseTicket
Example Passenger
• (Better): System
delivered ticket
Use Cases can be related
• Extends Relationship
• To represent seldom invoked use cases or exceptional
functionality
• Includes Relationship
• To represent functional behavior common to more than
one use case.
11
The <<extends>>
• <<extends>>
Relationship model exceptional or seldom
relationships
invoked cases
• The exceptional event flows
Passenger are factored out of the main
event flow for clarity
• The direction of an
<<extends>> relationship is
PurchaseTicket to the extended use case
• Use cases representing
<<extends>> exceptional flows can extend
more than one use case.
<<extends>>
<<extends>>
OutOfOrder <<extends>> TimeOut
Cancel NoChange
12
The <<includes>> Relationship
<<includes>>
relationship represents
common functionality
needed in more than one
Passenger use case
• <<includes>> behavior is
PurchaseMultiCard factored out for reuse, not
because it is an exception
PurchaseSingleTicket • The direction of a
<<includes>> <<includes>> relationship
<<includes>> is to the using use case
(unlike the direction of the
<<extends>> relationship).
CollectMoney
<<extends>> <<extends>>
<<extends>>
Actor
.
System
boundary
14
Historical Remark: UML 1 used
packages
Package
Course
GiveLecture
Instructor
HoldExercise
Student
Teaching DoHomework
Assistent
15
UML Class
Diagram
16
UML: Class diagrams
Associatio
n Clas
s
Multiplici
Simple
ty Watch
2 1 1 1 1 1 2 1
PushButton Display Battery Time
TarifSchedule
Trip
Table zone2price
zone:Zone
* Price: Price
Enumeration
getZones()
Price getPrice(Zone) 19
*
Classe Typ
s e TarifSchedule Table
zone2price
Enumeration getZones()
Name Price getPrice(Zone)
TarifSchedule
zone2price Attribute Signature
getZones() s
getPrice()
Operation TarifSchedule
s
• A class represents a concept
• A class encapsulates state (attributes) and behavior
(operations)
Each attribute has a type
Each operation has a signature
• Actor
• An entity outside the system to be modeled,
interacting with the system (“Passenger”)
• Class
• An abstraction modeling an entity in the application or
solution domain
• The class is part of the system model (“User”, “Ticket
distributor”, “Server”)
• Object
• A specific instance of a class (“Joe, the passenger who
is purchasing a ticket from the ticket distributor”).
21
Instances
tarif2006:TarifSchedule :TarifSchedule
zone2price = { zone2price = {
{‘1’, 0.20}, {‘1’, 0.20},
{‘2’, 0.40}, {‘2’, 0.40},
{‘3’, 0.60}} {‘3’, 0.60}}
22
Associations
TarifSchedule
TripLeg
Price
Zone
*
Enumeration
getZones() *
Associations denote relationships
Price getPrice(Zone) between classes
23
1-to-1 and 1-to-many Associations
Countr City
y 1
name:St 1 name:St
ring ring
1-to-1 association
Point
Polygo
n *
x:
draw() Integer
y:
Integer
1-to-many association
24
Many-to-many Associations
StockExchange * Company
*
Lists
tickerSymbol
25
From Problem Statement To Object
Model
Problem Statement: A stock exchange lists many companies.
Each company is uniquely identified by a ticker symbol.
Class Diagram:
* * Company
StockExchange
Lists
tickerSymbol
26
From Problem Statement to Code
Problem Statement : A stock exchange lists many
companies. Each company is identified by a ticker symbol
Class Diagram:
StockExchange * * Company
Lists tickerSymbol
Java Code
public class StockExchange
{
private Vector m_Company = new Vector();
Associations
};
are mapped to
public class Company
{ Attributes!
private int m_tickerSymbol;
private Vector m_StockExchange = new Vector();
};
27
Qualifiers
Without qualification
File
Directory 1
*
With qualification filename
1 0..1
Directory filename File
28
Qualification: Another Example
Company
StockExchange * Lists
*
tickerSymbol
Company
StockExchang * Lists
e
* tickerSymbo
l
StockExchange
*
tickerSymbol
Lists 1
* Company
29
Aggregation
• An aggregation is a special case of association
a “consists-of” hierarchy
denoting Exhaust
• The aggregate is the parent class, system
the components are the children classes
1 0..
2
Muffler Tailpipe
diameter diamet
er
A solid diamond denotes composition: A strong form of
aggregation where the life time of the component instances
is controlled by the aggregate. That is, the parts don’t exist
on their won (“the whole controls/destroys the parts”)
TicketMachine
3
ZoneButton
30
Inheritance
Button
CancelButton ZoneButton
32
Ternary associations
33
Packages
Packages help you to organize UML models
to increase their readability
We can use the UML package mechanism to
organize classes into subsystems
Account
Bank Customer
CUS
TOM
ER1
Amount
Custome
rId
Deposit()
Withdra
w()
GetBalan
ce()
35
Object Modeling in Practice:
Brainstorming
“Ann” Foo
Amount Amount
Customer CustomerI
Id d
Deposit() Deposit()
Withdraw( Withdraw(
) ) Accou
GetBalanc GetBalanc
e() e() nt
Amount
Custome
rId
Deposit()
Withdra
w()
GetBalan
ce()
36
Object Modeling in Practice: More
classes
Accou
nt
Custom
Amount
Bank er
Account
Customer
IdId Name
Name Deposit() Custome
Withdra rId
w()
GetBalan
ce()
1)Find New Classes
2)Review Names, Attributes and
Methods
37
Object Modeling in Practice:
Associations
Accou
nt
Custom
Bank
? * Amount
* own
er
ha Account
Customer
s IdId s Name
2
Name Deposit() Custome
Withdra rId
w()
GetBalan
ce()
1)Find New Classes
2)Review Names, Attributes and
Methods
3)Find Associations between Classes
4)Label the generic assocations
5)Determine the multiplicity of the
assocations
38
6)Review associations
Practice Object Modeling: Find
Taxonomies
Bank
Accou
Custome
nt
r
* Amount * Ha Name
Name Account
Customer s
IdId
Deposit()
Withdra Customer
w()
Withdra Id()
w()
GetBalan
ce()
Saving Checki Mortga
s ng ge
Accoun Accoun Accou
t t nt
41
UML Sequence
Diagram
42
UML first pass: Sequence diagram
Lifelin
Actor Message
e
Object :LCDDisplay :Time
pressButton1() blinkHours()
:WatchUser :Watch
pressButton1()
blinkMinutes()
pressButton2()
incrementMinutes()
refresh()
pressButton1and2()
commitNewTime()
stopBlinking()
Activatio
n
Sequence diagrams represent the behavior of a
system as messages (“interactions”) between
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 43
different objects
Sequence Focus on
Controlflow
Diagrams
• Used during analysis
TicketMachine
Passenger • To refine use case descriptions
selectZone() • to find additional objects
(“participating objects”)
• Used during system design
to r
TicketMachine efine• subsystem interfaces
insertCoins()
zone2price
• Insta n ces are
selectZone() rectan repMreessseangteesd->by
insertCoins() g les. participating
pickupChange() pickupChange() figures ActorsObObjectpyersattiiocnksy
pickUpTicket() es are on represented by
• lines
Lifelin
Messages are represented
dashed
by arrows
pickUpTicket()
Activations are
represented by narrow
rectangles. 44
Scenarios, use case and
sequence diagrams
A scenario is an instance of a use case
describing a concrete set of actions (no
alternative paths are in it)
A use case is an abstraction that describes
all possible scenarios involving the described
functionality.
Scenarios are used as examples for
illustrating common cases;
• their focus is on understandability.
Use cases are used to describe all possible
cases;
• their focus is on completeness.
45
How to describe scenarios
46
Scenario: an example
47
Sequence Diagrams can also
model the Flow of Data
price
displayPrice(price)
Dataflo
w …continued on next slide...
The source of an arrow indicates the activation which
sent the message
Horizontal dashed arrows indicate data flow, for
example return results from a message
48
Sequence Diagrams: Iteration &
Condition …continued from previous
slide...
ChangeProcessor CoinIdentifier Display CoinDrop
Passenger
*insertChange(coin) lookupCoin(coin)
price
Iteratio displayPrice(owedAmount)
n
[owedAmount<0] returnChange(-owedAmount)
Condition
…continued on next slide...
49
Creation and destruction
…continued from previous
slide...
ChangeProcessor
Passenger Creation of
Ticket
createTicket(selection)
Ticket
print()
free()
Destruction of
Ticket
• Asynchronous
• Synchronous
• Call and Object creation
• Reply
• Lost
• Found
51
Sequence Diagram Properties
52
Chapter 3: UML DIAGRAM
53
Interaction Diagrams
55
Interaction Diagrams
• Four types of interaction diagrams:
• Sequence diagrams
• Communication diagrams
• Interaction overview diagrams
• Timing diagrams
57
UML Sequence Diagram with Alternative
Paths
This sequence diagram visually represents a decision-making process in object interactions,
where different actions are taken depending on the value of x.
58
UML Sequence Diagram with Alternative
Paths
59
Example of a Critical Region
Problem statement: The telephone Operator must make sure to forward a 911-call
from a Caller to the Emergency system before doing anything else. Normal calls
can be freely interleaved.
60
Key Characteristics of Critical
Regions
●Atomic Execution: All messages within the critical region are executed
sequentially without interruption.
●Mutual Exclusivity: Ensures that no other interactions can interleave with the
critical region, preserving consistency.
61
UML Statechart
Diagram
62
Purpose of Statechart Diagrams
∙ Used to model the dynamic nature of a system. They define different
states of an object during its lifetime and these states are changed by
events.
events
• An event may be either internal or external to the object
UML first pass: Statechart Wrong
state, It’s an
diagrams
Event Initial state action!!
button2Pressed
button1&2Presse Blink Increment
Hour displayRefreshe Hours
d s
d
Transition button1Pressed
button1&2Presse button2Pressed
Blink Increment
d Minutes Minutes
State displayRefreshe
d
button1Pressed
69
State machine diagram for
watch
70
State machine diagram for
watch
States:
SetTime: The device is in the time-setting mode.
MeasureTime: The device is in the time-measuring mode.
DeadBattery: The device stops functioning due to an empty battery.
Transitions:
pressBothButtons: Transitions between SetTime and MeasureTime.
after 2 min.: Automatically switches from SetTime to MeasureTime after 2 minutes.
pressBothButtons/beep: A button press triggers a beep and moves the device to
DeadBattery.
batteryEmpty: If the battery is empty, the system moves to the DeadBattery state.
71
Internal transitions in Watch
statechart
72
Review: UML Statechart Diagram
Notation
Event with parameters Action Name
ofState
attr
State1 Event State2
do/Activity Event(attr) [condition]/action
entry /action
Guard
exit/action
condition
• Note:
• Events are italics
• Conditions are enclosed with brackets:
[]
• Actions are prefixed with a slash / 73
Example of Concurrency within an
Object Nested states
Splitting Synchronization
control
Emitting
Do/Dispense
Cash Cash
taken
Setting Up Ready to
Read reset
y do/Eject
Card
Card
taken
Exit??
?
75
UML Activity Diagram
76
UML Activity Diagrams
An activity diagram consists of nodes and edges
• Nodes describe activities and objects
• Control nodes
• Executable nodes
• Most prominent: Action
• Object nodes
• E.g. a document
• Edge is a directed connection between nodes
• There are two types of edges
• Control flow edges
• Object flow edges
77
Activity
∙
diagrams
In activity diagrams transitions from node to node happen
automatically upon completion of activities
• Transitions do not depend upon the arrival of events as it
happens in statecharts
∙ Activity diagrams represent the UML notation for the well
known flowchart
∙ Each node in a flowchart represents an action to be
executed.
• So it is not a state, but when applied to the program's state, it
results in a transition to another state.
78
State vs Activity diagram
action1
test=1 test=0
E2[test=0]/
E2[test=1]/action2 action4 action2 action4
s
4
action3
Field Officer
Document
Incident
80
Activity Diagrams
State Chart Diagrams vs Activity
∙Diagrams
An activity diagram that contains only
activities can be seen as a special case of a
state chart diagram
∙ Such an activity diagram is useful to describe
the overall workflow of a system
82
Statechart Diagram vs Activity
Diagram
Statechart Diagram for Incident
Focus on the set of attributes of a single abstraction (object,
system) Event causes
state transition
Active Inactive
Closed Archived
Incident- Incident- Incident-
Handled Documented Archived
Triggerless
Completion of activity
transition
causes state transition 83
Object Diagram
● Derived from class diagrams.
• Notations:
• Functional model: Use case diagram
• Object model: Class diagram
• Dynamic model: Sequence diagrams, Statechart and
Activity diagrams.
89
Exercises
94
What is Project Management?
A project is an interrelated set of activities
that has a definite starting and ending point
and that results in a unique product.
(service)
■ Management is typically viewed as
focused on the planning,
organization, and control of
continuous processes or activities.
Apr 1, 2025
Process vs. Project Work
Process Project
• Ongoing, day-to-day ⚫ Take place outside the
activities to produce normal, process-oriented
goods and services world
• Use existing systems, ⚫ Unique and separate
properties, and from routine, process-
capabilities driven work
• Typically repetitive ⚫ Continually evolving
Characteristics of Project
• A one-time focus
• A specific purpose and a desired result
• A start and a finish
• A time frame for completion
• A limited set of resources
• A logical sequence of interdependent activities
• A clear user(customer, client) of the result
Apr 1, 2025
Elements of Project Planning
● Define project objective(s)
● Identify activities
● Establish precedence relationships
● Make time estimates
● Determine project completion time
● Compare project schedule objectives
● Determine resource requirements to meet
objective
Apr 1, 2025
Project Success Rates
PROJE
CT
RISK
Feasibility Analysis Overview
101
Technical Feasibility
102
Economic Feasibility
● Cost-benefit analysis
● Return on Investment (ROI)
● Net Present Value (NPV)
● Break-even analysis
103
Organizational Feasibility
104
The Project Team
■ Selecting a team
■ Developing project objectives and a plan for
execution
■ Performing risk management activities
■ Cost estimating and budgeting
■ Scheduling
■ Managing resources
Steps in Managing a Project
Steps in Managing a Project
Plan the Project : what must be done ?, who will do it?, How will it be done ?
How much will it cost? ,what do we need to do?
Close Project
What was done well?
What should be improved?
Apr 1, 2025
Project Life Cycles
Man Hours
Apr 1, 2025
Project Life Cycle
Apr 1, 2025
Project Life Cycles and Their
Effects
Apr 1, 2025
Building a Gantt Chart
• List all tasks and milestones from the
project along the vertical axis
• List time frame along the horizontal axis
Activity 1
Activity 2
Milestone
Apr 1, 2025
Building a Gantt Chart
• Activities: Create box the length of each activity time
duration
– E.g., activity one is scheduled from day1-day3
Activity 1
Activity 2
Apr 1, 2025
Building a Gantt Chart
• Dependencies: Show dependencies between
activities with arrows
– E.g., activity 2 cannot start until activity 1 is complete
Activity 1
Activity 2
Apr 1, 2025
Gantt Charts
✔ Establish a time-phased network
✔ Can be used as a tracking tool
122
Gantt Charts
Database Subsystem
123
Network Diagram
• Also known as PERT chart or PERT/CPM chart
• Illustrates task relationships
• Used to determine the critical path
• Software such as Microsoft Project can be used to
create a network diagram.
Network Diagram
Network Diagram: Activity on
Arrow
• Alternative method
• More difficult to read and understand
• May require the creation of dummy activities when a
task has multiple predecessors and multiple dependent
tasks
• More “mathematical” in its illustration of activities and
events.
Network Diagram compared to
Gantt
• Network diagram is more technical, helps determine
the critical path
• Network diagram is not to a scaled timeline
• Gantt is easy to read and explain to non-technical
people
• Gantt has a good method for graphically illustrating
task progress and whether things are ahead of
schedule or behind
Project constraints
• Cost
• Scope
• Quality
• Risk
• Resources
• Time
Interpersonal Skills in Project
Management
• Understanding the project environment
• Business goals and user needs, Market & Industry
Trends, Competitor Landscape, Economic & Social
Factors
• Interpersonal skills
• Communication,
• Leadership,
• Motivation ,
• Negotiation ,
• Problem solving.
Computer-Aided Software Engineering
Courtesy of Federal
Express Corporation.
All rights reserved.
CASE Tool Kit Contains
Design tools
User interface
Screen generator
Layout
Report generator
Information repository tools
Cross-referencing system (database)
Packages system documentation
Program development tools
Application Generator
Generation of text data
Exercise
1. Compare and contrast the Gantt chart
with the net-work diagram.
B. System Design
C. Backend Development
D. Testing
Task 8: Unit testing (4 days)
Task 12: Launch the web application in the live environment with proper setup and configuration.
(3 days)
Exercise
U3. Create a Gantt Chart for the project of building a simple web application.
Design the Class Diagram for the Train Ticket
Reservation System
Assignment: Design the Activity and Statechart
Diagram for the Train Ticket Reservation System
Object-Oriented Software Engineering
Using UML, Patterns, and Java
Dynamic Modeling
Chapter 5, Analysis:
Outline of the Lecture
• Dynamic modeling
• Interaction Diagrams
• Sequence diagrams
• Communication diagrams
• State diagrams
• Requirements analysis model validation
• Analysis Example
139
Overview of Analysis
Dynamic Modeling
142
Example of a Communication
Diagram
1) We start with the Class Diagram for 2Bwatch
2) Then we look at the sequence of events when Joe sets the time
on 2Bwatch
Joe:2BwatchOwner
1:pressButtons1And2()
2:pressButton1()
3:pressButton2() 1.1:blinkHours()
4:pressButtons1And2() 2.1:blinkMinutes()
4.2:stopBlinking()
:2BwatchInput :2BwatchDisplay
3.1:incrementMinutes()
4.1:commitNewTime()
3.2:refresh()
:2BwatchTime
143
Identify Classes and Operations
∙ We have already established several
sources for class identification:
• Application domain analysis: We find classes by talking
to the client and identify abstractions by observing the
end user
• General world knowledge and intuition
• Textual analysis of event flow in use cases (Abbot)
∙ Two additional heuristics for identifying
classes from dynamic models:
• Actions in state chart diagrams are candidates for public
operations in classes
• Activity lines in sequence diagrams are candidates for
objects.
144
How do we detect Operations?
145
How do we detect Operations?
146
Event and participating objects
147
An Example
148
Sequence Diagram for “Get SeatPosition”
Smart Card Onboard Computer Seat
1. Establish
connection Establish Connection
between smart card Establish Connection
and onboard
computer
2. Establish
connection Accept Connection
between onboard
computer and seat
(actually seat Accept Connection
sensor)
● ChangeDateControl is a control
151
Is this a good Sequence Diagram?
Smart Card Onboard Computer Seat
The first
column is Establish Connection
not an actor
Establish Connection
It is not
clear where
the
boundary Accept Connection
object is
The activities that transform the use cases and scenarios produced
during requirements elicitation into an analysis model.
League
Owner 1 League
*
Attributes Attributes
Operations Operations
Tournament
Attributes
Operations
Player * Match
Attributes * Attributes
155
Operations Operations
ARENA Sequence Diagram: Create
Tournament
:Tournament :Arena :League
Boundary
League
Owner
newTournament
(league)
:Announce
«new» Tournament
Control
checkMax
Tournament()
setName(name)
setMaxPlayers
(maxp)
commit() create
createTournament Tournament
(name, maxp) «new»
(name, maxp) :Tournament
156
Impact on Arena’s Object Model
League
Owner League
1 *
Attributes Attributes
Operations Operations
Arena Tournament_
Boundary
Attributes
Attributes
Operations
Operations Tournament
Announce_ Attributes
Tournament_ Operations
Control
Attributes
Operations
Player Match
*
*
Attributes Attributes
Operations Operations
157
Impact on ARENA’s Object Model (2)
∙ Question:
• Who owns these events?
∙ Answer:
• For each object that receives an event there is a public operation
in its associated class
• The name of the operation is usually the name of the
event. 158
Example from the Sequence Diagram
newTournament
(league)
:Announce
«new» Tournament
Control
checkMax
Tournament()
setName(name)
setMaxPlayers
(maxp)
commit() create
createTournament Tournament
(name, maxp) «new»
(name, maxp) :Tournament
159
League 1 * League
Owner
Attributes Attributes
Operations Operations
Tournament_
Boundary
Arena Attributes
Operations
Attributes
Tournament
Operations
Announce_
Tournament_ Attributes
Control Operations
Attributes
createTournamen
t (name, maxp)
Player *
* Match
Attributes Attributes
161
Fork Diagram
• The dynamic behavior is placed in a single object,
usually a control object
It knows all the other objects and often uses them for direct
questions and commands
Control
Object
163
Fork or Stair?
164
Review: UML Statechart Diagram
Notation
Name of
Action
Event with parameters attr State
State1 Event
(attr) [condition]/action State2
do/Activity
entry /action Guard
exit/action condition
165
Example of a StateChart Diagram
166
Dynamic Modeling of User Interfaces
167
Navigation Path Example
Screen name
Action
Diagnostics Menu
∙User moves cursor to Control Panel or
Graph
Control panel Graph
∙User selects functionality of ∙User selects data group
sensors
and type of
Define
graph
∙User defines a sensor event
Selection
from a list of
∙User selects data group
events Enable Disable
∙Field site
∙User can enable ∙User can disable a
∙Car
a sensor event sensor event from
from a list of ∙Sensor group
a list of sensor events
sensor events ∙Time range
168
Model Validation and Verification
169
Checklist for a Requirements Review
170
Verification vs Validation of models
M M
fM
I I
R R
fR
171
Checklist for a Requirements
Review (2)
172
Requirements Analysis Document
Template
1. Introduction
2. Current system
3. Proposed system
1. Overview
2. Functional requirements
3. Nonfunctional requirements
4. Constraints (“Pseudo requirements”)
5. System models
1. Scenarios
2. Use case model
3. Object model
1. Data dictionary
2. Class diagrams
4. Dynamic models
5. User interfae
4. Glossary
173
System Models
Scenarios
- As-is scenarios, visionary scenario
Use case model
-Actors and use cases
Object model
- Data dictionary
- Class diagrams (classes, associations, attributes and
operations)
Dynamic model
- State diagrams for classes with significant dynamic
behavior
- Sequence diagrams for collaborating objects (protocol)
User Interface
- Navigational Paths, Screen mockups
174
Requirements Analysis
Questions
1. What are the transformations? Functional Modeling
Create scenarios and use case diagrams
- Talk to client, observe, get historical records
2. What is the structure of the Object Modeling
system? Create class diagrams
- Identify objects.
- What are the associations between them?
- What is their multiplicity?
- What are the attributes of the objects?
- What operations are defined on the
objects?
3. What is its behavior?
Dynamic Modeling
Create sequence diagrams
- Identify senders and
- Show sequence of events exchanged between
receivers
objects.
- Identify event dependencies and event concurrency.
Create state diagrams
- Only for the dynamically interesting objects. 175
Let’s Do Analysis: A Driving Car
Example
• Analyze the problem statement
• Identify functional requirements
• Identify nonfunctional requirements
• Identify constraints (pseudo requirements)
• Build the functional model:
• Develop use cases to illustrate functional requirements
• Build the dynamic model:
• Develop sequence diagrams to illustrate the
interaction between objects
• Develop state diagrams for objects with interesting
behavior
• Build the object model:
• Develop class diagrams for the structure of the system
176
Problem Statement:
Direction Control for a Driving Car
177
Find the Functional Model: Use Cases
• Use case 1: System Initialization
• Entry condition: Power is off, car is not moving
• Flow of events:
1. Driver turns power on
• Exit condition: Car moves forward, headlight is on
178
Use Cases continued
179
Use Cases Continued
180
Dynamic Modeling:
Create the Sequence Diagram
• Name: Drive Car
• Sequence of events:
• Billy turns power on
• Headlight goes on
• Wheels starts moving forward
• Wheels keeps moving forward
• Billy turns power off
• Headlight goes off
• Wheels stops moving
• ...
181
Driving Car: Dynamic Model
Wheel
Headlight
Forward
Off power
power off
on
power power
off on
Stationary Stationary
On
power power
on
off
Backward
182
Toy Car: Object Model
Car
183
Project Deliverables
❑ Define Problem Statements and Objectives
❑ Requirements Elicitation ( Requirements Analysis Document)
❑ Feasibility Analysis
❑ Gantt Chart
❑ Analysis Model( Use- case, Class and Object Diagram, Dynamic
Modelling)
❑ Design the model (Hardware & Software specification,
Software Architecture)
❑ Implementation (Coding in (Java, Python) Database
development)
❑ Testing (Unit, Integrated and Final)
❑ Release the product (Application, Manual & training)
Object-Oriented Software Engineering
Using UML, Patterns, and Java
Elicitation
Requirements
Chapter 6
Outline
• Software Lifecycle
• Requirements elicitation
challenges
• Problem statement
• Requirements specification
• Types of requirements
• Validating requirements
1
8
6
Software Lifecycle Definition
• Software lifecycle
• Models for the development of software
• Set of activities and their dependency
relationships to each other to support
the development of a software system
• Examples:
• Analysis, design, implementation,
testing
• Design depends on analysis, testing
can be done before implementation
1
8
7
Software Lifecycle Activities
Use
Case
Model
1
8
8
...and their
Software Lifecycle Activities
models
Expressed in
terms of
Applicati
Use
on
Case Domain
Model Objects
1
8
9
Software Lifecycle Activities
Expressed in Structured
terms of by
Use Applicati
on Sub
Case
Mod Domai
-
syste
el n
ms
Objec 1
9
ts 0
Software Lifecycle Activities
Applicati Solutio
Use
on Sub- n
Case Domain syste Domai
Model Objects n
ms
8
Object
s
Software Lifecycle Activities
Implemented by
Expressed in Structured Realized by
terms of by
class...
class...
class...
Applicati Solutio
Use Sour
on Sub- n
Case Domain ce
syste Domai
Model Objects n Code
ms
1
Object 9
s 2
Software Lifecycle Activities
Implemented by
Expressed in Structured Realized by
by Verified
terms of
By
class...
class... ?
class... class.?.
Applicati Solutio
Use Sour
on Sub- n ..Test
Case Domain ce Case
syste Domai
Model Objects n Code Mod
ms
Object el 1
9
s 3
Software Lifecycle Activities
1
9
6
Scenarios
• Scenario
1
9
7
More Definitions
1
9
8
Scenario-Based
Design
Scenarios can have many different uses during the
software lifecycle
• Requirements Elicitation: As-is scenario, visionary
scenario
• Client Acceptance Test: Evaluation scenario
• System Deployment: Training scenario
Scenario-Based Design: The use of scenarios in a
software lifecycle activity
• Scenario-based design is iterative
• Each scenario should be consisered as a work
document to be augmented and rearranged (“iterated
upon”) when the requirements, the client acceptance
criteria or the deployment situation changes.
1
9
9
Scenario-based Design
2
0
0
Types of Scenarios
• As-is scenario:
• Describes a current situation. Commonly used in re-
engineering projects. The user describes the system.
• Example: Description of Letter-Chess
• Visionary scenario:
• Describes a future system
• Example: Home Computer of the Future
• Often used in greenfield engineering and interface
engineering projects
• Example: Description of an interactive internet-
based Tic Tac Toe game tournament
• Visionary scenarios are often not done by the user or
developer alone.
2
0
1
Additional Types of
Scenarios (2)
• Evaluation scenario:
• Description of a user task against which the system is
to be evaluated.
• Example: Four users (two novice, two experts) play
in a TicTac Toe tournament in ARENA.
• Training scenario:
• A description of the step by step instructions that guide
a novice user through a system
• Example: How to play Tic Tac Toe in the ARENA
Game Framework.
2
0
2
How do we find scenarios?
2
0
3
Heuristics for finding scenarios
• Ask yourself or the client the following questions:
• What are the primary tasks that the system needs to
perform?
• What data will the actor create, store, change, remove or
add in the system?
• What external changes does the system need to know
about?
• What changes or events will the actor of the system need
to be informed about?
• However, don’t rely on questions and
questionnaires alone
• Insist on task observation if the system
already exists (interface engineering or
reengineering) 2
• Ask to speak to the end user, not just to the client 0
4
•
Requirements Elicitation:
Difficulties and Challenges
∙ Accurate communication about the
domain and the system
• People with different backgrounds must collaborate to
bridge the gap between end users and developers
• Client and end users have application domain
knowledge
• Developers have solution domain knowledge
∙ Identification of an appropriate system
(Definition of the system boundary)
• Provision of an unambiguous specification
• Leaving out unintended features
=> 3 Examples.
2
0
5
Requirements
Process :problem
statement
Requirements Requirements
elicitation Specification
:nonfunctional
requirements
:functional model
:dynamic model
• Functional requirements
• Describe the interactions between the system and
its environment independent from the
implementation
“An operator must be able to define a new game“
• Nonfunctional requirements
• Aspects not directly related to functional behavior
“The response time must be less than 1 second”
• Constraints
• Imposed by the client or the environment
“The implementation language must be Java “
• Also called “Pseudo requirements”.
2
0
8
Functional vs. Nonfunctional
Requirements
Functional Requirements Nonfunctional Requirements
∙ Describe user ∙ Describe properties
tasks which the
of the system or the
system needs to
support domain
• Phrased as actions
• Phrased as
“Advertise a new
constraints or negative
league” “Schedule
tournament” “Notify an
assertions
interest group” “All user inputs should be
acknowledged within 1
second”
“A system crash should not
result in data loss”.
2
0
9
Types of Nonfunctional Requirements
• Usability • Implementation
• Reliability • Interface
• Robustness • Operation
• Safety • Packaging
• Performance • Legal
• Response time • Licensing (GPL, LGPL)
• Scalability • Certification
• Throughput • Regulation
• Availability
• Supportability
• Adaptability
• Maintainability Constraints or
Quality requirements Pseudo requirements
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, 3
Patterns, and Java
9
Types of Nonfunctional Requirements
• Usability • Implementation
• Reliability • Interface
• Robustness • Operation
• Safety • Packaging
• Performance • Legal
• Response time • Licensing (GPL, LGPL)
• Scalability • Certification
• Throughput • Regulation
• Availability
• Supportability
• Adaptability
• Maintainability Constraints or
Quality requirements Pseudo requirements
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, 4
Patterns, and Java
0
Some Quality Requirements
• Definitions
Usability
• The ease with which actors can perform a function in a system
• Usability is one of the most frequently misused terms (“The system
is easy to use”)
• Usability must be measurable, otherwise it is marketing
• Example: Specification of the number of steps – the measure! -
to perform a internet-based purchase with a web browser
• Robustness: The ability of a system to maintain a function
• even if the user enters a wrong input
• even if there are changes in the environment
• Example: The system can tolerate temperatures up to 90 C
• Availability: The ratio of the expected uptime of a
system to the aggregate of the expected up and down time
• Example: The system is down not more than 5 minutes per week.
Nonfunctional Requirements:
Examples
• “Spectators must be able to watch a
match without prior registration and without
prior knowledge of the match.”
⮚ Usability Requirement
• “The system must support 10 parallel
tournaments”
⮚ Performance Requirement
• “The operator must be able to add new
games without modifications to the existing
system.”
⮚ Supportability Requirement
2
1
3
What should not be in the
Requirements?
• System structure, implementation
technology
• Development methodology
• Development environment
• Implementation language
• Reusability
• It is desirable that none of these above
are constrained by the client.
2
1
4
Requirements Validation
Requirements validation is a quality assurance
step, usually performed after requirements
elicitation or after analysis
• Correctness:
• The requirements represent the client’s view
• Completeness:
• All possible scenarios, in which the system can be used,
are described
• Consistency:
• There are no requirements that contradict each other.
2
1
5
Requirements Validation
(2)
• Clarity:
• Requirements can only be interpreted in one way
• Realism:
• Requirements can be implemented and delivered
• Traceability:
• Each system component and behavior can be traced to
a set of functional requirements
2
1
6
Different Types of Requirements
Elicitation
• Greenfield Engineering
• Development starts from scratch, no prior system
exists, requirements come from end users and clients
• Triggered by user needs
• Re-engineering
• Re-design and/or re-implementation of an existing
system using newer technology
• Triggered by technology enabler
• Interface Engineering
• Provision of existing services in a new environment
• Triggered by technology enabler or new market needs
2
1
7
Prioritizing Requirements
• High priority
• Addressed during analysis, design, and implementation
• A high-priority feature must be demonstrated
• Medium priority
• Addressed during analysis and design
• Usually demonstrated in the second iteration
• Low priority
• Addressed only during analysis
• Illustrates how the system is going to be used in the
future with not yet available technology.
2
1
8
Requirements Analysis Document
Template
1. Introduction
2. Current system
3. Proposed system
1. Overview
2. Functional requirements
3. Nonfunctional requirements
4. Constraints (“Pseudo requirements”)
5. System models
1. Scenarios
2. Use case model
3. Object model
1. Data dictionary
2. Class diagrams
4. Dynamic models
5. User interface
4. Glossary
2
1
9
Section 3.3 Nonfunctional
Requirements
1. User interface and human factors
2. Documentation
3. Hardware considerations
4. Performance characteristics
5. Error handling and extreme conditions
6. System interfacing
7. Quality issues
8. System modifications
9. Physical environment
10. Security issues
11. Resources and management issues
2
2
0
Nonfunctional Requirements
(Questions to overcome)
User interface and human factors
• What type of user will be using the system?
• Will more than one type of user be using the
system?
• What training will be required for each type of
user?
• Is it important that the system is easy to learn?
• Should users be protected from making errors?
• What input/output devices are available
Documentation
• What kind of documentation is required?
• What audience is to be addressed by each
document?
2
2
1
Nonfunctional
Requirements (2)
Hardware considerations
• What hardware is the proposed system to be used on?
• What are the characteristics of the target hardware,
including memory size and auxiliary storage space?
Performance characteristics
• Are there speed, throughput, response time constraints
on the system?
• Are there size or capacity constraints on the data to be
processed by the system?
Error handling and extreme conditions
• How should the system respond to input errors?
• How should the system respond to extreme conditions?
2
2
2
Nonfunctional
Requirements (3)
System interfacing
• Is input coming from systems outside the proposed
system?
• Is output going to systems outside the proposed system?
• Are there restrictions on the format or medium that must
be used for input or output?
Quality issues
• What are the requirements for reliability?
• Must the system trap faults?
• What is the time for restarting the system after a failure?
• Is there an acceptable downtime per 24-hour period?
• Is it important that the system be portable?
2
2
3
Nonfunctional
Requirements (4)
System Modifications
• What parts of the system are likely to be modified?
• What sorts of modifications are expected?
Physical Environment
• Where will the target equipment operate?
• Is the target equipment in one or several locations?
• Will the environmental conditions be ordinary?
Security Issues
• Must access to data or the system be controlled?
• Is physical security an issue?
2
2
4
Nonfunctional
Requirements (5)
Resources and Management Issues
• How often will the system be backed up?
• Who will be responsible for the back up?
• Who is responsible for system installation?
• Who will be responsible for system maintenance?
2
2
5
Exercises
Exercise 1: Scenario and Use Case Identification
Observe a system you interact with daily (e.g., a ride-hailing app or a smart
home device). Write a detailed scenario that describes a specific interaction with
the system. Then abstract this scenario into a use case and identify the main
actor involved.
F-Functionality
Must support multi-language interface.
U-Usability
Intuitive, User-Friendly UI with keyboard accessibility.
R – Reliability
Coursera should maintain at least 99.9% uptime to ensure global access at all times.
P-Performance
Videos should load in under 3 seconds on 4G.
S– Supportability
Multi-Device Support: The platform should function consistently across web, Android, and iOS
devices, with regular updates and support for new OS versions.
+ (Plus)
Legal/Regulatory Compliance: The system must adhere to international data protection laws
such as GDPR and CCPA.
Exercise
Exercise 3: Consider a University Course Registration System.
Identify at least three actors and four use cases they would be
involved in.
Interviews
Advantages:
- One-on-one discussions with stakeholders or users
- Collecting in-depth insights or opinions
Limitations:
- Time-consuming
- Prone to bias
JAD
Advantages:
- Collaborative workshops for gathering consensus.
- Rapid clarification of complex requirements.
Limitations:
Needs careful planning and facilitation.
Exercise
Exercise 5: Create a checklist of at least five nonfunctional
requirements for a smart thermostat app, categorized using the
FURPS+ model.