POTD 2: Input Domain Model (IDM) — GenericStack

Due 25-Sep-2025, 11am EST

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:

Assume the usual semantics for the GenericStack. Try to keep your partitioning simple and choose a small number of partitions and blocks.

  1. List all of the input variables, including the state variables
    sample solution
    stack
    X
    

  2. Define characteristics of the input variables. Make sure you cover all input variables
    sample solution
    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?           

  3. Partition the characteristics into blocks
    sample solution
    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      

  4. Define values for each block
    sample solution
    (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"] )   

Grading rubric

[Total: 10 points]: Done (or provide evidence of your attempt, full or reasonable effort)

(-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)


Submission

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.




Copyright © 2025 Upsorn Praphamontripong
Released under the Creative Commons License CC-BY-NC-SA 4.0 license.
Last updated 2025-09-19 10:56