This homework implements comprehensive software testing using Input Space Partitioning (ISP) techniques for the BoundedQueue data structure.
BoundedQueue.js- The BoundedQueue implementationBoundedQueue.test.js- Comprehensive test suiteISP_Analysis.md- Complete ISP analysis documentationpackage.json- Project configuration and dependencies
Install dependencies using pnpm:
pnpm installRun all tests:
pnpm testRun tests with coverage report:
pnpm test:coverageThe test suite includes:
- Constructor: 5 tests covering valid/invalid capacities
- Enqueue: 7 tests covering element types and queue states
- Dequeue: 4 tests covering queue emptiness states
- 8 additional tests targeting boundary conditions
- Tests capacity boundaries (-1, 0, 1)
- Tests queue size boundaries (empty, full, one away from boundaries)
- 6 tests covering wrap-around behavior
- Mutator/observer pair testing
- Complex state transition scenarios
- 11 tests for enqueue method
- Covers all combinations of element types × queue states
Total: 53 comprehensive test cases (42 from original ISP analysis + 11 additional coverage tests)
To run the BoundedQueue demo:
node BoundedQueue.jsAll tests should pass, demonstrating:
- Correct handling of valid inputs
- Proper exception throwing for invalid inputs
- FIFO queue semantics
- Circular array wrap-around behavior
- State management (empty, partial, full)