- The while loop
- The for loop
- The do – while loop
- Structured loops and
- Unstructured loops
Articles, comments, queries about the processes of Software Product Development, Software Testing Tutorial, Software Processes .
Posted by
Sunflower
at
5/18/2012 11:55:00 PM
0
comments
Labels: Analyze, Application, Bugs, Code, Control flow Graph, Defects, Developers, Edges, Entry, Errors, Iteration, Loop testing, Loops, Nodes, program, Programmers, Statements, Structure, Types, Unstructured loops
![]() | Subscribe by Email |
|
Loop testing is also one of the white box testing techniques and thus requires a very deep knowledge about the software system or application. Loop testing methodology has been designed exclusively for the checking of the validation of the iterative constructs which are nothing but the loops.
Types of Loop Constructs
These loop constructs are 4 types as mentioned below:
1. Unstructured loops
2. Simple loops
3. Nested loops and
4. Concatenated loops
Tests applied to different Loop Constructs
Now we shall define some of the tests that can be applied to the above mentioned types of loop constructs under the context of the loop testing:
1. For unstructured loops only one thing is possible which is that they should be redesigned in order to form a structured construct and then can be tested accordingly.
2. For simple loops a number of allowable passes through them is specified first and then the following tests are applied:
(a) Skipping of the entire loop.
(b) Making only one pass through the loop.
(c) Making two passes through the loop.
(d) Making “p” passes through the loop where p is the maximum number of passes.
(e) Making “n-1”, “n”, “n+1” passes through the loop.
3. For nested loops simply the testing approach of the simple loops is extended but, the number of the test cases increases geometrically as per the number of the nested loops and the level of nesting. Usually the following steps are followed:
(a) The inner most loop is the starting point for the testing.
(b) All other loops are set to minimum possible values.
(c) Simple loop tests are conducted for the inner most loop and the outer loops or the nesting loops are kept in their minimum values only till the testing of the inner most loop is complete.
(d) For the excluded values more tests are added.
(e) Now once the testing of the inner most loop is complete, this loop including all the other nested loops are set to typical values and the testing moves outwards. The other nesting loops are held with their minimum values.
(f) The testing in this manner continues until and unless all the loops have been tested.
4. For concatenated loops also the approach that has been defined for the testing of the simple loops can be used but only if the either loops are independent of each other i.e., if the loop counter for one of concatenated loop is 1 and it is used as the executing value for the other loop, then the two loops are said to be dependent on each other and hence the simple loop approach cannot be followed for them.
More about Loop Testing
- It has been observed so many times that most of the semantic bugs preside over the loops.
- It becomes difficult for the path testing also to commence since there are so many paths generated via a loop and an infected loop leads to infected paths which makes even further difficult to track the bug.
- Some of testers believe that it is just enough to test the loop only two times but this is not a good practice.
- A loop should be tested at the following three instances:
a) At the entry of the loop
b) During the execution of the loop and
c) At the exit of the loop
- Loop testing is aimed at testing a resource multiple numbers of times by executing it under a loop and this whole process is controlled by a diagnostic controller.
- However, one rule has been defined for the loop testing which is that the user can interact only at the entry and exit of the loop and nowhere in between.
Posted by
Sunflower
at
3/22/2012 11:26:00 AM
0
comments
Labels: Approaches, Concatenated Loops, Constructs, Loop testing, Loops, Nested loops, Passes, Simple Loops, Software testing, Structures, Techniques, Test cases, Tests, Unstructured loops, White box testing
![]() | Subscribe by Email |
|
Loop testing is a kind of white box testing technique that focuses exclusively on the validity of loop constructs. Four classes of loops can be defined: Simple loops, Concatenated loops, Nested loops, and unstructured loops.
- Simple Loops: The following sets of tests can be applied to simple loops, where 'n' is the maximum number of allowable passes through the loop.
a) Skip the loop entirely.
b) Only one pass through the loop.
c) Two passes through the loop.
d) 'm' passes through the loop where m < n.
e) n-1,n,n+1 passes through the loop.
- Nested Loops: If we extend the test approach from simple loops to nested loops, the number of possible tests would grow geometrically as the level of nesting increases.
a) Start at the innermost loop. Set all other loops to minimum values.
b) Conduct simple loop tests for the innermost loop while holding the outer loops at their minimum iteration parameter values. Add other tests for out-of-range or exclude values.
c) Work outward, conducting tests for the next loop, but keep all other outer loops at minimum values and other nested loops to typical values.
d) Continue until all loops have been tested.
- Concatenated Loops: These loops can be tested using the approach defined for simple loops,If each of these loops is independent of the other. However, if two loops are concatenated and the loop counter for loop one is used as the initial value for loop two, 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.
Posted by
Sunflower
at
10/09/2010 03:17:00 PM
0
comments
Labels: Concatenated Loops, Loop testing, Loops, Nested loops, Quality, Simple Loops, Software testing, Techniques, Unstructured loops, White box testing
![]() | Subscribe by Email |
|