3.4.4 Loop Boundary Criteria
Course subject(s)
Module 3. Structural Testing and Code Coverage
We can think of coverage criteria for loops. After all, testing all possible iterations of a loop can be unfeasible.
A test suite satisfies the loop boundary adequacy criterion if for every loop L:
- There is a test case which iterates L zero times
- There is a test case which iterates L once
- There is a test case which iterates L more than once
In practice, this criteria is usually combined with other adequacy criteria such as MC/DC.
Further reading:
- Chapter 12 of Pezzè, M., & Young, M. (2008). Software Testing and Analysis: Process. Principles and Techniques, 4-6.
Automated Software Testing: Practical Skills for Java Developers by TU Delft OpenCourseWare is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Based on a work at https://online-learning.tudelft.nl/courses/automated-software-testing-practical-skills-for-java-developers/.