1.- Why do testers automate tests? What are the limitation of automation?
2.- Give a one-to-two paragraph explanation for how the inheritance hierarchy can affect controllability and observability:
3.-Develop JUnit tests for the BoundedQueue.class.
public class BoundedQueueTest {
/**
* Test of enQueue method, of class BoundedQueue.
*/
@Test
public void testEnQueue() {
System.out.println("enQueue");
Object o = 1;
BoundedQueue instance = new BoundedQueue(5);
instance.enQueue(o);
assertEquals(instance.toString(), "[1]");
}
/**
* Test of deQueue method, of class BoundedQueue.
*/
@Test
public void testDeQueue() {
System.out.println("deQueue");
Object o = 1;
Object a = 2;
BoundedQueue instance = new BoundedQueue(5);
instance.enQueue(o);
instance.enQueue(a);
instance.deQueue();
assertEquals(instance.toString(), "[2]");
}
/**
* Test of isEmpty method, of class BoundedQueue.
*/
@Test
public void testIsEmpty() {
System.out.println("isEmpty");
BoundedQueue instance = new BoundedQueue(5);
assertEquals(instance.isEmpty(), true);
}
/**
* Test of isFull method, of class BoundedQueue.
*/
@Test
public void testIsFull() {
System.out.println("isFull");
Object a = 1;
BoundedQueue instance = new BoundedQueue(5);
instance.enQueue(a);
instance.enQueue(a);
instance.enQueue(a);
instance.enQueue(a);
instance.enQueue(a);
assertEquals(instance.isFull(), true);
}
/**
* Test of toString method, of class BoundedQueue.
*/
@Test
public void testToString() {
System.out.println("toString");
Object o = 1;
Object a = 2;
Object b = 4;
BoundedQueue instance = new BoundedQueue(5);
instance.enQueue(a);
instance.enQueue(b);
instance.enQueue(o);
assertEquals(instance.toString(), "[2, 4, 1]");
}
}

4.-Delete the explicit throw of NullPointerException in the Min program. Verify that the JUnit test for a list with a single null element now fails.
public class MinTest {
/**
* Test of min method, of class Min.
*/
@Test(expected = NullPointerException.class)
public void testMin() {
System.out.println("min");
List list = new ArrayList();
list.add(null);
Object result = Min.min(list);
}
}

6.- Using the class PrimeNumbers describe 5 tests using the methods of the class to show the next points:
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
c) A test that reveals a fault
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
c) A test that reveals a fault
7.- Recode the class using the Sieve Approach, but leave the fault. What is the first false positive, and how many «primes» must a test case generate before encountering it? What does this exercise show about the RIPR model?
If you want to see the exercises’ code in our repository you can visit it here: