Slide3 Testing Strategies - White Box (1)
Slide3 Testing Strategies - White Box (1)
The full list of paths (there are 24 paths required for full path coverage)
Path Coverage Criteria
X, c-use X, p-use
Data-Flow Based White Box Testing
Techniques
• Date-flow based test adequacy criteria can be defined based on coverage goals in
terms of variable uses:
• All def
• All p-uses
• All c-uses/some p-uses
• All p-uses/some c-uses
• All uses
• All def-use paths
• The strongest criterion is all def-use paths.
• We refer to a path from a variable definition to a use as a def-use path.
Data-Flow Based White Box Testing
Techniques
• To satisfy all def-use criterion, the tester must identify and classify occurrences
of all the variables in the SUT. A tabular summary is useful.
• Then for each variable, test data is generated so that all definitions and all uses
for all of the variables are exercised during test.
Data-Flow Based White Box Testing
Techniques
Example
• The following set of test inputs cover all the def-use pairs for the variables:
Data-Flow Based White Box Testing
Techniques
• As with most white box testing methods, the data flow approach is most effective
at the unit level of testing.
• Data-flow analysis can become time consuming when code becomes more
complex and there are more variables to consider.
• Tool support for data-flow based testing is currently limited.