Question
Consider the following example class. PrimeNumbers has three methods. The first, computePrime(), take one integer input and computes that many prime numbers. iterator() returns an
Consider the following example class. PrimeNumbers has three methods. The first, computePrime(), take one integer input and computes that many prime numbers. iterator() returns an Iterator that will iterate through the primes, and toString() returns a string representation.
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, ...). If possible, describe five tests. You can describe the tests as sequences of calls to the above methods, or briefly describe them in words. Note that the last two tests require the test oracle to be described.
(a) 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) A test that reveals the fault
If a test cannot be created, explain why.
public class PrimeNumbers implements IterableStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started