CS FundamentalsVery hardService-company placement · ISTQB-style

Following Beizer's guidance for testing two nested loops, how should you start?

  1. A. Test the outer loop first at every boundary, holding the inner loop at its maximum
  2. B. Test every combination of iteration counts of both loops together
  3. C. Run both loops only at their maximum counts, since that finds most defects
  4. D. Innermost loop first, outer at minimum; then move outward, inner loops typical

Correct answer: D. Innermost loop first, outer at minimum; then move outward, inner loops typical

Testing all combinations explodes, so begin at the innermost loop (min, min+1, typical, max−1, max, and so on) with outer loops at minimum, then work outwards with already-tested inner loops held at typical values.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic