Closed seah-minlong closed 2 days ago
For your example, I think there is only one path because the for loop will iterate 10 times regardless.
Yes, I think you are right.
As per this example, I believe we need Integer.MAX_VALUE + 1 test cases:
@seah-minlong
Just to clarify, when it is said that a loop can increase path coverage greatly, it is not really due to the loop itself but the fact that
names
can be of variable length right?
Yes, specifically, a loop with a loop count that is not pre-determined.
For instance, a fixed loop would only have 1 path. Is that correct?
Yes, correct.
@DennieDan The image is missing in your comment.
For your example, I think there is only one path because the for loop will iterate 10 times regardless.
@gohsl99 Correct.
Okay thank you prof!
@damithc I updated my image, it is actually the example given by @seah-minlong
Just to clarify, when it is said that a loop can increase path coverage greatly, it is not really due to the loop itself but the fact that
names
can be of variable length right?For instance, a fixed loop would only have 1 path. Is that correct?