Professional Documents
Culture Documents
STM Unit3 DFG
STM Unit3 DFG
Contents
• Synopsis
• Basics
• Intro to Data flow, data flow graphs
• Motivation & Assumption
• Data flow model
Anomaly
Definition:
Example:
Pick enough paths to assure that every data item has been
initialized prior to its use, or that all objects have been used for
something.
Motivation
• Abstract M I M D
• Language & compiler take care of parallel
computations
Given m, n, p, q, find e.
e = (m+n+p+q) * (m+n-p-q)
a = n+m
a := m + n
b := p + q b=p+q
c := a + b
d := a - b c=a+b
e := c * d
d=a-b
e=c*d
END PAR
END
The interrelations among the data items remain same.
8 ref boris beizer
Data - Flow Testing - Basics - Motivation U2
Assumptions
Convert to a CFG
Used - (u)
A
dk : probably a bug. X=1, X=Y+1
Action
du : normal
kd : normal
ku : a bug
ud : normal. Redefinition.
uk : normal
-d normal X=1
-u anomaly start-------------Y=X+1
-k anomaly start-------------
d- possibly anomalous
15 ref boris beizer
Data - Flow Testing - Basics U2
• K, D, U, A
• Processing Step
• k, d, u
• Object state
• Unforgiving Data flow state graph
Undefined
K
k, u
d
u
d, k
U D A Anomalous
u
d
Defined d, k, u
Used
d DK
k
d
u k
U D d
u
d
DD
u
d
• Dynamic analysis
Intermediate data values
Procedure to Build:
2. Predicated nodes
3. Sequence of links
1. Join
2. Concatenate weights
3. The converse
Example: an – 1
Z = b + ---------
START a - 1
INPUT a, b, n
Z := 0
IF a = 1 THEN Z := 1
GOTO DONE1
r := 1 c := 1
POWER:
c := c * a
r := r + 1
IF r <= n THEN GO TO POWER
Z := (c – 1) / (a – 1)
DONE1:
Z := b + Z
END
Read a,b,n
Z := 0 Z := 1 Z := b + Z
1 2 5 6
a = 1?
P1
Y
Z := (c-1)/(a-1)
P2
3 4 r<n?
r := 1 c:=1 r := r+1, c:= c*a
Y
d or kd cd or ckd
d
1 2 5 6
a = 1?
P1
Y
d or kd
P2
3 4 r<n?
1 2 5 6
a = 1?
P1
Y
-d c-
ckd or kd P2
3 4 r<n?
1 2 5 6
a = 1?
P1
Y
-d p-
ckd or kd P2
3 4 r<n?
d c
1 2 5 6
a = 1?
P1
Y
P2
3 4 r<n?
d
1 2 5 6
a = 1?
P1
Y
p-
P2
3 4 r<n?
d
1 2 5 6
a = 1?
P1
p
c-
c P2
3 4 r<n?
DEFINITIONS
DFT Strategies
Purpose:
• 1-3-5
• APU + c
• Stronger than P2
• ACU + p
• Weaker than P2
• ACU :
All Paths
All du Paths
All Defs AD
All c uses (ACU) All P-uses APU
All Branches P2
All Stmts P1
Slicing:
Stmt1 var v
stmt2
Stmt3 var v
Stmt4 var v
Stmt s var v
Dicing:
Debugging:
• Select a slice.
• Narrow it to a dice.
Dynamic Slicing:
Application of DFT
Application of DFT
Application of DFT
ADUP ~ ½ APU*
AP ~ AC
47 ref boris beizer
Data - Flow Testing - – Data Flow Testing Strategies U2
Application of DFT
DFT vs P1, P2
• DFT is Effective
DFT - TOOLS
• Cost-effective development
• Commercial tools :
• Efficient Testing
1. How is data flow testing (DFT) helpful in fulfilling gaps in path testing?