New Data Flow Testing
New Data Flow Testing
New Data Flow Testing
Mark New
Overview
Background
Define/Use testing
Slice-based testing
Background
Structural testing
Focus on variables
2 forms:
1. Define/Use testing
2. Program slice testing
Program Graphs
1
program Example()
3
4
staffDiscount = 0.1
totalPrice = 0
5
6
7
8
9
input(price)
while(price != -1) do
totalPrice = totalPrice + price
input(price)
od
Define/Use Testing
Define/Use Testing
for some v in V
DEF
USE
DEF
USE
DEF
USE
Example
2 use nodes
USE(price, 6)
USE(price, 7)
Definitions
I-def input
A-def assignment
All-DU-Paths
All-Uses
All-C-Uses/Some-P-Uses
All-Defs
All-P-Uses/Some-C-Uses
All-P-Uses
All-Edges
All-Nodes
The Metrics
Metrics cont'd
Metrics cont'd
Subsumption of Metrics
All-Paths
All-DU-Paths
All-Uses
All-C-Uses/Some-P-Uses
All-Defs
All-P-Uses/Some-C-Uses
All-P-Uses
All-Edges
All-Nodes
Slice-Based Testing
What is a slice?
Slice: Example
S(price, 5) = {5}
S(price, 6) = {5, 6, 8, 9}
S(price, 7) = {5, 6, 8, 9}
S(price, 8) = {8}
Use of Slices
When slice for DEF for var = slice for USE for
var, then path is definition-clear.
Summary
Define/Use
Rapps/Weyuker metrics