- Requirement-driven, deterministic verification.
- Pure algorithm step generator verification independent of React DOM timers.
- Playback engine state transition verification (forward, backward, pause, resume, speed, reset).
- Edge-case robustness: empty inputs, single-element, duplicates, negative values, sorted arrays, reverse-sorted arrays, missing search targets.
- Test Framework: Vitest (
vitest run) - Configuration:
vitest.config.ts - Environment: Node.js (fast, deterministic pure state testing)
- Location:
src/__tests__/
- Tier 1: Feature Coverage (Core Step Sequences):
- Sorting: Bubble, Selection, Insertion, Merge, Quick, Heap, Counting, Radix, Bucket. Verifying proper sequence of
compare,swap/move, andsortedsteps. - Searching: Linear Search, Binary Search (with low/mid/high pointer updates), Jump Search, Interpolation Search, Exponential Search, Ternary Search.
- Data Structures: Linked List insert/delete, Stack push/pop, Queue enqueue/dequeue, BST insert/search, Graph BFS/DFS/Dijkstra shortest path.
- Sorting: Bubble, Selection, Insertion, Merge, Quick, Heap, Counting, Radix, Bucket. Verifying proper sequence of
- Tier 2: Boundary & Corner Cases:
- Empty input array
[] - Single-element array
[42] - Array with all identical duplicate elements
[5, 5, 5, 5, 5] - Array containing negative numbers
[-10, 4, -2, 0, 15] - Already sorted array
[1, 2, 3, 4, 5] - Reverse-sorted array
[5, 4, 3, 2, 1] - Missing search target (not found condition, pointer exhaustion)
- Zero-distance / disconnected graph nodes
- Empty input array
- Tier 3: Playback Engine State Transitions:
- Step forward:
stepIndexincrements, state matches step snapshot. - Step backward:
stepIndexdecrements, previous state snapshot is restored exactly. - Reset: resets
stepIndexto 0, preserves custom user array input (does not overwrite with random array). - Speed adjustment: alters interval without disturbing current step or mutating array state.
- Step forward:
- Tier 4: End-to-End Application Integrity:
npm run buildsucceeds generating all 35 static routes with 0 errors.npm run lintfinishes with 0 errors and 0 warnings (no unhandled exhaustive-deps).- TypeScript compilation check (
tsc --noEmit).