Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In JUnit , generate test case specifications for Bounded Queue class, whose signature is provided below, using the input space partitioning method. Signature: public BoundedQueue
In JUnit, generate test case specifications for Bounded Queue class, whose signature is provided below, using the input space partitioning method.
Signature:
public BoundedQueue (int capacity); // The maximum number of elements
public void enQueue (Object X);
public Object deQueue ();
public boolean isEmpty ();
public boolean isFull ();
Here is the test case partitioning
base class is here
package edu.kennesaw.seclass.BoundedQueue; public class BoundedQueue { // Overview: a BoundedQueue is a mutable, bounded FIFO data structure // of fixed size , with size being set in the constructor // A typical Queue is [], [o1], or [o1, o2], where neither o1 nor o2 // are ever null. Older elements are listed before newer ones. private final Object[] elements; private int size, front, back; private final int capacity; public BoundedQueue (int capacity) { if (capacity For this problem, we will assume we are testing "Enqueue ()" as it makes the input parameter "X relevant. Note that "capacity" in the constructor isn't relevant to this test sets, though the constructor will be certainly called in the setup for the tests. . This means we will skip blocks el, e2, e3 and e4 while defining the base tests for "Enqueue" .The base test- (a2, b2, c3, d4, f2). Varying every partition provide 8 more tests: o (al, b2, c3, d4, f2) o (a2, bl, c3, d4, f2) o (a2, b2, cl, d4, f2) o (a2, b2, c2, d4, f2) o (a2, b2, c3, dl, f2) (a2, b2, c3, d2, f2) o (a2, b2, c3, d3, f2) o o (a2, b2, c3, d4, fi) .To check what one of the tests above would look like, take (a2, b2, c3. d3, f2), where we focus on the varying di, the "cap" value. Note that the "queue" value specified by c3 is not compatible with this selection. Further either b2 or a2 has to change, as if cap-I, the queue" will always be either full or empty Thus, a feasible variant of the test is (a2, bl, c2, d3,) . For instantiate this test, it is very clear that that we require another value for a2, an element for queue, such as "One". For running this test, the tester has to construct a queue o q = new BoundedQueue ( 1 ) ; Insert a element o q. Enqueue ("One") For achieving the desired start of the test, carry out another call o q. Enqueue ("One") Basically, the tester wants to check that the result queue have two "One At this stage, the tester may decide that having two "One" wasn't as informative as having, a One and a Two, thereby motivating expansion of possible values for the block f2 to include "Two
Step 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