|
Notes > Software Analysis / Testing > Data Flow Testing
|
Data Flow Testing is a technique which is used effectively alongside Control Flow Testing. It is another type of white-box testing which looks at how data moves within a program. Data flow occurs when variables are declared and then accessed and changed as the program progresses.
A "definition-clear path" is a path which involves no changes of the variable being tested. There are different kinds of uses of variables in code. For example, variables can be used as input, output or as predicates. These uses do not re-define the variable whereas an assignment statement such as "y = y + 2" or "x = 10" change the definition / value of the variable. Assignment statements cannot therefore exist in the middle of a valid definition-clear path.
If variables exist without having a valid "definition-use" pair relationship, this is a fault in the code which needs to be addressed. This basically means that if variables are defined / declared, they must be used somewhere later in the code. Also, a variable cannot be used without being defined.
Data Flow Test Criteria
All Definitions Criterion
The all-definition criterion is a very weak criterion. It simply specifies that all definitions of a variable reach a use of that variable.
All P-Uses Criterion
"P-Use" is short for Predicate-Use. In a CFG, a p-use of a variable occurs between two nodes when that variable is used in a conditional statement. The All P-Uses Criterion requires that all definition / predicate-use combinations for a variable be tested using a definition-clear path for that variable being tested.
All Uses Criterion
The All Uses Criterion adds to the All P-Uses Criterion by including C-Uses as well as P-Uses. "C-Use" is short for Computation-Use. A c-use of a variable is where that variable is referenced by an assignment or output statement for example. The All Uses Criterion requires all definition / use pairs to be tested.
Search for "Data Flow Testing" on:
Google |
Kelkoo |
Amazon |
eBay (UK) |
eBay (US)
Search for "Data Flow Testing" on the rest of Computing Students: Data Flow Testing
|
|
|