Question: computePrimes() has a fault that causes it not to include prime numbers whose last digit is 9. For example, it omits 19, 29, 59, 79,

computePrimes() has a fault that causes it not to include prime numbers whose last digit is 9. For example, it omits 19, 29, 59, 79, 89, 109, ...
Answer the following questions a through f, if the test could be created describe what the test case would be or explain why it cannot be created:
- A test that does not reach the fault
b. A test that reaches the fault, but does not infect
c. A test that infects the state, but does not propagate
d. A test that propagates, but does not reveal
e. Write a Junit test that reveals the fault for the following input.
computePrimes(8);
Expected = [2, 3, 5, 7, 11, 13, 17, 19]
Result = [2, 3, 5, 7, 11, 13, 17, 23]
f. After repairing the fault, write a data-driven Junit test for the toString method with at least 3 different values. In particular, this data-driven test method should test toString method using @ParameterizedTest based on the results of computePrimes method for n = 7, 8 and 9.
public class PrimeNumbers implements Iterable
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
