Title: Chapter 12 Analysis Modeling
1Chapter 12Analysis Modeling
2Analysis ModelingWhere to Begin?
- Use the statement of scope and other SRS
documents already created to guide you to
building an analysis model. - The analysis model will include acquired from
- the working document
- A set of use-cases
- Other items
- the statement of scope must be parsed to
extract data, function and behavioral domain
information
3Statement of Scope
- a relatively brief description of the system to
be built - indicates data that are input and output and
basic functionality - indicates conditional processing (at a high
level) - implies certain constraints and limitations
4Identifying Object and Operations
Noun/Verb Approach
- define objects by underlining all nouns in the
written statement of scope - producers/consumers of data
- places where data are stored
- composite data items
- define operations by double underlining all
active verbs - processes relevant to the application
- data transformations
- consider other services that will be required
by the objects
5Identifying Object and Operations
Discovery Approach
- define all potential objects by thinking about
the system. Consider everything. - Add attributes identifying those potential
objects which are duplicates, attributes
themselves, operations, services. - Add operations again identifying those potential
objects which are duplicates, attributes,
operations, and services.
6Identifying Object and Operations
Data Approach
- define all data entities and consider them as the
potential objects of the system. - Add attributes identifying those potential
objects which are duplicates, attributes
themselves, operations, services and adding any
new objects needed to support attributes. - Add operations again identifying those potential
objects which are duplicates, attributes,
operations, and services and adding any new
objects needed to support operations.
7Video Rental Example
- A video store offers rental of videos to members.
To become a member you have to have a drivers
license and a credit card. You may rent up to 3
videos. Corporate keeps up with trends and
orders the tapes for rental. - Members check out and return videos due in one
day. Overdue fees of 1 dollar a day is charged
for late videos. - Upon rental a rental slip is made for customers
which contains name, addr, city, and iterations
of movies with tape id, movie id, title, length,
etc.
8Video Rental System
- Use the noun approach - Grady Booch
- Use discovery approach Linda Northrup
- Use the data approach Steven Mellor, Sally
Schaler - Use the responsibility driven design approach
Rebecca Wirth Brock - Use one of above and Analysis Patterns Approach
Joe Yoeder
9Video Rental System
- Remember these techniques identify the domain
(conceptual) classes, not design classes, not
programming classes, and not implementation
classes.
10Video Rental System noun/verb
- A video store offers rental of videos to members.
To become a member you have to have a drivers
license and a credit card. You may rent up to 3
videos. Corporate keeps up with trends and
orders the tapes for rental. - Members check out and return videos due in one
day. Overdue fees of 1 dollar a day is charged
for late videos. - Upon rental a rental slip is made for customers
which contains name, addr, city, and iterations
of movies with tape id, movie id, title, length,
etc.
11Video Rental System noun/verb
- A video store offers rental of videos to members.
To become a member you have to have a drivers
license and a credit card. You may rent up to 3
videos. Corporate keeps up with trends and
orders the tapes for rental. - Members check out and return videos due in one
day. Overdue fees of 1 dollar a day is charged
for late videos. - Upon rental a rental slip is made for customers
which contains name, addr, city, and iterations
of movies with tape id, movie id, title, length,
etc.
12Video Rental System noun/verb
NOUNS Store Video Member License Card Corporat
e Trends Tapes Slip Customers Name Addr City I
terations Tape Movie id Title length
VERBS Offers Becomes Rents Orders Checkout Return
Charged Made contains
13Video Rental System noun/verb
Lay the nouns out on a table, 3X5 cards, chalk
board, ppt file
NOUNS Store Video Member License Card Corpo
rate Trends Tapes Slip Name
Customers Addr Iterations Movie id
Tape Title length
14Video Rental System noun/verb
Begin adding attributes
NOUNS Store Video Member License Card
name, addr.. name,length name, addr
num, name num,name, Corporate Trends Tapes
Slip Name Customers Addr Iterations Movie
id Tape name, addr..
Id num\ Title length
15Video Rental System noun/verb
Begin clustering the potential objects -
Singletons
NOUNS Store Video Member License Card
name, addr.. name,length name, addr
num, name num,name, Corporate Trends Tapes
Slip Name Customers Addr Iterations Movie
id Tape name, addr..
Id num\ Title length
Same as store only one instance
16Video Rental System noun/verb
Begin clustering the potential objects -
attributes
NOUNS Store Video Member License Card
name, addr.. name,length name, addr
num, name num,name, Corporate Trends Tapes
Slip Name Customers Addr Iterations Movie
id Tape name, addr..
Id num\ Title length
attribute
Same as store only one instance
attribute
attribute
17Video Rental System noun/verb
Begin clustering the potential objects more
attributes
NOUNS Store Video Member License Card
name, addr.. name,length name, addr
lic num, card num Trends Tapes Slip
Customers Addr name, addr..
Iterations Movie id Tape ID
Id num\
attribute
attribute
attribute
attribute
attribute
18Video Rental System noun/verb
Begin clustering the potential objects -
duplicates / descriptors
NOUNS Store Video Member name, addr..
name,length name, addr
lic
num, card num Trends Tapes Slip Customers
name, addr.. Iterations
to member
descriptor
19Video Rental System noun/verb
Begin clustering the potential objects - I/O
NOUNS Store Video Member name, addr..
name,length name, addr
lic
num, card num Trends Tapes Slip tape
id, name, addr..
I/O
20Video Rental System noun/verb
So how did we do this clustering
- Identified all potential domain (conceptual
classes) using the noun approach --discovery,
data methods, or responsibility driven also work. - Identified potential attributes and perhaps
operations of the potential classes.
21Video Rental System noun/verb
- 4. Eliminated some potential classes by
clustering - Input/Outputs (never domain classes)
- Singletons (rarely classes)
- Potential objects that turned out to be
attributes - Potential objects that turned out to be behaviors
- Duplicates
- Items that only described other things ( no
attributes or methods) - Constructed the Class Diagram and the network
helped to cluster even more. - Identify MM and resolved
22Video Rental System noun/verb
Begin clustering the potential objects by their
attributes and methods
Store
Video
Trends
VERBS Offers Becomes Rents Orders Checkout Return
Charged Made contains
Tape
Member
Now lets see if we can model this. Now add
cardinality, names of relationshipsresolve MM
then add attributes and methods
23Data Modeling and Entity Relationship
(E-R)Diagramming
24Why Data Modeling?
- examines data objects independently of processing
- focuses attention on the data domain
- creates a model at the customers level of
abstraction - indicates how data objects relate to one another
25What is a Data Object?
Object
something that is described by a set
of attributes (data items) and that will be
manipulated within the software (system)
instance
each
of an object (e.g., a book)
can be identified uniquely (e.g., ISBN )
each plays a necessary role in the system
i.e., the system could not function without
access to instances of the object
each is described by attributes that are
themselves data items
26Typical Objects
external entities (printer, user, sensor)
things
(e.g, reports, displays, signals)
occurrences or events (e.g., interrupt, alarm)
roles
(e.g., manager, engineer, salesperson)
(e.g., division, team)
organizational units
places
(e.g., manufacturing floor)
structures (e.g., employee record)
27Data Objects and Attributes
A data object contains a set of attributes that
act as an aspect, quality, character-istic, or
descriptor of the object
object automobile attributes make model
body type price options code
28What is a Relationship?
relationship
indicates connectedness
a "fact" that must be "remembered"
by the system and cannot or is not computed or
derived mechanically
- several instances of a relationship can exist
- objects can be related in many different ways
29ERD Notation
One common form
(0, m)
object
object
relationship
1
2
(1, 1)
attribute
Another common form
relationship
object
object
1
2
(1, 1)
(0, m)
30Building an ERD
- Level 1model all data objects (entities) and
their connections to one another - Level 2model all entities and relationships
- Level 3model all entities, relationships, and
the attributes that provide further depth
31The ERD An Example
request for service
Customer
places
(1,1)
(1,m)
(1,1)
standard task table
(1,n)
work order
generates
(1,1)
(1,1)
(1,1)
(1,w)
work tasks
selected from
consists of
(1,w)
(1,i)
materials
lists
32Creating a Flow Model
33The Flow Model
Every computer-based system is an information
transform ....
computer based system
input
output
34The Flow Model
Every computer-based system is an information
transform ....
computer based system
input
output
35Flow Modeling Notation
external entity
process
data flow
data store
36External Entity
A producer or consumer of data
Examples a person, a device, a sensor
Another example computer-based system
Data must always originate somewhere and must
always be sent to something
37Process
b
A data transformer (changes input to output)
Examples compute taxes, determine area, format
report, display graph
Data must always be processed in some way to
achieve system function
38Data Flow
Data flows through a system, beginning as input
and be transformed into output.
base
compute triangle area
area
height
39Data Stores
Data is often stored for later use.
sensor
sensor , type, location, age
look-up sensor data
report required
type, location, age
sensor number
sensor data
40Data Flow DiagrammingGuidelines
- icons must be labeled with meaningful names
- DFD evolves through a number of levels of detail
- always begin with a context level diagram (also
called level 0) - always show external entities at level 0
- always label data flow arrows
- do not represent procedural logic
41Constructing a DFDI
- review ERD to isolate data objects and
grammatical parse to determine operations) - determine external entities (producers and
consumers of data - create a level 0 DFD
42Level 0 DFD Example
processing request
user
requested video signal
digital video processor
monitor
video source
NTSC video signal
43Constructing a DFDII
- write a narrative describing the transform
- parse to determine next level transforms
- balance to maintain data flow continuity
- develop a level 1 DFD
- use a 15 (approx.) expansion ratio
44The Data Flow Hierarchy
a
b
P
x
y
level 0
c
p2
a
f
p1
b
p4
d
5
g
p3
e
level 1
45Flow Modeling Notes
- each bubble is refined until it does just one
thing - the expansion ratio decreases as the number of
levels increase - most systems require between 3 and 7 levels for
an adequate flow model - a single data flow item (arrow) may be expanded
as levels increase (data dictionary provides
information)
46DFDs A Look Ahead
analysis model
Maps into
design model
47Creating a Use Case Model
48The Use Case Model
Every computer-based system is a series of
actions, subsystems that interact with outside
actors (external entities).
use case
49Use Case Notation
actor
relationship (usually trigger)
use case
50Actor
A
Examples a person, a device, a sensor
Another example computer-based system
Something must trigger the action in the use
case.
51Use Case (Process)
A process triggered by a user
Examples compute taxes, determine area, Enter
student data,
These functions must be performed.
52Connection
The actors trigger the process.
use case
53Use Case Guidelines
- use cases like processes vary in granularity.
- show a good way to begin defining system
scenarios. - offer an abstraction which can have a test plan
- begin the traceability of the system
- has extensions
- ltltextendsgtgt for extending the functionality of a
use case - ltltusesgtgt for using when one use case uses another
use case - ltltincludegtgt for inner use of a use case inside
another - ltltcallsgt for invocation of other use cases.
54Constructing a Use Case
- Review the needed processes triggered by users.
- determine the actors involved.
- create the first level of use cases
- Define any extensions.
55High Level Use Cases
System
Video Rental System
Order new videos
Use Case
Corporate
Rent video
Return video
Actor
Customer
56Constructing Use Cases
- write a narrative describing the use case
- Define the classes (if known) that participate in
that use case - Define the pre and post conditions of the use
case.
57Use Case Diagrams A Look Ahead
Rent video
use case model
Maps into
Customer
sequence design model
58Behavioral Modeling and Process Specification
59Behavioral Modeling
events
behavior
Outside world
Application
60The States of a System
- statea set of observable circum-stances that
characterizes the behavior of a system at a given
time - state transitionthe movement from one state to
another - eventan occurrence that causes the system to
exhibit some predictable form of behavior - actionprocess that occurs as a consequence of
making a transition
61Behavioral Modeling
- make a list of the different states of a system
(How does the system behave?) - indicate how the system makes a transition from
one state to another (How does the system change
state?) - indicate event
- indicate action
- draw a state transition diagram
62State Transition DiagramNotation
state
event causing transition
action that occurs
new state
63State Transition Diagram
full and start
reading
invoke manage-copying
operator
commands
full
invoke read-op-input
copies done
invoke read-op-input
making copies
reloading paper
empty
invoke reload paper
jammed
invoke problem-diagnosis
not jammed
invoke read-op-input
problem state
64Writing the Software Specification
Everyone knew exactly
what had to be done
until someone wrote it
down!