Loop Software Testing

Loop Testing is a type of software testing type that is performed to validate the loops. It is one of the type of Control Structure Testing. Loop testing is a white box testing technique and is used to test loops in the program.

Objectives of Loop Testing:
The objective of Loop Testing is:

  • To fix the infinite loop repetition problem.
  • To know the performance.
  • To identify the loop initialization problems.
  • To determine the uninitialized variables.

Types of Loop Testing:
Loop testing is classified on the basis of the types of the loops:



  1. Simple Loop Testing:
    Testing performed in a simple loop is known as Simple loop testing. Simple loop is basically a normal “for”, “while” or “do-while” in which a condition is given and loop runs and terminates according to true and false occurrence of the condition respectively. This type of testing is performed basically to test the condition of the loop whether the condition is sufficient to terminate loop after some point of time.

    Example:

    while(condition)
      {
       statement(s);
      } 





  2. Nested Loop Testing:
    Testing performed in a nested loop in known as Nested loop testing. Nested loop is basically one loop inside the another loop. In nested loop there can be finite number of loops inside a loop and there a nest is made. It may be either of any of three loops i.e., for, while or do-while.

    Example:

    while(condition 1)
      {
       while(condition 2)
        {
         statement(s);
        }
      } 





  3. Concatenated Loop Testing:
    Testing performed in a concatenated loop is known as Concatenated loop testing. It is performed on the concatenated loops. Concatenated loops are loops after the loop. It is a series of loops. Difference between nested and concatenated is that in nested loop is inside the loop but here loop is after the loop.

    Example:

    while(condition 1)
      {
       statement(s);
      }
     while(condition 2)
     {
      statement(s);
     } 





  4. Unstructured Loop Testing:
    Testing performed in an unstructured loop is known as Unstructured loop testing. Unstructured loop is the combination of nested and concatenated loops. It is basically a group of loops that are in no order.

    Example:

    while()
      {
       for()
        {}
       while()
        {}
      } 





Advantages of Loop Testing:
The advantages of Loop testing are:

  • Loop testing limits the number of iterations of loop.
  • Loop testing ensures that program doesn’t go into infinite loop process.
  • Loop testing endures initialization of every used variable inside the loop.
  • Loop testing helps in identification of different problems inside the loop.
  • Loop testing helps in determination of capacity.

Disadvantages of Loop Testing:
The disadvantages of Loop testing are:

  • Loop testing is mostly effective in bug detection in low-level software.
  • Loop testing is not useful in bug detection.


My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.