Control Structure Testing

Basis path testing is simple and highly effective, it is not sufficient in itself. These broaden testing coverage and improve the quality of white – box testing.

Condition Testing :  Condition testing [Tai89] is a test – case design method that exercises the logical conditions contained in a program module. A simple condition is a Boolean, variable or a relational expression, possibly preceded with one NOT (–) operator. A relational expression takes the form.

Data Flow Testing : The data testing method [Fra93] selects test paths of a program according to the locations of definitions and uses of variables in the program. Assume that each statement in a program is assigned a unique statement number and that each function does not modify its parameters or global variables. 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}

Loop Testing :  Loops are the cornerstone for the vast majority of all algorithms implemented in software. Loop testing is a white – box testing technique that focuses exclusively on the validity of loop constructs. Four different classes of loops [Bei90] can be defined. Simple loops, concatenated loops, nested loops, and unstructured loops .

Simple loops :  The following set of tests can be applied to simple loops, where n is the  maximum number of allowable passes through the loop.
1. Skip the loop entirely.
2. Only one pass through the loop.
3. Two passes through the loop.
4. M passes through the loop where m < n
5. n –1, n, n + 1 passes through the loop.

control structure testing

Nested loops : If we were to extend the test approach for simple loops to nested loops, the number of possible tests would grow geometrically as the level of nesting increases. This would result in an impractical number of tests.

1. Start at the innermost loop. Set all other loops to minimum values.

2. Conduct simple loop tests for the innermost loop while holding the outer loops at their minimum iter

3. Conducting tests for the next loop, but keeping all other outer loops at minimum values and other nested loops to “typical” values.

4. Continue until all loops have been tested.

Concatenated loops :  Concatenated loops can be tested using the approach defined for simple loops, if each of the loops is independent of the other. However, if two loops are concatenated and the loop counter for loop 1 is used as the initial value for loop 2, then the loops are not independent.


Unstructured loops:  Whenever possible, this class of loops should be redesigned to reflect the use of the structured programming constructs

Related

Software engineering 7414379228298812852

Post a Comment

emo-but-icon

item