TL;DR
There is a famous vi editor joke that the developer is using vi because it does not know how to exit vi. This is an infinite loop, the most usual bug with loop control. The post is aligned with the Black Box Software Testing Foundations course (BBST) designed by Rebecca Fiedler, Cem Kaner, and James Bach.
Here is a simple loop example:
SET A = 100 WHILE A > 5 { PRINT A A = A - 1 }
The loop starts with the WHILE statement and logical expression. When a logical expression is FALSE, this is the loop exit criterion.
Common Bugs
- Infinite Loop. You probably had a situation when the only way to exit the application was CTRL – C. Your application was in the infinitive loop, logical expression was never calculated to FALSE.
- Out of memory. Loop has too many steps, so all available program memory is consumed.
- Too many or too few steps. Results in the wrong final result.
- Large application artifacts. For example, a lot of emails were sent out or a terabyte file is generated. All because the number of loop steps is too large.
- Slow execution. The loop repeats a slow block of code.