Post on 20-Jan-2016
1
Chapter 12Chapter 12Analysis Analysis ModelingModeling
2
Analysis Analysis ModelingModeling
A set of models: data, function, and A set of models: data, function, and behavior behavior
Combination of text and diagrammatic Combination of text and diagrammatic formsforms
Different points of view. Different points of view. ReviewedReviewedWork products: data object descriptions, Work products: data object descriptions,
entity relationship diagrams, ….entity relationship diagrams, ….Methods: Structured, Object-oriented, and Methods: Structured, Object-oriented, and
othersothers
3
Structure of Analysis Structure of Analysis modelmodel
5
Data ModelingData Modeling
6
Data Data ModelingModeling
7
Why Data Modeling?Why Data Modeling?
examines examines data objectsdata objects independently of processingindependently of processing
focuses attention on the focuses attention on the data data domaindomain
creates a model at the creates a model at the customer’s levelcustomer’s level of abstraction of abstraction
indicates how data objects indicates how data objects relate torelate to one another one another
8
What is a Data Object?What is a Data Object?
ObjectObject ——something that is described by a setsomething that is described by a setof attributes (data items) and that will be of attributes (data items) and that will be manipulated within the software (system)manipulated within the software (system)
each each instanceinstance of an object (e.g., a book) of an object (e.g., a book) can be identified uniquely (e.g., ISBN #) can be identified uniquely (e.g., ISBN #)
each plays a necessary role in the systemeach plays a necessary role in the systemi.e., the system could not function without i.e., the system could not function without access to instances of the objectaccess to instances of the object
each is described by attributes that are each is described by attributes that are themselves data itemsthemselves data items
9
Typical ObjectsTypical Objects
external entities external entities (printer, user, sensor)(printer, user, sensor)thingsthings (e.g, reports, displays, signals) (e.g, reports, displays, signals) occurrences or events occurrences or events (e.g., interrupt, alarm)(e.g., interrupt, alarm)roles roles (e.g., manager, engineer, salesperson)(e.g., manager, engineer, salesperson)organizational unitsorganizational units (e.g., division, team)(e.g., division, team)placesplaces (e.g., manufacturing floor) (e.g., manufacturing floor)
structures structures (e.g., employee record)(e.g., employee record)
10
Identifying ObjectsIdentifying Objectsand Operationsand Operations
define “objects” by define “objects” by underlining all underlining all nouns in the written statement of nouns in the written statement of scopescope
producers/consumers of dataproducers/consumers of data places where data are storedplaces where data are stored ““composite” data itemscomposite” data items
define “operations” by define “operations” by double double underlining all active verbs underlining all active verbs
processes relevant to the applicationprocesses relevant to the application data transformationsdata transformations
consider other “services” that will be consider other “services” that will be required by the objectsrequired by the objects
11
Data Objects and Data Objects and AttributesAttributes
A data object contains a set of attributes A data object contains a set of attributes that act as an aspect, quality, character-that act as an aspect, quality, character-istic, or descriptor of the objectistic, or descriptor of the object
object: automobileobject: automobileattributes:attributes: makemake modelmodel body typebody type priceprice options codeoptions code
12
13
What is a Relationship?What is a Relationship?
relationshiprelationship ——indicates “connectedness”; indicates “connectedness”; a "fact" that must be "remembered" a "fact" that must be "remembered" by the system and cannot or is not computed by the system and cannot or is not computed or derived mechanicallyor derived mechanically
several instances of a several instances of a relationship can existrelationship can exist
objects can be related in many objects can be related in many different waysdifferent ways
14
15
16
Cardinality & Cardinality & ModalityModality
17
The ERD: An The ERD: An Example (1)Example (1)
18
The ERD: An Example (2)The ERD: An Example (2)
(1,1)(1,1) (1,m)(1,m)placesplacesCustomerCustomer
requestrequestfor servicefor service
generatesgenerates (1,n)(1,n)
(1,1)(1,1)
workworkorderorder
workworktaskstasks
materialsmaterials
consistsconsistsofof
listslists
(1,1)(1,1)(1,w)(1,w)
(1,1)
(1,i)(1,i)
selectedselectedfromfrom
standardstandardtask tabletask table
(1,w)(1,w)
(1,1)(1,1)
19
Data Object Type Data Object Type HierarchiesHierarchies
20
Associative Data Associative Data ObjectObject
22
Function Function ModelingModeling
23
Function Function ModelingModeling
24
The Flow ModelThe Flow Model
Every computer-based system is an Every computer-based system is an information transform ....information transform ....
computercomputerbasedbased
systemsysteminputinput outputoutput
25
Flow Modeling NotationFlow Modeling Notation
external entityexternal entity
processprocess
data flowdata flow
data storedata store
26
External EntityExternal Entity
A producer or consumer of dataA producer or consumer of data
Examples: a person, a device, a sensorExamples: a person, a device, a sensor
Another example: computer-basedAnother example: computer-basedsystemsystem
Data must always originate somewhereData must always originate somewhereand must always be sent to somethingand must always be sent to something
27
ProcessProcess
A data transformer (changes inputA data transformer (changes inputto output)to output)
Examples: compute taxes, determine area,Examples: compute taxes, determine area,format report, display graph format report, display graph
Data must always be processed in some Data must always be processed in some way to achieve system functionway to achieve system function
28
Data FlowData Flow
Data flows through a system, beginningData flows through a system, beginningas input and be transformed into output.as input and be transformed into output.
computecomputetriangle triangle
areaarea
basebase
heightheight
areaarea
29
Data StoresData Stores
Data is often stored for later use.Data is often stored for later use.
look-uplook-upsensorsensor
datadata
sensor #sensor #
report requiredreport required
sensor #, type, sensor #, type, location, agelocation, age
sensor datasensor data
sensor numbersensor number
type, type, location, agelocation, age
30
ExamplExamplee
31
Constructing a DFD—IConstructing a DFD—I
review ERD to isolate data review ERD to isolate data objects and grammatical parse objects and grammatical parse to determine “operations”to determine “operations”
determine external entities determine external entities (producers and consumers of (producers and consumers of datadata
create a level 0 DFDcreate a level 0 DFD
32
Level 0 DFD ExampleLevel 0 DFD Example
useruserprocessing processing
requestrequest
videovideosourcesource NTSCNTSC
video signalvideo signal
digitaldigitalvideovideo
processorprocessor
requestedrequestedvideovideosignalsignal
monitormonitor
33
Constructing a DFD—IIConstructing a DFD—II
write a narrative describing the write a narrative describing the transformtransform
parse to determine next level parse to determine next level transformstransforms
““balance” the flow to maintain balance” the flow to maintain data flow continuitydata flow continuity
develop a level 1 DFDdevelop a level 1 DFD
34
The Data Flow HierarchyThe Data Flow Hierarchy
PPaa bbxx yy
p1p1p2p2
p3p3p4p4 55
aa
bb
cc
ddee
ff
gg
level 0level 0
level 1level 1
35
Maps intoMaps into
DFDs: A Look AheadDFDs: A Look Ahead
analysisanalysis modelmodel
design modeldesign model
36
Data Flow Diagramming:Data Flow Diagramming:GuidelinesGuidelines
all icons must be all icons must be labeledlabeled with with meaningful namesmeaningful names
the DFD evolves through a the DFD evolves through a numbernumber of levels of detail of levels of detail
always begin with a always begin with a context levelcontext level diagram (also called level 0)diagram (also called level 0)
always show external entities at always show external entities at level 0level 0
always label data flow arrowsalways label data flow arrowsdo notdo not represent procedural logic represent procedural logic
38
Behavioral Behavioral ModelingModeling
39
Behavior Behavior ModelingModeling
40
Behavioral ModelingBehavioral Modeling
Outsideworld
Application
events behavior
41
Real-Time Analysis Real-Time Analysis MethodsMethods
each introduces its own notation, each introduces its own notation, but allbut all
• propose an approach for representing propose an approach for representing control and separating it from datacontrol and separating it from data
• provide a mechanism for specifying events, provide a mechanism for specifying events, states, and distributed processingstates, and distributed processing
• begin at the analysis level and work to begin at the analysis level and work to derive processor assignments, tasks and derive processor assignments, tasks and program architectures program architectures
42
Control Flow Control Flow DiagramDiagram
(CFD)(CFD)
a vertical bar implies an input to or output from a control a vertical bar implies an input to or output from a control
the control flow diagram is "superimposed" on the DFD the control flow diagram is "superimposed" on the DFD and shows events that control the processes noted in and shows events that control the processes noted in the DFDthe DFD
control flows—events and control items—are noted by control flows—events and control items—are noted by
dashed arrowsdashed arrows
spec (CSPEC) — a separate specification that spec (CSPEC) — a separate specification that describes how control is handleddescribes how control is handled
a dashed arrow entering a vertical bar is an input to the a dashed arrow entering a vertical bar is an input to the CSPECCSPEC
a dashed arrow leaving a process implies a data a dashed arrow leaving a process implies a data conditioncondition
a dashed arrow entering a process implies a control a dashed arrow entering a process implies a control input read directly by the processinput read directly by the process
control flows do not physically activate/deactivate the control flows do not physically activate/deactivate the processes—this is done via the CSPECprocesses—this is done via the CSPEC
43
ExamplExamplee
44
Extensions for Real-Time Extensions for Real-Time SystemsSystems
Ward & MellorWard & Mellor
45
ExamplExamplee
46
Extensions for Real-Time Extensions for Real-Time SystemsSystems
Hatley & PirbhaiHatley & Pirbhai
47
ExamplExamplee
48
49
The States of a SystemThe States of a Systemstatestate—a set of observable circum-—a set of observable circum-
stances that characterizes the stances that characterizes the behavior of a system at a given behavior of a system at a given timetime
state transitionstate transition—the movement —the movement from one state to anotherfrom one state to another
eventevent—an occurrence that causes —an occurrence that causes the system to exhibit some the system to exhibit some predictable form of behaviorpredictable form of behavior
actionaction—process that occurs as a —process that occurs as a consequence of making a consequence of making a transitiontransition
50
State Transition State Transition DiagramDiagram
(STD)(STD)make a list of the different states make a list of the different states
of a system (How does the system of a system (How does the system behave?)behave?)
indicate how the system makes a indicate how the system makes a transition from one state to transition from one state to another (How does the system another (How does the system change state?)change state?)
• indicate eventindicate event• indicate actionindicate action
draw a draw a state transition diagramstate transition diagram
51
State Transition State Transition DiagramDiagramNotationNotation
statestate
new statenew state
event causing transitionevent causing transitionaction that occursaction that occurs
52
ExampleExample
readingreadingoperatoroperator
commandscommands
making copiesmaking copies reloading paperreloading paper
problem stateproblem state
fullfullinvoke read-op-inputinvoke read-op-input
full and startfull and startinvoke manage-copyinginvoke manage-copying
copies donecopies doneinvoke read-op-inputinvoke read-op-input
emptyemptyinvoke reload paperinvoke reload paper
not jammednot jammedinvoke read-op-inputinvoke read-op-input
jammedjammedinvoke problem-diagnosisinvoke problem-diagnosis
54
Data Data DictionaryDictionary
55
Data Data DictionaryDictionary
56
The Data The Data DictionaryDictionary
a quasi-formal grammar for describing the content of data that the software will process and create a notation for describing control data and the values that control data can take, e.g., "on," or "off" a repository that also contains "where-used" / "how used" information a notation that can be represented manually, but is best developed using CASE tools
57
InformatiInformationonName:
Aliases: Where used: How used: Description:
Supplementaryinformation:
the primary name of the composite data item other names for the data item data transforms (processes) that use the composite data item the role of the data item (input, output, temporary storage, etc. a notation for representing content (presented on next slide)
specific information about data types, pre-set values (if known)
58
Data Dictionary Data Dictionary NotationNotationNotation
=
+
[ ]
{ }
( ... )
* ... text ...*
n
Meaning
is composed of
and
either-or
n repetitions of
optional data
delimits a comment
59
ExamplExamplee
telephone number
Name: Aliases: Where/How used:
Description:
Format:
Telephone number
none
Assess against set-up (output)Dial phone (input)
telephone no. = [ local number | long distance number ] local number = prefix + access numberlong distance number = 1+ area code +local numberarea code = [800 | 888 | 561]prefix = *a three digit number that never starts with 0 or 1*access number = *any four number string*
Build the requirements dictionary:
alphanumeric data
Telephone number tonesDial
phone
61
The MechanicsThe Mechanicsof of
Structure AnalysisStructure Analysis
62
Data Data ModelingModeling
63
ERERDD
64
DODODD
66
Function Function ModelingModeling
67
1. 1. Level 0 Level 0 DFDDFD
68
2. 2. Level 1 Level 1 DFDDFD
Underline the first occurrence of all Underline the first occurrence of all nouns and italicize the first occurrence nouns and italicize the first occurrence of all verbs.of all verbs.
Example:Example: … …..SafeHome softwareSafeHome software enablesenables the the
homeownerhomeowner to to configureconfigure the the security systemsecurity system when it is when it is installed,installed, monitorsmonitors all all sensorssensors connectedconnected to to the security system, and the security system, and interacts interacts with the homeowner through a with the homeowner through a key key padpad and and function keysfunction keys containedcontained in in the SafeHome the SafeHome control panelcontrol panel……
69
70
3. 3. Level 2 Level 2 DFDDFD
71
Process Specification Process Specification (PSPEC)(PSPEC)
PSPECPSPECnarrativenarrativepseudocode (PDL)pseudocode (PDL)equationsequationstablestablesdiagrams and/or chartsdiagrams and/or charts
bubblebubble
72
Creating Mini-SpecsCreating Mini-Specs
SoftwareSoftwareSpecificationSpecification
73
5.5. Creating a Process Specification Creating a Process Specification (PSPEC)(PSPEC)
Using PDL
75
Behavior Behavior ModelingModeling
76
Control Flow Control Flow DiagramDiagram
77
Control Specification Control Specification (CSPEC)(CSPEC)
The CSPEC can be:
state transition diagram
state transition table
decision tables
process activation tablescombinatorial spec
79
State Transition Diagram State Transition Diagram (STD)(STD)
80
Process Activation Table Process Activation Table (PAT)(PAT)
82
Data Data DictionaryDictionary
83
Data Data DictionaryDictionary
84
The Data The Data DictionaryDictionary
a quasi-formal grammar for describing the content of data that the software will process and create a notation for describing control data and the values that control data can take, e.g., "on," or "off" a repository that also contains "where-used" / "how used" information a notation that can be represented manually, but is best developed using CASE tools
85
InformatiInformationonName:
Aliases: Where used: How used: Description:
Supplementaryinformation:
the primary name of the composite data item other names for the data item data transforms (processes) that use the composite data item the role of the data item (input, output, temporary storage, etc. a notation for representing content (presented on next slide)
specific information about data types, pre-set values (if known)
86
Data Dictionary Data Dictionary NotationNotationNotation
=
+
[ ]
{ }
( ... )
* ... text ...*
n
Meaning
is composed of
and
either-or
n repetitions of
optional data
delimits a comment
87
ExamplExamplee
telephone number
Name: Aliases: Where/How used:
Description:
Format:
Telephone number
none
Assess against set-up (output)Dial phone (input)
telephone no. = [ local number | long distance number ] local number = prefix + access numberlong distance number = 1+ area code +local numberarea code = [800 | 888 | 561]prefix = *a three digit number that never starts with 0 or 1*access number = *any four number string*
Build the requirements dictionary:
alphanumeric data
Telephone number tonesDial
phone
88
######### The End ######### The End ######################
89
Data ModelingData Modeling• Data object description (DOD)Data object description (DOD)
Identify objectsIdentify objects Identify attributesIdentify attributes Build Build data object tabledata object table
• Entity relationship diagram (ERD)Entity relationship diagram (ERD) Identify entity relationshipIdentify entity relationship Identify cardinality & modalityIdentify cardinality & modality Build Build ERDERD
• Data object-type hierarchies, associative data Data object-type hierarchies, associative data objects…objects…
90
Function ModelingFunction Modeling• Data Flow Diagram (DFD) Data Flow Diagram (DFD) • Process Specification (PSPEC)Process Specification (PSPEC)
Behavior ModelingBehavior Modeling• Control Flow Diagram (CFD)Control Flow Diagram (CFD)• Control Specification (CSPEC)Control Specification (CSPEC)
State Transition Diagram (STD)State Transition Diagram (STD) Process Activation Table (PAT)Process Activation Table (PAT)
Data DictionaryData Dictionary