stack X
Purpose: Understand Input Domain Model and derive Input Space Partitioning test inputs
You may make a copy of a worksheet and complete this activity, or simply type your answers in any text editor.
You may work alone or with another student in this course (max team size = 2).
This is from exercise 6.1, #4 (AO textbook).
Derive input space partitioning test inputs for the GenericStack class
with the following method signatures:
public GenericStack ();public void push (Object X);public Object pop ();public boolean isEmpty ();
Assume the usual semantics for the GenericStack.
Try to keep your partitioning simple and choose a small number of partitions and blocks.
stack X
Note: (these are only some possible characteristics)
There are 4 testable units here (the constructor and the three methods);
there is substantial overlap between the characteristics relevant for each other.
For the three methods, the implicit parameter is the state of the GenericStack.
The only explicit input is the Object x parameter in Push().
The constructor has neither inputs nor implicit parameters.
Typical characteristics for the implicit state are:
C1: the size of the stack
C2: whether the stack contains null entries
Typical characteristics for Object X is:
C3: whether X is null
There are also characteristics that involves the combination of Object X and the stack state.
C4: does Object X appear in the stack?
C1: the size of the stack
b1 = 0 | b2 = 1 | b3 > 1
C2: whether the stack contains null entries
b1 = true | b2 = false
C3: whether X is null
b1 = true | b2 = false
C4: does Object X appear in the stack?
b1 = true | b2 = false
(possible values can be anything that fits the characteristic and block constraint)
C1: the size of the stack
stack = [] | stack = ["cat"] or [null] | stack = ["cat", "dog"] or ["cat", null] or ["cat", "dog", "ox"]
C2: whether the stack contains null entries
stack = [null] or [null, "cat", null] | stack = ["cat", "dog"] or ["cat", "dog", "ox"]
C3: whether X is null
X = null | X = "cat" or "dog" or ""
C4: does Object X appear in the stack?
( null, [null, "cat", null] ) or ("cat", ["cat", "dog"] ) | ( null, ["cat"] ) or ("cat", ["dog", "ox"] )
(-2.5 points) for 24 hours late (submitted after 25-Sep-2025 11am EST, by 26-Sep-2025 11am EST)
(-5 points) for 48 hours late (submitted after 26-Sep-2025 11am EST, by 27-Sep-2025 11am EST)
Making your submission available to instructor and course staff is your responsibility; if we cannot access or open your file, you will not get credit. Be sure to test access to your file before the due date.
CC-BY-NC-SA 4.0 license.