Professional Documents
Culture Documents
• Process
• Decision
• Junction
Process
PROCESS BLOCK
YES
NO
IF A= B
DECISION BLOCK
1 2
JUNCTIONS
CASE - OF -
• Path
• Multi Entry/Exit Routines
• Path Selection Criteria
• Path Testing Criteria
PATH
a b c d
BEGIN 1 e
3 4 5 6 END
YES YES
NO NO
i h f
l j
k
10 9 8 7
YES
YES NO
NO
m
PATH TABLE
abcde Y4 Y6 abcde
abhkde N4 Y6 N9 abhkde
abhlibcde N4 Y4 Y9 abhlibcde
abcdfjdge N4 Y4 Y6 Y7 abcdfjdge
abcdfmibcde Y4 N6 Y6 Y7 abcdfmibcde
CHECK LIST
• Single Loops
• Nested Loops
• Concatenated Loops
SINGLE LOOPS
• Try bypassing the loop( zero iterations); If you can’t , then either
there is a bug or zero is not minimum or we have a wrong case.
• Check whether loop control variable is negative
• One pass through the loop
• Two passes through the loop
• Typical number of iterations unless covered by the previous test
• One less than max. no. of iterations
• Max. no. of iterations
• Attempt one more than max. no. of iterations. What prevents loop
control variable from having this value.
HUANG’S THEOREM
• Try one less than expected minimum, What happens if the loop
control variable is less than the minimum? What prevents the value
from being less than the minimum.
• Minimum number of iterations.
• One more than minimum number of iterations.
• Once, unless covered by the previous test
• Twice, unless covered by the previous test
• A typical value
• One less than typical value
• Maximum number of iterations
• Attempt more than maximum number of iterations
SINGLE LOOPS WITH EXCLUDED VALUES
• Start at the innermost loop and set all outermost loop to their
minimum values.
• Test the min. min.+1, typical, max-1, and max. for innermost loop,
while holding outer loops at their minimum values. Expand the tests
as required for out of range and excluded values.
• If you are done with outermost loop, GOTO step 5,Else move out of
one loop and set it up as in step 2 with all other loops set to typical
values.
• Perform five cases for all the loop in the nest simultaneously.
• This process works out to 12 tests for pair of nested loops, 16 tests
for 3 nested loops and 19 for 4 nested loops. Estimate the
processing time for the loop and multiply by the product of loop
iteration variables to estimate the time spent in the loop.
CONCATENATED LOOPS
• These kind of loops fall between single and nested loops w.r.t. test
cases. Two loops are concatenated if its possible to reach one after
exiting the other while still on a path from entry to exit.
• If loops are not on the same path , they can’t be concatenated and
can be treated as individual loops. Even if the loops are on the same
path and we are sure that they are independent of each other , they
can still be treated as individual loops, but if the iteration values in
one loop are directly or indirectly related to iteration values of
another loop and they can occur on same path, then they should be
treated as Nested Loops.
• The problem of excessive processing time for combinations of loop
iteration values should not occur because loop iteration values are
additive rather than multiplicative as in nested loops
LOOP TESTING TIME