Question: Use the method printPrimes() for questions af below. A compliable version is available on the book website in the file PrintPrimes.java (a) Draw the control

Use the method printPrimes() for questions af below. A compliable version is available on the book website in the file PrintPrimes.java
(a) Draw the control flow graph for the printPrimes() method.
(b) Consider test cases t1 = (n = 3) and t2 = (n = 5). Although these tour the same prime paths in printPrimes(), they do not necessarily find the same faults. Design a simple fault that t2 would be more likely to discover than t1 would.
(c) For printPrimes(), find a test case such that the corresponding test path visits the edge that connects the beginning of the while statement to the for statement without going through the body of the while loop.
(d) List the test requirements for Node Coverage, Edge Coverage, and Prime Path Coverage.
(e) List test paths that achieve Node Coverage but not Edge Coverage on the graph.
(f) List test paths that achieve Edge Coverage but not Prime Path Coverage on the graph.
5 private static void printPrimes (int n) 6 7 int curPrime; int numPrimes boolean isPrime; // Value currently considered for primeness // Number of primes found so far. // Is curPrime prime? 10 int [l primesnew int [1ee1: I/ The list of prime numbers // Initialize 2 into the list of primes primes [e]=2; numPrime s = 1; curPrime = 2; while (numPrimes
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
