Lecture 2-Data Flow Flashcards
What is path coverage?
-It’s the key to determine “critical paths”
What is data flow analysis?
-Focuses on the assignment of values to variables and their uses where data is defined and used.
What are the 2 occurrences of variables analyzed in data flow analysis?
1.Definition occurrence: value is bound to variable
2.Use occurrence: value of variable is referred
Differentiate variable definition, use, kill
Variable definition:
d(v,n)–> value is assigned to v at node n
Variable use :
-c-use(v,n)–> v used in a computation at node n
-p-use (v,m,n) –> v used in predicate from node m to n
Variable kill:
k(v,n)–> v deallocated at node n
What are the two types of use occurrence?
-Computational use(c-use): compute a value for defining other variables or output value
-Predicate use(p-use): variable used to decide whether predicate is true.
When do we use c-use?
Classified as c-use if part of :
-Assignment statement
-Output statement
-Parameter within a function call
-Subscript expressions
*C stands for computational
When do we use p-use?
Classified as p-use if part of :
-condition in a branch statement (like if, while…)
*p stands for predicate
What does a data flow graph(DFG) do?
It captures the flow of definitions and uses across basic blocks in a program.
DFG vs CFG
Adequacy criteria based on DFG more powerful than based on CFG
What are the three different types of paths in a DFG?
Complete path : Initial node is start node, final node is exit node.
Simple path: all nodes except possibly first and last are distinct.
Loop free path: all nodes are distinct.
What can we base ourselves to reduce the number of def-uses to be covered?
The coverage of one def-use might imply the coverage of another.
What are 3 define/reference anomalies?
-A variable that is defined but never used (referenced)
-A variable that is used before it is defined
-A variable that is defined twice before it is used