Subscribe by Email


Monday, November 23, 2009

Control Structure 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. For a statement with S as its statement number,

DEF(S) = {X| statement S contains a definition of X}
USE(S) = {X| statement S contains a use of X}

If statement S is an if or loop statement, its DEF set is left empty and its USE set is founded on the condition of statement S. The definition of a variable X at statement S is live at statement S’ if there exists a path from statement S to S’ which does not contain any condition of X.

A definition-use chain (or DU chain) of variable X is of the type [X,S,S’] where S and S’ are statement numbers, X is in DEF(S), USE(S’), and the definition of X in statement S is live at statement S’.

One basic data flow testing strategy is that each DU chain be covered at least once. Data flow testing strategies are helpful for choosing test paths of a program including nested if and loop statements.


No comments:

Facebook activity