Beruflich Dokumente
Kultur Dokumente
COSC 2274/2275
Software Requirements Engineering
Lecture 4 & 5
Howie McQuarrie
Introduction: Modelling
o Software systems have become very complex
only complexity!
[Week 4,5]-2
everything from 2
boxes and a wire to
pseudo-code
Introduction: Modelling
o Models are abstract descriptions/views of systems whose
requirements are being analysed
o Different models present the system from different perspectives
External perspective (I.e. Context models show the position of a
system in its environment with other systems and processes),
Process models, Behavioural perspective, Structural perspective
(e.g. data architecture)
only for
unbelievably
complex analysis
[Week 4,5]-3
o During Verification
are we building the system right?
proving that a realization satisfies its specification
o During Validation
are we building the right system?
testing and debugging
o For Documentation
communication among stakeholders
[Week 4,5]-4
[Week 4,5]-5
You're asked for a recommendation but you do not hold the person in high regard.
"In my opinion, you will be very fortunate to get this person to work for you."
I most enthusiastically recommend this candidate with no qualifications
whatsoever.
I am pleased to say that this candidate is a former colleague
of mine.
I can assure you that no person would be better for the job.
I would urge you to waste no time in making this candidate an offer of
employment.
All in all, I cannot say enough good things about this candidate or recommend him
too highly.
Structured Analysis
Object-Oriented Analysis
Context Diagram
Activity Diagram
Swimlane Diagram
Sequence Diagram
Data or object
interrelationships
Entity-relationship diagram
Class diagram
Collaboration diagram
Object diagram
State-transition diagram
Statechart diagram
Dialog map
N/A
[Week 4,5]-6
Multiple Views
These come
directly from the
requirements.
Use Case
Analyst
Derives
Functional
Requirements
Analyst
draws
compare
Functional
Requirements
compare
compare
Tester
Derives
Analysis
Models
[Week 4,5]-7
Multiple Views
The analyst needs a rich tool kit of techniques at their disposal to choose
the most effective requirements view
[Week 4,5]-8
Context Diagram, Use Case Diagram for objects outside the system.
Format descriptions/report layouts for input/output files
Interface specifications for hardware/software interafce (e.g. API)
Data or object
interrelationships
System states
User interfaces
Behavior of an object
Complex Logic
Nonfunctional Requirements
[Week 4,5]-9
Use Cases
o Elicitation discussions that focus on users and usage generally yield the
best results
"Describe some of
the tasks you do" o
vs "What are the
data attributes that
the system would
require?"
Often more aligned with the use of the requirement specification than
normal modelling
[Week 4,5]-10
Use Cases
o The name given to a use case should indicate the
value the use case will deliver to the actor
By convention, the use case name always begins with a
verb
The name also contains an object, which is a noun
Adjectives and adverbs are optional
For example:
Reserve rental car; Print invoice; Register for payroll deduction;
Check flight status
[Week 4,5]-11
Use Cases
o The simplest use case specification consists of:
unique identifier
use case name
the actors
brief textual description
perhaps the events that trigger the use case execution
[Week 4,5]-12
Use Cases
o Use cases describe user requirements at a fairly high level of
abstraction
o You may begin with an initial high level analysis of the required
use cases, which is more abstract
o Then refine each use case further as it comes into scope for
each iteration/increment
o If you get caught in a use case explosion for a moderate size
project, try to combine use cases into a more general use case
This merging involves moving the use case to a higher level of
abstraction, and consequently simplify the requirements
Example: Use cases Request Initial Reimbursement for Travel
Expenses and Request Supplemental Reimbursement for Travel
Expenses could be generalised to Reimbursement for Travel
Expenses
[Week 4,5]-13
[Week 4,5]-14
[Week 4,5]-15
AllocateResources
<<extend>>
ConnectionDown
[Week 4,5]-16
HelpDispatcher
<<include>>
AllocateReso urces
[Week 4,5]-17
AuthenticateWithPassword
Authenticate
AuthenticateWithCard
RMIT Software Requirements Engineering 2007: COSC 2274/2275
[Week 4,5]-18
[Week 4,5]-19
[Week 4,5]-20
You may also choose to start by identifying one actor and the use cases that theyre
involved with first and then evolve the model from there
o
o
o
o
o
o
Generally dont include arrowheads on the association lines due to confusion with information flow,
and not initial invocation.
...but add a
disclaimer if you
know it is
incomplete!
KISS...
remembering that
you should be
trying to describe
something which is
mind-bogglingly
complex.
[Week 4,5]-21
In the example students are enrolling in courses with the potential help of
registrars. Professors input the marks students earn on assignments and
registrars authorize the distribution of transcripts (report cards) to students.
Actors: Students, Registrars, Professors
[Week 4,5]-22
[Week 4,5]-23
[Week 4,5]-24
Use Cases
[Week 4,5]-25
o Example
Main scenario:
Extensions:
[Week 4,5]-26
[Week 4,5]-27
brief description:
flow of events:
actors:
optional extras:
entry conditions:
exit conditions:
special requirements
[Week 4,5]-28
Describes the state of the system after the use case has run its course e.g.
saving of persistent data
What is the state of the system after use case finishes?
Example: The Fieldofficer receives the acknowledgment and selected response
including an ETA
[Week 4,5]-29
o Description
Field Officer reports emergency situation to Dispatcher
o Participating actors
FieldOfficer and Dispatcher
o Basic Flow
1. The FieldOfficer fills the form by selecting the emergency level,
type, location, and brief description of the situation. The
FieldOfficer also describes possible responses to the emergency
situation. Once the form is completed, the FieldOfficer submits the
form, at which point the Dispatcher is notified.
2. The Dispatcher reviews the submitted information and creates
an Incident in the database by invoking the OpenIncident use
case. The Dispatcher selects a response and acknowledges the
emergency report, with an ETA.
RMIT Software Requirements Engineering 2007: COSC 2274/2275
[Week 4,5]-30
Primary Actor
Priority
Difficulty
Release Timing
Update customer
Customer
High
Medium
Generate invoice
Finance
High
High
Funds transfer
Finance
Medium
High
Scan products
Customer
High
High
[Week 4,5]-31
[Week 4,5]-32
o Some scenarios result in success, and the user achieves their intended
goal
o Most typical or default scenario is called the normal flow
o Other pathways through the use case that also result in success are
alternative flows
o Uses Cases also identify conditions under which they may fail to
complete successfully called Exceptions
o Scenarios focus is on ease of understanding
o Use the use case scenarios to Design and Test the system
RMIT Software Requirements Engineering 2007: COSC 2274/2275
[Week 4,5]-33
ID Number: _ __
Trigger: _______________________________________________________________
Type: External / Temporal
Major Inputs:
Description
________________________
________________________
________________________
________________________
________________________
________________________
Major Outputs:
Source
___________
___________
___________
___________
___________
___________
Description
Destination
_______________________
_______________________
_______________________
_______________________
_______________________
____________
____________
____________
____________
____________
[Week 4,5]-34
In addition to a fire unit, she requests several paramedic units on the scene given that the
area appears to be relatively busy. She confirms her input and waits for an
acknowledgment.
[Week 4,5]-35
[Week 4,5]-36
[Week 4,5]-37
(a) Solution:
Write use case from end-user point of view
Focus on what the system is to do.
[Week 4,5]-38
[Week 4,5]-39
Solution
Get agreement early on use of actors
Develop a glossary
[Week 4,5]-40
combine
[Week 4,5]-41
[Week 4,5]-42
Solution
A general or explicit class of actors may simplify use case
Use inheritance
[Week 4,5]-43
[Week 4,5]-44
Solution
Each actor will do ALL possible alternatives.
E.g. a read use case for ordinary users and an update use case for
administrators.
[Week 4,5]-45
Include context
Ensure language is in customers domain, not computer
Use some other technique !
[Week 4,5]-46
genralise
[Week 4,5]-47
COSC2274/2275
Assignment 1 worth 10%
Wednesday 08AUG07
Due Date: Friday 17AUG07, 17:00
The New Steven Jobs
You have completed your degree at RMIT University, sold all of your worldly
possessions and moved to Cupertino, California. You have had a dream since
you were 14 to create and market your own software product. You find out
that Stanford University has a program where soon-to-graduate PhD IT
students will work for free to assist the next wave of entrepreneurs find
financial gratification through software. They will select which projects are
undertaken on the basis of a Vision and Scope document. You decide to create
one, possibly the best ever seen, and submit it for consideration. Bonne
chance!
Event-Response Tables
o Use cases are also not suited to some systems such as time-triggered
functions
o Event response tables can provide an effective technique for certain
systems by considering the external events the system must detect
o Events could be signals received from sensors, time-based triggers, or
user actions that cause the system to respond
o Event-response tables are related to Use Case
The trigger that initiates a Use Case is sometimes termed a Business Event
[Week 4,5]-48
Text vs Graphic of
STD
Event-Response Tables
Partial Event-Response Table for a Highway Intersection
Event
System State
Response
1.
2.
1.
2.
3.
4.
Do nothing
1.
2.
3.
4.
[Week 4,5]-49
[Week 4,5]-50
Sequence Diagrams
o Sequence diagram models the behaviour of the system as a series of
one or more Scenarios
o They show the interactions between objects to produce some
particular system behaviour that is specified as a use-case (scenario)
Use UML sequence diagram to show sequence of events in each use case
SSD obtains most details from the UML sequence diagram
or 'events'
[Week 4,5]-51
[Week 4,5]-52
:System
makeNewSale
loop
[ more items ]
enterItem(itemID, quantity)
description, total
endSale
total with taxes
makePayment(amount)
[Week 4,5]-53
external actor to
system
:System
: Cashier
makeNewSale
a UML loop
interaction
frame, with a
boolean guard
expression
loop
[ more items ]
enterItem(itemID, quantity)
description, total
endSale
return value(s)
associated with the
previous message
an abstraction that
ignores presentation
and medium
the return line is
optional if nothing is
returned
makePayment(amount)
a message with
parameters
it is an abstraction
representing the
system event of
entering the
payment data by
some mechanism
[Week 4,5]-54
Sync vs async
Guard
Ref
Break
Sequence Diagram
o UML sequence diagram represent behavior in terms of
interactions.
o Complement the class diagrams which represent structure
Useful to find participating objects
[Week 4,5]-55
Class name
[Week 4,5]-56
any 2 objects
which are linked by
a message/event
[Week 4,5]-57
Collaboration Diagram
o Is an interaction diagram that emphasizes the
structural organization of the objects that send and
receive messages
Object1
1: Message()
2: Message()
Object2
3: Message()
ObjectN
4: Message()
[Week 4,5]-58
Collaboration Diagram
Create one of these
and the other is
Automatically created
[Week 4,5]-59
[Week 4,5]-60
[Week 4,5]-61
Process
[Week 4,5]-62
[Week 4,5]-63
Structured English
o
o
o
o
o
o
implicitly top to
bottom
[Week 4,5]-64
Sentence consists of a simple imperative sentence with a verb and an object (Note 1)
Restrictions:
Preferably do not use mathematical symbols for natural language documents such as
Requirement Specifications
[Week 4,5]-65
[Week 4,5]-66
I think of it as
'coding' without
compiler syntax
errors, but it could
be higher level
Psuedocode
[Week 4,5]-67
Psuedocode: Example
o The algorithm for calculating deferred-service
revenue earned for any month is:
Set SUM(x)=0
FOR each customer X
IF customer purchased paid support
AND ((Current month) >= (2 months after ship date))
AND ((Current month) <= (14 months after ship date))
THEN Sum(X)=Sum(X) + (amount customer paid)/12
END
[Week 4,5]-68
[Week 4,5]-69
[Week 4,5]-70
[Week 4,5]-71
[Week 4,5]-72
UML version of a
Decision Tree is
more flexible
Activity Diagrams
[Week 4,5]-73
Entity-Relationship Models
o If the requirements within a set involve a description of the structure
and relationships among data within the system, it's often convenient
to represent that information in an entity-relationship diagram (ERD)
o Entity-Relationship Diagrams model the relationships between data in
the system
[Week 4,5]-74
Entity-Relationship Models:
Diagramatic Representation
Primary Key
Staff
Branch
Manages
satffNo {PK}
Area to list
attributes
name
1..1
branchNo {PK}
0..1
Address
position
street
salary/totalStaff
city
Has
Composite
attribute
postcode
telNo[1..3]
Derived attribute
Multi-valued attribute
[Week 4,5]-75
Entity-Relationship Models:
Example
[Week 4,5]-76
think of these as an
instantiation of a
requirement
o Test Cases
[Week 4,5]-77
Z Notation
o The Z notation is based upon set theory
AddBirthday
! BirthdayBook
name? : NAME
date? : DATE
[Week 4,5]-78
Goal-based requirements
engineering
o Goals are objectives to be achieved by the system
Prescriptive statements of intent
A state to be achieved or avoided
[Week 4,5]-79
last year.
low level
technical, fine-grained, design specific
acceleration command sent every 3 seconds
reminder issued by end of loan period if no return
This department should process 20 widgets per hour at least
[Week 4,5]-80
Functional
Non-Functional
Examples:
train acceleration computed
book request satisfied
Example:
[Week 4,5]-81
[Week 4,5]-82
[Week 4,5]-83
The more fine-grained goal, the less agents needed for its
fewer
achievement
e.g. acceleration command sent every 3 secs <-> station computer
e.g. reminder issued by end of loan period <-> library software
o Requirement:
A low level type of goal to be achieved by a software agent
Software agent is responsible for achieving goal
Goal assigned to a single agent = requirement
"maintain doors closed while non-zero speed"
"loan coupon issued when book copy available"
RMIT Software Requirements Engineering 2007: COSC 2274/2275
[Week 4,5]-84
o Conflict
Goal may be owned by stakeholders (at a process level)
Provides a potential for conflict:
Example 1:
train frequency increased (passengers)
number of passengers increased (train company)
Example 2:
book copy returned within 2 weeks (staff)
book copy kept as long as needed (borrowers)
[Week 4,5]-85
Goal Analysis
o Each goal (except the top-most) is typically justified
by at least another goal offering an answer to
why a goal is included
Goal 1
Why
SubGoal 1.1
SubGoal 1.2
[Week 4,5]-86
Goal Analysis
o Each goal (except leaves) is refined as a collection
of subgoals describing how a goal is satisfied
Goal 1
How
SubGoal 1.1
SubGoal 1.2
[Week 4,5]-87
Why
How
safe
transportation
rapid
transportation
Train progress
No delay
No train
collision
Doors closed
While moving
No trains on
Same block
[Week 4,5]-88
Why
How
safe
transportation
rapid
transportation
Train progress
No delay
No trains on
Same block
No train
collision
Doors closed
While moving
[Week 4,5]-89
Why
How
safe
transportation
rapid
transportation
Train progress
No delay
No train
collision
No trains on
Same block
Doors closed
While moving
[Week 4,5]-90
[Week 4,5]-91
AND-refinement
OR-refinement
[Week 4,5]-92
[Week 4,5]-93
[Week 4,5]-94
[Week 4,5]-95
[Week 4,5]-96
o For example:
Problem: Too many problems that users report to the
Helpdesk are being lost in the system
Corresponding Goal: Lost user problems are minimised or
eliminated
[Week 4,5]-97
[Week 4,5]-98
[Week 4,5]-99
KAOS
o KAOS is a method (for formalising goals into
requirements)
Supporting tool: Objectiver (www.objectiver.com)
[Week 4,5]-100
KAOS: Models
o Goal model (Requirements development focus)
Intentional: Modeling functional & non-functional goals by
AND/OR goal diagrams
[Week 4,5]-101
[Week 4,5]-102
KAOS: Process
o During the KAOS process, a requirements model is
created:o The highest-level goals are identified from the
requirements (obtained)
o Goals are system objectives that cannot be met by
a single agent.
These are reduced to constraints (leaf goals) which can be
met by a single agent
[Week 4,5]-103
[Week 4,5]-104
[Week 4,5]-105
[Week 4,5]-106
References
o [LW03] Dean Leffingwell and Don Widrig (2003), Managing Software
Requirements: A use case approach (2nd Ed), Addison Wesley
o [BD00] Brugge & Dutoit, (2000) Object-Oriented Software Engineering,
Prentice Hall
o [Lilly99] Susan Lilly (1999), Use Case Pitfalls:Top 10 Problems from Real
Projects Using Use Cases (in Readings)
o Haywood, L (2004), Lecture Notes on Requirements Elicitation, RMIT,
COSC 2274/2275 Software Requirements Engineering
o Craig Larman (2004), Applying UML and PatternsAn Intro to OOA/D
and Iterative Development
o The Rational Edge -- May 2003 -- Adopting Use Cases Part I:
Understanding Types of Use Cases and Artifacts,
http://bronze.rational.com:8169/content/may_03/m_ng.jsp
o IBM Rational Software, Gary Cernosek, Eric Naiburg (June 2004), The
Value of Modeling; http://www128.ibm.com/developerworks/rational/library/04/r-3196/
[Week 4,5]-107
References
o Artifacts for Agile Modeling: The UML and Beyond
http://www.agilemodeling.com/essays/modelingTechniques.ht
m
o Goal-Oriented Requirements Engineering: from System
Objectives to UML Models to Precise Software Specifications,
Axel van Lamsweerde, May 2003, ICSE 03
o Haywood, E (2004), Lecture Notes on Goal-based requirements
engineering, RMIT, COSC 2274/2275 Software Requirements
Engineering
o Quality starts by defining your goals !, www.objectiver.com
o A KAOS Tutorial, Objectiver, September 5, 2003,
www.objectiver.com
o Goal-Driven RE: Modelling and Guidance, Dr Evangelia
Kavakli
Chapter 2 - Goal Modelling in RE (PhD Thesis)
http://www.aegean.gr/culturaltec/Kavakli/publications/
RMIT Software Requirements Engineering 2007: COSC 2274/2275
[Week 4,5]-108