Kinds of loops
Nested Loops:
The number of tests to be performed on nested loops will be the exponent of the test performed on single loopsAs we cannot always afford to test all combinations of nested loop iteration values here is a tactic used to discard some of these values:
Start the inner most loop. Set all the outer loops to their minimum values
Test the minimum, minimum + 1, typical. maximum - 1, and maximum for the innermost loop, while holding the outer loops at their minimum iteration parameter values. Expand the tests as required for out of range and excluded values
As we cannot always afford to test all combinations of nested loops iteration values, here is a tactic used to discard some of these values:
If you have done the outmost loop, GOTO step 5, else move out one loop and set it up as in step 2 with all other loops set to typical values
Continue outward in this manner until all loops have been covered
Do all the cases for all loops in the nest simultaneously
Concatenated Loops:
Concatenated loops fall between single and nested loops with respect to test casesTwo lops are concatenated if it is possible to reach one after exiting the other, while still on a path from entrance to exit
If the loops cannot be on the same path, then they are not concatenated and can be treated as individual loops
Horrible Loops:
A horrible loop is a combination of nested loops, the use of code that jumps into and out of loops, intersecting loops, hidden loops, and cross connected loopsMakes iteration values selection for test cases. This is an irritating task, which is another reason such structures should be avoided
0 comments:
Post a Comment