Você está na página 1de 45

Analysis

Analysis Modeling
Modeling
 Two primary methods today
 Structured Analysis
 Object-oriented analysis
 Some important considerations
 Analysis products must be maintainable
 Effective partitioning is essential
 Graphics should be used whenever possible
 Distinguish between logical and implementation
August 2003
1
Structured
Structured Analysis
Analysis

 Elements of Analysis
 Describe what customer requires
 Establish basis for creating software design
 Define requirements that can be validated

August 2003
2
Graphical
Graphical View
View of
of Model
Model
Pro
sc r i ption ce ss
De Sp
je ct ec
Ob ifi
ca
Entity Data Flow tio
n
ta

Diagram
Da

Relationship
Diagram Data (DFD)
( ERD) Dictionary

State Transition
Diagram (STD)

Con
trol ation
Specific
August 2003
3
Data
Data Modeling
Modeling

 The model consists of


 Data object [types]
 Attributes
 Relationships
 Data objects
 A representation of almost any composite
information that must be understood by
software.
August 2003
4
Data
Data Modeling
Modeling
 Attributes
 Attributes define the properties of a data object and
take on one of three different characteristics:
Name an instance of the data object

 Describe the instance
 Make reference to another instance
Referential
Descriptive
Naming attributes attributes
attributes
Identifier

Make Model ID# Body type Color Owner


Ford Taurus Q12A45.. Sedan Blue ABC
August 2003
Lexus LS400 AB123... Sports White XYZ 5
Data
Data Modeling
Modeling

 Relationships
 Defined pairwise -- many varieties
orders

displays
Book sells Bookstore

returns
August 2003
6
Cardinality
Cardinality and
and Modality
Modality
 Cardinality
 How many occurrences of object X are related to
how many occurrences of object Y
 One-to-one (1:1)
 One-to-many (1:N)
 Many-to-many (M:N)
 Modality
 =0 => optional relationship
 =1 => relationship must appear
August 2003
7
Example
Example

is provided with
Customer Repair action

Mandatory: in order to have Optional: there may be a situation


a repair action, we must have in which a repair action is not
a customer necessary

August 2003
8
Entity
Entity Relation
Relation Diagrams
Diagrams (ERD)
(ERD)
 Cornerstone of the data model -- includes
 data objects,
 attributes,
 relationships, and
 various type indicators

manufacturer builds car

Data Object Table


ID# model body type engine transmission ...
August 2003
9
Example
Example

August 2003
10
Data
Data Object
Object Hierarchies
Hierarchies

August 2003
11
Associating
Associating Data
Data Objects
Objects

August 2003
12
Functional
Functional Modeling
Modeling

c ri ption P ro
cess
De s
je ct Sp
Ob ec
if
Entity Data Flow ica
tio
a

n
at

Relationship Diagram
D

Diagram ( DFD )
Data
Dictionary

State Transition
Diagram

Con
trol a tion
Specific
August 2003
13
Data
Data Flow
Flow Diagrams
Diagrams (DFD)
(DFD)

 A graphical technique that depicts


information flow and the transforms
applied as data move from input to output
 Not the same as flow charts. Does not
show the logic of the transformations
 Can be used at any level of abstraction

August 2003
14
General
General Information
Information Flow
Flow Model
Model

August 2003
15
Basic
Basic Notation
Notation

August 2003
16
Information
Information Flow
Flow Refinement
Refinement
B
A F

V f2 X f6
A z2
f 1 f 4
Z z1 B
W
f5 f7
f3 Y z3

X f x1 f x2
41 43
f
45
Z
Y f y1 f
August 2003
42 44
y2
17
Real
Real Time
Time Extensions
Extensions
 Fundamental issue - The time at which results
are produced is a part of the correctness of
the computation.
 Hatley/Pirbhai notation

August 2003
18
Ward/Mellor
Ward/Mellor Notation
Notation

August 2003
19
Example
Example

August 2003
20
Example
Example

August 2003
21
Hatley
Hatley and
and Pirbhai
Pirbhai Extensions
Extensions
 Use separate data flow diagram (DFD) and
control flow diagram (CFD)
 Data flow diagrams
 Used to represent data and the processes that
manipulate it
 Control flow diagrams
 Show how events flow among processes and show
those external events that cause various processes
to be activated
August 2003
22
Relationship
Relationship Between
Between Models
Models

August 2003
23
Example
Example

August 2003
24
CFD
CFD for
for Photocopier
Photocopier
paper feed status alarm
(jammed, empty)

start/stop manage status


copying produce
Copy user
read displays
operator Info
input
Reload Problem
status perform type
problem
reload diagnosis
paper

full
August 2003
repro
fault 25
Behavioral
Behavioral Modeling
Modeling

c ri ption Pro
ce
Des ss
t
jec Sp
Ob e cif
Data Flow i ca
Entity tio
a

n
at

Diagram
D

Relationship
Diagram Data
Dictionary

State Transition
Diagram ( STD )
Con
trol ation
August 2003
Specific
26
State
State Transition
Transition Diagrams
Diagrams

 A State is any observable mode of behavior


 e.g., reading commands, computing control,
waiting for next time event
 States represented as rectangles
 Arrows represent transitions
 Value above arrow identifies event causing
transition
 Value below arrow indicates ensuring action
August 2003
27
State
State Transition
Transition Diagram
Diagram
idle
full and start invoke read-op-input
invoke manage-coping
reading
commands

copies done full


invoke read-op-input invoke read-op-input

reloading
making copies paper
empty
invoke reload paper

jammed
not jammed
invoke perform problem-diagnosis
diagnosing invoke read-op-input
August 2003
problem 28
Creating
Creating an
an ERD
ERD
 List entities that customer addresses
 For each, determine the connections
 For each connection, create one or more
object-relationship pairs
 For each relationship, determine cardinality
and modality
 Define the attributes of each entity
 Formalize and review ERD
 Iterate
August 2003
29
Home
Home Security
Security System
System Example
Example

 Initial entities
 Homeowner, control panel, sensors, security
system and monitoring service

August 2003
30
Home
Home Security
Security System
System Example
Example
 Relationships between sensor and security sys.
 Security system monitors sensor
 Security system enables/disables sensor
 Security system tests sensor
 Security system programs sensor

August 2003
31
Creating
Creating aa Data
Data Flow
Flow Model
Model
 First create level 0 diagram
 Depict software system as single bubble
 Show primary inputs and outputs
 Identify processes, data objects, and data stores
to be expanded at next level
 Label all arrows with meaningful names
 Information flow continuity must be maintained
 Refine only one bubble at a time
August 2003
32
Home
Home Security
Security System
System Example
Example

August 2003
33
Refinement
Refinement
 Analyze textual description of bubble
 verbs are often processes
 nouns are often external entities, data or control
objects or data stores
 Examples
 Control panel is used to program and configure the
system
 Upon a sensor event, the software invokes an alarm

August 2003
34
Home
Home Security
Security System
System Example
Example

August 2003
35
Home
Home Security
Security System
System Example
Example

August 2003
36
Creating
Creating Control
Control Flow
Flow Models
Models
 Strip arrows from DFD
 Add event and control items. E.g., try
 List all sensors read by the software
 List all interrupt conditions
 List all operator actuated switches
 List all data conditions
 Check noun-verb parse for possible CSPEC I/O
 Identify states, how each is reached and transitions
 Focus on possible omissions
August 2003
37
Level
Level 11 CFD
CFD for
for Safe-Home
Safe-Home

August 2003
38
Control
Control Specification
Specification

August 2003
39
Process
Process Specifications
Specifications

 Describes all flow model processes at final


level of refinement
 Narrative text,
 Program design language description
 Mathematical equations
 Tables
 Diagrams
 Charts
August 2003
41
Data
Data Dictionary
Dictionary

c ri ption Pro
cess
Des
t
bjec Sp
ec
O if
Entity Data Flow ica
tio
a

n
at

Relationship Diagram
D

Diagram
Data
Dictionary

State Transition
Diagram
Con
tro ation
August 2003 l Specific
42
Data
Data Dictionary
Dictionary

 Why a data dictionary? Need an organized way


to represent data & control characteristics
 Usual contents
 Name
 Alias
 Where and how used
 Content description (of composite items)
 Supplementary information, e.g., restrictions,
limitations, preset values
August 2003
43
Example
Example

 Name: Shuttle position


 Aliases: Position-orientation vector
 Where used: Display of Shuttle on map
 Content: x, y, z position wrt to Earth’s
Center, roll, pitch, yaw
 Supplementary Info: Elevation must be
above 140 nautical miles
August 2003
44
Data
Data Dictionary
Dictionary

 Common tools supporting DD


 Preventing creation of duplicate names
 Enforce naming conventions
 Printing dictionary
 Determine the range of impact of changes, i.e.,
which processes are affected
 Assist configuration management

August 2003
45
Summary
Summary
 Key elements
 Data modeling
 Data objects, attributes and relationships
 Cardinality and modality
 Entity-relationship diagrams
 Functional modeling
 Data and control flow diagrams
 Behavioral modeling
 State transition diagrams
 Data Dictionary

August 2003
46

Você também pode gostar