Loop Software Testing

20 Jun, 2019
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:
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);
  } 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);
    }
  } 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);
 } 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()
    {}
  } 
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);
  } 
Example:
while(condition)
  {
   statement(s);
  } 
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);
    }
  } 
Example:
while(condition 1)
  {
   while(condition 2)
    {
     statement(s);
    }
  } 
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);
 } 
Example:
while(condition 1)
  {
   statement(s);
  }
 while(condition 2)
 {
  statement(s);
 } 
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()
    {}
  } 
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.
Software Testing
Software Engineering
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Unit Testing | Software Testing
Software Engineering | Black box testing
System Testing
Software Engineering | Integration Testing
Equivalence Partitioning Method
What is DFD(Data Flow Diagram)?
Software Engineering | Calculation of Function Point (FP)
Software Development Life Cycle (SDLC)
Software Processes in Software Engineering
Software Measurement and Metrics