SECTION 24 / 48

Branch Coverage: is_prime()

1 min read

The test suite {0, 2, 3, 4} guarantees branch coverage for the lecture’s isPrime code.

0 takes the True guard branch; 2 does not enter the loop; 3 is prime and its remainder test is never zero; 4 takes the num % i == 0 branch.

Branch Coverage: is_prime()
Branch Coverage: is_prime()
Open image ↗
Branch Coverage: is_prime()
YOUR STUDY PROGRESS

Finished this section? Save your progress.

Back to top ↑