Definition use association is one of the terms that appear at
the scene of data flow testing and quite many of us are unaware of it. This
article is all about the concepts of the definition use associations and what
role does they have got to play in the data flow testing.
The definition use
association forms quite an important part of the data flow testing. Let us see
how!
First we are going to discuss some concepts of the data flow testing in
regard with the definition use associations and then we will discuss the role
of the definition use associations in the data flow testing.
About Data Flow Testing
- A control flow
graph is an important tool that is used by the data flow testing so that the
anomalies related to the data can be explored.
- A proper path selection strategy is what that is required for
detection of such anomalies.
- The path strategy which is to be used can be decided on the basis of the data
flow anomalies discovered earlier.
- Data flow testing is nothing but a family of
path testing strategies through the control of a software program or
application.
- The path testing is required so that the sequence of possible
events associated with the objects’ status can be explored.
- It is necessary that you keep the number of
paths sufficient and sensible so that no object is left without initialization
and without being used at least once in its life time without carrying out
unnecessary testing.
- Data flow testing is comprised of two types of anomaly detection namely:
1. Static analysis: It is carried out on the program code without its actual execution. It involves finding syntax errors.
2. Dynamic analysis: It is carried out on a program while it is in a state of execution. It involves finding the logical errors.
- The
data objects have been categorized in to several categories so as to make data
flow testing much easy:
- Defined,
created, initialized (d)
- Killed,
undefined, released (k)
- Used (u): in calculations (c)
- In predicates (p)
Anomalies discovered by the static analysis
are meant to be handled by the compiler itself. But the static analysis and the
dynamic analysis do not suffice altogether. A rigorous path testing is
required.
About Definition Use Associations
- The definition use associations or the “du segments” are the path
segments whose last links have a use of variable X and are simple and
definition clear.
- Typically a definition
use association is a combination of triple elements (x, d, u) where:
- X is
the variable
- D is
the node consisting of a definition of variable x
- U is
either a predicate node or a statement depending up on the case and
consists of a use of x.
- A sub path from d to u is also
included in the flow graph with no definition of variable x occurring in
between the d and u.
- Below mentioned are some examples of the def use associations:
- (x, 3,
4)
- (x, 1,
4)
- (y, 2,
(4, t))
- (z, 2,
(3, t)) etc.
- Some of the most common data flow
testing strategies are:
- All
uses (AU)
- All DU
paths (ADUP) and many more.
- First advice for effective data flow
testing would be to resolve all the data flow anomalies discovered above.
- Carrying out data flow operations on the same variable and within the same
routines can also reap you good results.
- It is advisable to use defined types
and strong typing wherever it is possible in the program.
No comments:
Post a Comment