Data flow coverage Flashcards
What is the purpose of data flow models in program analysis?
To emphasize variable dependencies, answering where values come from and how they are used.
What is a Def-Use (DU) pair?
A pair linking a variable’s definition (where it gets a value) to its use (where the value is accessed).
What is a definition-clear path?
A path in the CFG where a variable’s value is not overwritten or ‘killed’ before its use.
What does it mean to ‘kill’ a Def-Use pair?
Creating a new definition of a variable before its next use, effectively overwriting its previous value.
What is a direct data dependence graph?
A graph where nodes represent CFG nodes, and edges represent DU pairs labeled with variable names.
What is control dependence?
It refers to which statement controls whether another statement executes based on a decision point in the CFG.
How is a node N determined to be control-dependent on node C?
If node C is a control flow decision point, and the execution of N depends on the outcome of that decision.
What are the three levels of data flow coverage adequacy criteria?
- All DU Pairs: Every DU pair is exercised by at least one test case.
- All DU Paths: Every definition-clear path is exercised by at least one test case.
- All Definitions: Every variable definition is part of a DU pair that is exercised.
What is the intuition behind data flow testing?
To test ‘important’ paths where values computed in one statement are used in another, ensuring faults in value computation are detected when used.
What are examples of practical challenges in data flow testing?
- Aliases: Multiple references to the same memory location.
- Infeasibility: DU pairs or paths that cannot be covered due to program logic.
Why is the infeasibility problem significant in data flow analysis?
The path-oriented nature of data flow makes determining infeasible paths complex, and no test case can cover them.
What is the focus of data flow testing compared to statement or path-based testing?
It focuses on interactions between statements via variable definitions and uses, identifying key paths where faults may occur.
What is the difference between ‘All DU Pairs’ and ‘All DU Paths’?
- All DU Pairs: Tests every Def-Use pair at least once.
- All DU Paths: Tests every definition-clear path for each DU pair.
What is a definition-clear path from a definition to a use?
A path where the value of the variable is not overwritten or ‘killed’ before reaching its use.
How do loops affect Def-Use paths?
Loops can create infinite Def-Use paths, making ‘All DU Paths’ impractical in some cases.