Software Engineering
Requirements Analysis Phase
Requirements Analysis Activity
(Identifying Objects, Scenarios)
Requirements Analysis
D You made a list of functional requirements
Describe the required interactions between the
system and its environment (independent of
implementation)
1
Requirements Analysis
D Now you need to validate and verify your
requirements to assure that they are
Complete: all required features must be
described
Consistent: no two requirements in the
specification may contradict each other
Unambiguous: no requirement can be
interpreted in two different and contradictory
ways
Correct: Only features desired by the client /
developer are included not unintended extra
features (problems)
Janice Regan, 2008 3
Requirements Analysis
D You continued to build your analysis model
and verify/validate your requirements by
Identifying the actors for your system
Building a system context diagram to clarify
what is part of your proposed system
Identifying and developing informal scenarios
that describe all functions of your system
Building use cases based on groups of related
informal scenarios
Building a functional model of your system by
investigating relationships between use cases
and actors and making a use case diagram
Janice Regan, 2008 4
2
Requirements Analysis Activity
Software
Client/User Developer
Update SRS
Use Case
Questions Diagram Use Cases
System functionality
Dynamic behavior
3
From use cases to classes
D Consider one use case, make a class
diagram
1. Identify primary classes to describe the
objects involved in a use case
2. Add the relationships between these classes
extracted from the use case and / or the
requirements satisfied by the use case
4
From use cases to classes
D For the Rational Unified Process
For each use case need at least one interface
class
For each used case need one (rarely more)
control class
For each use case identify primary entity
classes to describe the objects involved
Make a class diagram for each class, then
combine. Or make a analysis model for one
use case, then add additional use cases
Janice Regan, 2008 9
D Boundary Classes
D Control Classes
5
Use case diagram for ATM
Deposit
Transfer
Bank database
customer
Withdraw
Database
query or
Cashier response Database
interface translator query or
response
deposit database
Janice Regan, 2008 12
6
Primary Entity Classes
D Model phenomena or concepts
real life objects or events in the application
domain
Other objects, events or concepts handled by
the system
D Require long term or persistent storage of
information describing their instances (objects).
D May be passive or active (encapsulate complex
behavior related to the information it represents)
D Isolate changes to the data they represent
7
Identifying Primary Entity Classes
D To identify entities that should be represented by
primary classes select nouns from the use case
and functional requirements for the use case,
inspect each noun (start with recurring nouns) for
the following properties
Retained information
Common attributes (different instances)
Multiple attributes
Needed services
Common operations
Patron
Book
8
Primary Entity Class ?
D Multiple attributes, Common attributes
Is there more than one attribute (other noun)
describing the candidate for primary class?
Home phone number of patron ? NO
Book (title, publisher, call number, …)
9
Boundary Classes
D Model the interaction of a system and its actors
Receiving information from the actor
Presenting information to the actor
D Represent abstractions of API’s, sensors, input
/ output devices, external data repositories,
forms …
Model conceptually what requests and information
exchanged (no details of how or interface, just what)
D Each boundary class should be associated with
at least on actor. Each actor should be
associated with at least one boundary class
Janice Regan, 2008 19
10
Control Classes
D Control sequence of events, coordination between
classes
D May represent complex sequences of calculations
not related to one specific entity class
D Do not usually represent a concrete object in the
real world
D Do not deal with interaction with actors or with
management of persistent data
D The lifespan of the object should cover the use
case duration or the duration of the user session
Janice Regan, 2008 21
Support Classes
D Container classes
e.g.: List and Hash Table classes
D Service classes
e.g.: Stream classes
11
Formal Scenario Development
D Scenarios are derived from use cases
Example: Scenario #1
D Use Case Name: CheckInResource (#7)
D Preconditions:
Eva the Librarian has successfully gained access
to the LMS.
LMS is ready to go (DB has been populated and
LMS has been initialized).
Options screen is displayed
Janice Regan, 2008 24
12
Example: Scenario #1 (cont)
D Main flow of events:
Patron Paul (a student) comes up to the counter
and wishes to return the Quantum Physics book
he borrowed the previous semester.
Eva the librarian takes the book Paul is handing
out to her selects CHECKINRESOURCE option and
types in its valid Dewey call number.
The LMS displays the information related to the
Quantum Physics book on the screen and let
Eva know that Paul owes the library $5 (max.).
13
Example: Scenario #1 (cont)
D Post conditions:
Paul’s record is now showing that he has
returned the Quantum Physics book and that
he has paid the overdue charge. The
Quantum Physics book has now a status of
"reshelve", today's date as a date of return,
date of loan has been cleared and so as the
due date.
Example: Scenario #2
D Use Case Name: CheckInResource (#7)
14
Example: Scenario #2 (cont)
D Main flow of events
Patron Paul (a student) has deposited the
Quantum Physics book he borrowed the
previous semester in the return box.
Eva the librarian takes the book from the
return box and types in its Dewey call
number.
Example: Scenario #2
D Main flow of events (Cont)
The LMS displays the information related to
the Quantum Physics book on the screen and
lets Eva know that the borrowing patron Paul
owes the library $5. Eva makes sure that
Paul's record reflects such overdue charge.
Then Eva ensures that no one has requested
the book. Since no one has, Eva verifies
looking at the screen that the book has been
checked in properly.
15
Example: Scenario #2
D Post conditions:
Paul record now showing an overdue charge
of $5 (since it was overdue by quite a few
weeks). The Quantum Physics book has now
a status of "reshelve", today's date as a date
of return, date of loan has been cleared and
so as the due date.
16