functional modeling
DESCRIPTION
Functional Modeling. Joseph Valacich, Joey George and Jeff Hoffer, Essentials of System Analysis and Design , 4 th edition, Prentice Hall, 2009. Outline. Definition and construction of functional models Documenting functional models---Data flow diagram (DFD) Structuring and organizing DFDs. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Functional Modeling](https://reader035.vdocuments.us/reader035/viewer/2022062520/56815cc5550346895dcac8c7/html5/thumbnails/1.jpg)
Functional Modeling
Joseph Valacich, Joey George and Jeff Hoffer, Essentials of System Analysis and Design, 4th edition, Prentice Hall, 2009.
![Page 2: Functional Modeling](https://reader035.vdocuments.us/reader035/viewer/2022062520/56815cc5550346895dcac8c7/html5/thumbnails/2.jpg)
Outline
• Definition and construction of functional models
• Documenting functional models---Data flow diagram (DFD)
• Structuring and organizing DFDs
2
![Page 3: Functional Modeling](https://reader035.vdocuments.us/reader035/viewer/2022062520/56815cc5550346895dcac8c7/html5/thumbnails/3.jpg)
Review: Modeling
• Functional: what happens• Dynamic: when it happens• Static: what it happens to
3
![Page 4: Functional Modeling](https://reader035.vdocuments.us/reader035/viewer/2022062520/56815cc5550346895dcac8c7/html5/thumbnails/4.jpg)
Functional Models
• Describes computations and transformation of data– How are outputs derived from inputs– Specifies results of computations, not how or
when they are computed
4
programy = f(x)
input x output y
![Page 5: Functional Modeling](https://reader035.vdocuments.us/reader035/viewer/2022062520/56815cc5550346895dcac8c7/html5/thumbnails/5.jpg)
Functional Models (Cont.)
• Does not describe timing– Has no regard for order of operations– No control information– Not a flow chart
• Uses diagrams– Use cases– Data flow diagram (DFD, not a UML diagram)– Activity diagrams
5
![Page 6: Functional Modeling](https://reader035.vdocuments.us/reader035/viewer/2022062520/56815cc5550346895dcac8c7/html5/thumbnails/6.jpg)
Steps in Constructing Functional Model
1. Identify input and output values2. Build data flow diagrams (DFD)
showing functional dependencies.3. Describe the functions.4. Identify the constraints.
6
![Page 7: Functional Modeling](https://reader035.vdocuments.us/reader035/viewer/2022062520/56815cc5550346895dcac8c7/html5/thumbnails/7.jpg)
1. Identify Input/Output
• At the highest level of abstraction, these are the system inputs and outputs.
• Each lower level has inputs and outputs defined by some higher level.
7
programinput x output y
![Page 8: Functional Modeling](https://reader035.vdocuments.us/reader035/viewer/2022062520/56815cc5550346895dcac8c7/html5/thumbnails/8.jpg)
2. Build Diagrams
• Start with each output and determine what function computes it.
• (Or trace forward from inputs.)• Expand each non-trivial process in a higher-
level diagram by constructing a lower-level diagram.
8
f1
f11
f12
f13
![Page 9: Functional Modeling](https://reader035.vdocuments.us/reader035/viewer/2022062520/56815cc5550346895dcac8c7/html5/thumbnails/9.jpg)
3. Describe Each Function
• Write a description of each function (using any of the specification techniques discussed earlier).
9
Function, f: Integer Integer, such that f(x) = -1 if x < 0f(x) = 0 if x == 0f(x) = 1 otherwise
![Page 10: Functional Modeling](https://reader035.vdocuments.us/reader035/viewer/2022062520/56815cc5550346895dcac8c7/html5/thumbnails/10.jpg)
4. Identify Constraints• Constraints are functional dependencies between
objects that are not related by an input-output dependency. – Between two objects at the same time– Between instances of the same object at different
times– Between different objects at different times.
• State the time the condition must hold.• E.g. “no account balance may ever become
negative.”
10
![Page 11: Functional Modeling](https://reader035.vdocuments.us/reader035/viewer/2022062520/56815cc5550346895dcac8c7/html5/thumbnails/11.jpg)
Specifying Functions
• Need a signature (syntactic or interface)• Need transformations (semantics or meaning)
11
![Page 12: Functional Modeling](https://reader035.vdocuments.us/reader035/viewer/2022062520/56815cc5550346895dcac8c7/html5/thumbnails/12.jpg)
Specifying Functions (Cont.)
• Need a signature (syntactic or interface)– Name– Arguments (number, order, types)– Values returned (number, order, types)
• Need transformations (semantics or meaning)
12
![Page 13: Functional Modeling](https://reader035.vdocuments.us/reader035/viewer/2022062520/56815cc5550346895dcac8c7/html5/thumbnails/13.jpg)
Specifying Functions (Cont.)
• Need a signature (syntactic or interface)• Need transformations (semantics or meaning)
– Equations and formulae– Tables of values– Pre and post conditions– Decision tables– Pseudo code– Natural language
13
![Page 14: Functional Modeling](https://reader035.vdocuments.us/reader035/viewer/2022062520/56815cc5550346895dcac8c7/html5/thumbnails/14.jpg)
Functions
• Trivial– Access: read or write attributes. May not
be necessary to show all of these.• Non-trivial
– Queries: no side effects– Actions: “instantaneous” (atomic)– Activities: duration over time
14
![Page 15: Functional Modeling](https://reader035.vdocuments.us/reader035/viewer/2022062520/56815cc5550346895dcac8c7/html5/thumbnails/15.jpg)
Outline
Definition and construction of functional models
• Documenting functional models---Data flow diagram (DFD)
• Structuring and organizing DFDs
15
![Page 16: Functional Modeling](https://reader035.vdocuments.us/reader035/viewer/2022062520/56815cc5550346895dcac8c7/html5/thumbnails/16.jpg)
Documenting Functional Models
• Uses diagrams– Data Flow Diagram (DFD)– UML Activity Diagram
16
![Page 17: Functional Modeling](https://reader035.vdocuments.us/reader035/viewer/2022062520/56815cc5550346895dcac8c7/html5/thumbnails/17.jpg)
17
Data Flow Diagram (DFD)• Semi-formal notation for specifying
– Functions of an information system and– How data flow from functions to functions
• Describes systems as– Collections of functions that manipulate data– Data can
• Be stored in data repository,• Flow in data flows, and• Be transferred to or from the environment.
Price List
Find CostItems Cost
CustomerCustomer
![Page 18: Functional Modeling](https://reader035.vdocuments.us/reader035/viewer/2022062520/56815cc5550346895dcac8c7/html5/thumbnails/18.jpg)
18
DFDs Are Not For Specifying
• Order of operations (functions)• Control information• Flow charts
![Page 19: Functional Modeling](https://reader035.vdocuments.us/reader035/viewer/2022062520/56815cc5550346895dcac8c7/html5/thumbnails/19.jpg)
19
DFD Notation• Four components
– Processes
– Data flows
– Data stores
– Sources/sinks
(or )
![Page 20: Functional Modeling](https://reader035.vdocuments.us/reader035/viewer/2022062520/56815cc5550346895dcac8c7/html5/thumbnails/20.jpg)
20
Processes• Transform data values• Drawn as ellipses with fixed number
of in-arrows and out-arrows
DivideInteger
dividend
divisor
quotient
remainder
![Page 21: Functional Modeling](https://reader035.vdocuments.us/reader035/viewer/2022062520/56815cc5550346895dcac8c7/html5/thumbnails/21.jpg)
21
Data Flows• Connect processes• Represent intermediate data• Values are not changed by data flow• Arrow with name or type of data
integer a
copy
addresscity
zipsplit
addresscity
zip
street
aggregation
![Page 22: Functional Modeling](https://reader035.vdocuments.us/reader035/viewer/2022062520/56815cc5550346895dcac8c7/html5/thumbnails/22.jpg)
22
Data Store• Stores persistent data for later use• Has exactly two operations:
– Store– Retrieve
• Drawn as:
data store (or )data store
![Page 23: Functional Modeling](https://reader035.vdocuments.us/reader035/viewer/2022062520/56815cc5550346895dcac8c7/html5/thumbnails/23.jpg)
23
Sources/Sinks• Producers or consumers of data• Also called terminators and actors
Customer
Producer (source) Consumer (sink)
PrinterPrinter Printer
![Page 24: Functional Modeling](https://reader035.vdocuments.us/reader035/viewer/2022062520/56815cc5550346895dcac8c7/html5/thumbnails/24.jpg)
24
DFD Example 1
Price Lists
Find CostItem Name Cost
Price List
![Page 25: Functional Modeling](https://reader035.vdocuments.us/reader035/viewer/2022062520/56815cc5550346895dcac8c7/html5/thumbnails/25.jpg)
25
DFD Example 2
Compute statistics
Calculategrades
NamesScores
Grades
Create report
NamesScores
AverageMedian
Grade Book
NamesScores
Grades
Gradereport PrinterPrinter
AverageEnter
scores
ScoresNamesScores
Teaching Assistant
![Page 26: Functional Modeling](https://reader035.vdocuments.us/reader035/viewer/2022062520/56815cc5550346895dcac8c7/html5/thumbnails/26.jpg)
26
Data Dictionary• Repositories to store information about all data
items defined in the DFD• DD may include:
– Name of data item– Aliases (other names for item)– Description and purpose– Range of values– Data flow (generated by, used by)– Data structure definition and form
Alan Davis, Software Requirements, Prentice Hall, 1993.
![Page 27: Functional Modeling](https://reader035.vdocuments.us/reader035/viewer/2022062520/56815cc5550346895dcac8c7/html5/thumbnails/27.jpg)
27
DD Example
![Page 28: Functional Modeling](https://reader035.vdocuments.us/reader035/viewer/2022062520/56815cc5550346895dcac8c7/html5/thumbnails/28.jpg)
28
In Class: Candy Machine
Pairs (5 minutes): Model the function of a candy machine described below.
– Customer inserts coins – Machine validates coins– Customer selects a candy– Machine validates candy selection– Machine validates transaction– Machine dispenses change– Machine dispenses product
![Page 29: Functional Modeling](https://reader035.vdocuments.us/reader035/viewer/2022062520/56815cc5550346895dcac8c7/html5/thumbnails/29.jpg)
Outline
Definition and construction of functional models
Documenting functional models---Data flow diagram (DFD)
• Structuring and organizing DFDs
29
![Page 30: Functional Modeling](https://reader035.vdocuments.us/reader035/viewer/2022062520/56815cc5550346895dcac8c7/html5/thumbnails/30.jpg)
Problems with This DFD?
![Page 31: Functional Modeling](https://reader035.vdocuments.us/reader035/viewer/2022062520/56815cc5550346895dcac8c7/html5/thumbnails/31.jpg)
31
Organizing DFDs• Apply levels of abstraction (leveling)• The initial DFD is:
• This can be expanded into lower levels.
• Eventually, the process must stop.– When atomic processes can be described.
programinput output
![Page 32: Functional Modeling](https://reader035.vdocuments.us/reader035/viewer/2022062520/56815cc5550346895dcac8c7/html5/thumbnails/32.jpg)
32
Context Diagram (Level 0)• Describes the system at the highest, most
abstract level.• Determines the scope of the system• Provides a general view of the system
environment identifying external interfaces.• Comprised of:
– One bubble (the name of the system)– System terminators (sources and sinks)– External inputs and outputs
![Page 33: Functional Modeling](https://reader035.vdocuments.us/reader035/viewer/2022062520/56815cc5550346895dcac8c7/html5/thumbnails/33.jpg)
33
Level 0: Payroll System
ProcessPayroll
Employeeinfo
Timecardinfo
Pay info
Acct info
PrinterPrinter
PrinterAccountant
PrinterEmployee
![Page 34: Functional Modeling](https://reader035.vdocuments.us/reader035/viewer/2022062520/56815cc5550346895dcac8c7/html5/thumbnails/34.jpg)
34
Concept of Leveling: Rules of Decomposition
1. AI2
I1O
1.1 J 1.3 L
1.2 K
I1
I2
O
Data storage
dx
dy
dydz
dx
Level n
Level n+1
![Page 35: Functional Modeling](https://reader035.vdocuments.us/reader035/viewer/2022062520/56815cc5550346895dcac8c7/html5/thumbnails/35.jpg)
35
Concept of Leveling: Rules of Decomposition (Cont.)
1. BI O
1.1 J 1.3 L
1.2 KI
Odx
dydyI1
I2
O1
O2
Level n
Level n+1
![Page 36: Functional Modeling](https://reader035.vdocuments.us/reader035/viewer/2022062520/56815cc5550346895dcac8c7/html5/thumbnails/36.jpg)
Level 1: Payroll Process
3: Calculatewithholding
4: Formatpaycheck
1: Validate timecard
2: Calculategross pay
5: Formataccounting
Employeeinfo
Acct. Info(formatted)
Acct. Info
Pay info
Gross pay
Valid timecard
info
Timecardinfo
Pay info (formatted)
Inputs and outputs to level n+1 match
level n
![Page 37: Functional Modeling](https://reader035.vdocuments.us/reader035/viewer/2022062520/56815cc5550346895dcac8c7/html5/thumbnails/37.jpg)
Level 2: Calculate Withholding
3.1: Computewithholding
rate
Emp. info
Acct. info
Pay infoGross pay
3.2: Computenet pay
Rate
37
![Page 38: Functional Modeling](https://reader035.vdocuments.us/reader035/viewer/2022062520/56815cc5550346895dcac8c7/html5/thumbnails/38.jpg)
Notes:
• Show all possible computation paths for values.
• Do not show what paths are executed in what order (that’s the job of the dynamic model).
• There may be many Level N+1 diagrams for each Level N diagram. Level N+1 expands a single node of a Level N diagram.
38
![Page 39: Functional Modeling](https://reader035.vdocuments.us/reader035/viewer/2022062520/56815cc5550346895dcac8c7/html5/thumbnails/39.jpg)
39
Guidelines for Designing DFDs
1. Describe the system at the highest, most abstract level (context diagram)
2. Decompose the system and represent it as a DFD with multiple bubbles.
2.1 Document the processes 2.2 Fill out the data dictionary
3. Decompose a process (following step 2) until the problem is understood
![Page 40: Functional Modeling](https://reader035.vdocuments.us/reader035/viewer/2022062520/56815cc5550346895dcac8c7/html5/thumbnails/40.jpg)
40
Identifying Data
• At the highest level of abstraction, these are the system inputs and outputs.
• Each lower level has inputs and outputs defined by some higher level.
![Page 41: Functional Modeling](https://reader035.vdocuments.us/reader035/viewer/2022062520/56815cc5550346895dcac8c7/html5/thumbnails/41.jpg)
41
Identifying Processes
• Start with each output and determine what function computes it.
• (Or trace forward from inputs.)• Expand each non-trivial function
(process) by constructing a lower-level diagram.
![Page 42: Functional Modeling](https://reader035.vdocuments.us/reader035/viewer/2022062520/56815cc5550346895dcac8c7/html5/thumbnails/42.jpg)
Things to Check in DFDs1. Is each requirements function represented
by a transform in the DFDs?2. Is each system input and output represented
in the DFDs?3. Is each I/O from a higher-level DFD
reproduced correctly on the lower-level DFDs?
4. Is each transform in the lowest-level DFDs primitive?
42
![Page 43: Functional Modeling](https://reader035.vdocuments.us/reader035/viewer/2022062520/56815cc5550346895dcac8c7/html5/thumbnails/43.jpg)
Things to Check in DFDs5. Are all labels of information flows in the data
dictionary?6. Do all data dictionary entries appear in the
DFDs?
43
![Page 44: Functional Modeling](https://reader035.vdocuments.us/reader035/viewer/2022062520/56815cc5550346895dcac8c7/html5/thumbnails/44.jpg)
In Class: Groups of 3
• Draw the DFD for the gas pump controller (see handout).
• Draw a Level 0, Level1, and 2 Level 2 diagrams.
• (15 minutes)
44