unit-testing Unit testing of Loops (Java) Concatenated loops Test


Two loops are concatenated if it’s possible to reach one after exiting the other on same path from entrance to exit. Sometimes these two loops are independent to each other. In those cases we can apply the design techniques specified as part of single loop testing.

But if the iteration values in one loop are directly or indirectly related to the iteration values of another loop and they can occur on the same path, then we can consider them as nested loops.