-->
What is Loop Testing? Methodology, Example

What is Loop Testing? Methodology, Example

 

What is Loop Testing?

Loop Testing is defined as a software testing type, that completely focuses on the validity of the loop constructs. It is one of the parts of Control Structure Testing (path testing, data validation testing, condition testing).

Loop testing is a White box testing. This technique is used to test loops in the program.

Loop Testing Tutorial - Types, Strategy, Limitation & Examples

Types of loop Tested

Examples of types of loop tested are,

  • Simple loop
  • Nested loop
  • Concatenated loop
  • Unstructured loop

Why do Loop Testing?

Loop Testing is done for the following reasons

  • Testing can fix the loop repetition issues
  • Loops testing can reveal performance/capacity bottlenecks
  • By testing loops, the uninitialized variables in the loop can be determined
  • It helps to identify loops initialization problems.

How to do Loop Testing: Complete Methodology

While testing loop, it has to be checked at three different levels:

  • When loop is entered
  • During its execution and
  • When the loop is left

The testing strategy for all these loops is as follow

Simple loop

A simple loop is tested in the following way:

Loop Testing Tutorial - Types, Strategy, Limitation & Examples

  1. Skip the entire loop
  2. Make 1 passes through the loop
  3. Make 2 passes through the loop
  4. Make a passes through the loop where a<b, n is the maximum number of passes through the loop
  5. Make b, b-1; b+1 passes through the loop where “b” is the maximum number of allowable passes through the loop.

Nested Loop

For nested loop, you need to follow the following steps.

Loop Testing Tutorial - Types, Strategy, Limitation & Examples

  1. Set all the other loops to minimum value and start at the innermost loop
  2. For the innermost loop, perform a simple loop test and hold the outer loops at their minimum iteration parameter value
  3. Perform test for the next loop and work outward.
  4. Continue until the outermost loop has been tested.

Concatenated Loops

In the concatenated loops, if two loops are independent of each other then they are tested using simple loops or else test them as nested loops.

Loop Testing Tutorial - Types, Strategy, Limitation & Examples

However if the loop counter for one loop is used as the initial value for the others, then it will not be considered as an independent loops.

Unstructured Loops

For unstructured loops, it requires restructuring of the design to reflect the use of the structured programming constructs.

Loop Testing Tutorial - Types, Strategy, Limitation & Examples

Limitation in Loop testing

  • Loop bugs show up mostly in low-level software
  • The bugs identified during loop testing are not very subtle
  • Many of the bugs might be detected by the operating system as such they will cause memory boundary violations, detectable pointer errors, etc.

Summary

  • In Software Engineering, Loop testing is a White Box Testing. This technique is used to test loops in the program.
  • Loops testing can reveal performance/capacity bottlenecks
  • Loop bugs show up mostly in low-level software

0 Response to "What is Loop Testing? Methodology, Example"

Post a Comment

Ads on article

Advertise in articles 1

advertising articles 2

Advertise under the article