Data flow coverage Flashcards

1
Q

What is the purpose of data flow models in program analysis?

A

To emphasize variable dependencies, answering where values come from and how they are used.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a Def-Use (DU) pair?

A

A pair linking a variable’s definition (where it gets a value) to its use (where the value is accessed).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a definition-clear path?

A

A path in the CFG where a variable’s value is not overwritten or ‘killed’ before its use.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does it mean to ‘kill’ a Def-Use pair?

A

Creating a new definition of a variable before its next use, effectively overwriting its previous value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a direct data dependence graph?

A

A graph where nodes represent CFG nodes, and edges represent DU pairs labeled with variable names.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is control dependence?

A

It refers to which statement controls whether another statement executes based on a decision point in the CFG.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How is a node N determined to be control-dependent on node C?

A

If node C is a control flow decision point, and the execution of N depends on the outcome of that decision.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the three levels of data flow coverage adequacy criteria?

A
  1. All DU Pairs: Every DU pair is exercised by at least one test case.
  2. All DU Paths: Every definition-clear path is exercised by at least one test case.
  3. All Definitions: Every variable definition is part of a DU pair that is exercised.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the intuition behind data flow testing?

A

To test ‘important’ paths where values computed in one statement are used in another, ensuring faults in value computation are detected when used.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are examples of practical challenges in data flow testing?

A
  1. Aliases: Multiple references to the same memory location.
  2. Infeasibility: DU pairs or paths that cannot be covered due to program logic.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Why is the infeasibility problem significant in data flow analysis?

A

The path-oriented nature of data flow makes determining infeasible paths complex, and no test case can cover them.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the focus of data flow testing compared to statement or path-based testing?

A

It focuses on interactions between statements via variable definitions and uses, identifying key paths where faults may occur.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the difference between ‘All DU Pairs’ and ‘All DU Paths’?

A
  1. All DU Pairs: Tests every Def-Use pair at least once.
  2. All DU Paths: Tests every definition-clear path for each DU pair.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is a definition-clear path from a definition to a use?

A

A path where the value of the variable is not overwritten or ‘killed’ before reaching its use.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How do loops affect Def-Use paths?

A

Loops can create infinite Def-Use paths, making ‘All DU Paths’ impractical in some cases.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly