Software Testing – Data Flow Testing

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
• (D)efined,
• (U)sed in a predicate,
• (U)sed in a calculation, and
• (K)illed.

E.g.
• 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:
Statement 1:
Statement 2:

# 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

where
D – Define / U – Use / K – Kill

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s