Data Flow Testing
• Data Flow testing targets the lifecycle of a particular piece of data (i.e. a variable) in an application.
• The technique to implement an effective Data Flow testing is to look for patterns of data usage based on which risky areas of the code can be found and more test
cases can be applied.
Let’s see some basics as regards DATA.
# DATA is used in 4 ways
• (U)sed in a predicate,
• (U)sed in a calculation, and
• Usage of a piece of data in a calculation after
it has been killed, show an anomaly in the
code; Therefore a bug.
# Most Failures involve
• Execution of an incorrect definition
• Incorrect assignment or input statement
• Predicate is faulty
• Definition is missing
• Explore the sequences of events related to the data state and the unreasonable things that can happen to data.
• Explore the effect of using the value produced by each and every computation.
• Considerable effort needs to be given to data declaration statements, since most of
the code contains nearly half of the contents as data declaration.
Some examples are given below
• Sum = expression
• Read (var1, var2, var3)
• Write (total1, total2, total3)
• Method call : CompareValue(val1, val2)
• While : while Boolean do statements
• For statement : for (val1 = init to final)
• If then else : If Boolean then S1;
if Boolean then S1 else S2.
• case : Case var1:
# Use the techniques given below for an effective data flow test.
• DD -bug
• DK -bug
• DU – normal
• KD – normal
• KK – harmless, but a bug
• KU – bug
• UD – normal
• UK – normal
• UU -normal
D – Define / U – Use / K – Kill