All IT Courses 50% Off
Uncategorized

Data Flow Testing

Data Flow Testing which is may be a structural testing. It is a way, that finds the test paths of a program consistent with the locations of definitions and uses variables in the program. It has nothing to do with data flow diagrams.

It is concerned with:

  1.  Statements where variables receive values.
  2.  Statements where these values may be used or referenced.

To illustrate the approach the  data flow testing,assume the each statement within the program assigned a singular statement number. For e.g.:  statement has number S

DEF(S) = {X|statement S contains the definition of X}

USE(S) = {X|statement S contains the use of X}

All IT Courses 50% Off

The statement may be a loop or if condition then its DEF set  is empty and USE set is based on the condition of statement S.

Data Flow testing use the control flow graph which finds the situation which can interrupt the flow of program.

Reference or may define mistakes in the flow of the data where  detected at the time of associations between values and variables. The anomalies are:

  • A variable is defined and not used or referenced.
  • A variable is used but never defined.
  • A variable is defined twice before it is used.

For example consider,

Read x;
If (x>0)    (1, (2, t), x), (1, (2, f),x)

a = x+1   (1, 3, x)

if(x<=0) {  (1,(4,t),x),(1,(4,f),x)

If(x<1)     (1,(5,t),x),(1,(5,f),x)

x=x+1 ; ( go to 5) (1, 7, x)

Else   (6, (5, f) x), (6,(5,t)x)
a=x+1 (6, 6, x)
Print a;    (3, 8, a), (7, 8, a)

In the above code we have total 8 statements and we will be choosing a path which covers all 8 statements. As it is evident in the code, we cannot cover entire all statements in a single path, as the statement 2 is true then statements 4,5,6,7 not covered and if statement 4 is true then statement 2 and 3 are not covered.

Advantages of data flow testing

  1. It is used to find a variable which is used but never defined.
  2. It is used to find a variable that defined but never used.
  3. It is used to find a variable that is defined multiple times before it is used.
  4. Deallocating a variable before it is used.

Disadvantage of data flow testing

  1. It is time consuming and costly process
  2. it requires knowledge of programming languages.

Types of Data Flow testing

This process of data flow testing may be done through two approaches

  1. Static data flow testing

In static testing, study and analysis of code is done without performing the actual execution of the code like wrong header files and library files use a syntax error, during this type of testing d-u-k pattern(Definition Usage and Kill pattern). Therefore Definition Usage and Kill pattern of the data variables is monitored and observed with the help of control flow graph.

  1. Dynamic data flow testing

It has the execution of the code to monitor and observe the intermediate results.It basically looks after the coverage of data flow properties. This type of testing may comprise of following activities

  • Identification of all d-u pairs i.e. definition and usage in the code.
  • Detecting feasible path between each definition and usage pair.
  • It is designing and creating sets of test cases for each path.
Facebook Comments

10 Comments

  1. Data flow testing is a white box testing or source code based testing. Or data flow testing is also variable definition and usages. Types of data flow testing are
    1. Static data flow testing
    2.Dynamic data flow testing

  2. Data flow testing is a white-box testing technique that examines the data flow with respect to the variables used in the code. It examines the initialisation of variables and checks their values at each instance.

  3. Data Flow Testing which is may be a structural testing. It is a way, that finds the test paths of a program consistent with the locations of definitions and uses variables in the program. It has nothing to do with data flow diagrams.

    It is concerned with:

    -Statements where variables receive values.
    -Statements where these values may be used or referenced.

  4. Data Flow Testing which is may be a structural testing. It is concerned with:
    Statements where variables receive values.Statements where these values may be used or referenced.

  5. Data flow testing is a way ,that finds the test paths of a program consitent with the locations of definitions and uses variables in the program.
    it is used to find the variable that defined but never used.

  6. Data flow testing test the flow of data with respect to variables . there are two types of data flow testing
    1.Static data flow testing where the code is studied without execution.
    2.Dynamic testing where the code is executed to analysis the data flow.
    Data flow testing is time consuming.It is costly and it requires coding knowledge.

    i

  7. Data flow testing is a white box testing. It basically focuses on statements in which variables are defined and statements where variable is used. It analyses variable that are defined and not used. It designs the test cases that control flow path around variable definitions and their uses in modules.

  8. Data Flow Testing which is may be a structural testing. It is a way, that finds the test paths of a program consistent with the locations of definitions and uses variables in the program. It has nothing to do with data flow diagrams.

    It is concerned with:

    -Statements where variables receive values.
    -Statements where these values may be used or referenced.

  9. Data Flow Testing is a structural testing. It is a way that finds the test paths of a program consistent with the locations of definitions and uses variables in the program. It is concerned with statements where variables receive values and statements where these values may be used or referenced. The advantages of data flow testing are finding a variable which is used but never defined, finding a variable that defined but never used, finding a variable that is defined multiple times before it is used, and deallocating a variable before it is used.

  10. Data Flow Testing which may be a structural testing. It is a way that finds the test paths of a program consistent with the locations of definitions and uses variables in the program. It has nothing to do with data flow diagrams. Types of data flow testing –
    static data flow testing
    dynamic data flow testing

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Related Articles

Back to top button