CS/SWE 332 Assignment 5
Due Wednesday, October 3, 2018


Goal: Abstraction Functions and Rep-Invariants.
Provide an abstraction function and rep-invariant for the Stack example from assignment 4.

  1. Implement the abstraction function (as toString()) and the representation invariant (as repOk()).
  2. Once your code is complete, add some fault (intentionally, if necessary) that results in a violation of the rep-invariant.

    Your fault should be a "missing code" fault. In other words, you should introduce your fault be deleting some code in your (correct) implementation.

    Demonstrate that your faulty code is, indeed, faulty with a call to repOk() from a JUnit test. To help out the GTA, you should document your fault with an easily identifiable comment in your code.