7.8 KiB
7.8 KiB
Step 7: Final Testing Checklist
Refactored Tic-Tac-Toe Game - Hardware Validation
Date: January 30, 2026
Status: Compilation successful ✓
Pre-Test Verification
Build Artifacts
- Compiles without errors
- Compiles without warnings
- basic1.uf2 generated successfully
- All new modules included in build
Architecture Components
- InputManager class (lib/input_manager.cpp)
- Game base class (lib/game.h)
- TicTacToeGame class (games/tic_tac_toe.cpp)
- Input events (lib/input_event.h)
- Main loop refactored (basic1.cpp)
Hardware Testing Plan
Test 1: Basic System Startup
Expected Behavior:
- USB serial connection establishes
- Debug messages appear:
- "=== [BOARD_NAME] Demo ==="
- "Core 1 started - handling display refreshes"
- "Touch initialized successfully"
- Initial game board renders
Validation:
- Serial output shows startup messages
- Both cores start successfully
- Display shows Tic-Tac-Toe board
- No system hangs or crashes
Test 2: Touch Input Detection
Test Steps:
- Tap empty cell in top-left corner
- Tap empty cell in center
- Tap empty cell in bottom-right corner
- Tap already occupied cell
- Tap outside board area
Expected Behavior:
- Debug output: "Processing touch: flag=1"
- Debug output: "Touch DOWN at (x,y)"
- X or O appears in tapped cell
- Occupied cells reject new pieces
- Touches outside board are ignored
- Turn indicator updates on left side
Validation:
- Touch interrupts fire correctly
- Coordinates map to correct cells
- Pieces appear in touched cells
- Turn switches between X and O
- Invalid moves rejected
- Debug messages show correct coordinates
Test 3: Button Navigation (e-ink boards)
Test Steps:
- Press KEY0 to move selection
- Press KEY0 multiple times to cycle cells
- Press KEY1 to place piece in selected cell
- Verify selection skips occupied cells
Expected Behavior:
- KEY0: Selection highlight moves to next cell
- KEY1: Piece placed at highlighted cell
- Selection automatically skips occupied cells
- Debug output: "Selection moved to [row,col]"
Validation:
- KEY0 moves selection correctly
- KEY1 places piece at selection
- Selection visual feedback works
- Button debouncing functions
- Debug messages show correct events
Test 4: Win Condition Detection
Test Scenarios:
Row Win (X)
- Tap cells: [0,0], [1,0], [0,1], [1,1], [0,2]
- Expected: "X WINS!" message
Column Win (O)
- Tap cells: [0,0], [0,1], [1,0], [0,2], [2,1], [0,3]
- Expected: "O WINS!" message (after X's move)
Diagonal Win (X)
- Tap cells: [0,0], [0,1], [1,1], [0,2], [2,2]
- Expected: "X WINS!" message
Tie Game
- Fill all cells with no winner
- Expected: "TIE GAME!" message
Validation:
- Row wins detected correctly
- Column wins detected correctly
- Diagonal wins detected correctly
- Tie games detected correctly
- Game over message displays
- No further moves accepted after win
Test 5: Game Restart
Test Steps:
- Complete a game (win or tie)
- Touch screen or press KEY0
- Verify board clears
- Verify X starts first
- Play another game
Expected Behavior:
- Board clears to empty state
- X always starts after restart
- Turn indicator resets
- Previous game statistics preserved
- New game begins immediately
Validation:
- Touch restarts game
- KEY0 restarts game
- Board completely clears
- X starts correctly
- Game flows normally after restart
Test 6: Statistics Tracking
Test Steps:
- Play game where X wins
- Check statistics: "X:1 O:0 Tie:0"
- Restart and let O win
- Check statistics: "X:1 O:1 Tie:0"
- Play to tie
- Check statistics: "X:1 O:1 Tie:1"
- Verify move counter increments
Expected Behavior:
- Win counts persist across restarts
- Tie count tracks correctly
- Move counter shows total moves
- Statistics display at bottom
Validation:
- X wins increment correctly
- O wins increment correctly
- Ties increment correctly
- Move counter accurate
- Stats persist across restarts
- Display shows current stats
Test 7: Display Refresh (Dual-Core)
Test Steps:
- Make move and observe refresh
- Make rapid successive moves
- During e-ink refresh, attempt another move
- Verify Core 0 stays responsive
Expected Behavior:
- Display refreshes after each move
- Core 1 handles refresh asynchronously
- Core 0 processes inputs during refresh
- Pending refresh queues if Core 1 busy
- Debug message: "Refresh pending - Core 1 still busy" (if applicable)
Validation:
- Display updates after moves
- No screen artifacts
- System responsive during refresh
- E-ink refresh completes fully
- Dual-core architecture working
- No refresh race conditions
Test 8: Edge Cases & Error Handling
Test Scenarios:
Rapid Touch Events
- Tap multiple cells rapidly
- Expected: All valid moves registered
Touch During Transition
- Touch during display refresh
- Expected: Input queued, processed after refresh
Multiple Button Presses
- Press both KEY0 and KEY1 simultaneously
- Expected: One action processed (KEY0 priority)
Touch Release Events
- Touch and hold, then release
- Expected: Debug shows "Touch UP"
Validation:
- Rapid touches handled correctly
- No missed inputs
- No duplicate moves
- Touch up events processed
- System remains stable
Test 9: Memory & Performance
Observations:
- Monitor for memory leaks (play 10+ games)
- Check for display artifacts over time
- Verify system doesn't slow down
- Confirm no crashes after extended use
Validation:
- No memory leaks observed
- Consistent performance over time
- No progressive slowdown
- Display quality maintained
- System stable after 10+ games
Test 10: Code Architecture Validation
Verification:
- InputManager handles all input processing
- TicTacToeGame encapsulates game logic
- basic1.cpp only handles hardware/main loop
- Polymorphic Game pointer works correctly
- All extern variables resolve correctly
Validation:
- InputManager processes touch correctly
- InputManager processes buttons correctly
- Game class polymorphism works
- Clean separation of concerns
- No tight coupling between modules
Success Criteria
Must Pass (Critical)
- System boots and initializes
- Touch input registers moves
- Win conditions detect correctly
- Game restarts properly
- Display refreshes without artifacts
Should Pass (Important)
- Button navigation works (if board has buttons)
- Statistics track accurately
- Debug output shows correct events
- Dual-core refresh is non-blocking
- Edge cases handled gracefully
Nice to Have (Enhancement)
- Gesture recognition works
- No performance degradation over time
- Clean debug output formatting
- Smooth user experience
Issue Tracking
Found Issues
| Issue | Severity | Description | Status |
|---|---|---|---|
Notes
Test Results Summary
Date Tested: _________________
Tester: _________________
Hardware: _________________
Overall Status: ⬜ PASS / ⬜ FAIL / ⬜ PARTIAL
Critical Issues: _________________
Recommendations: _________________
Next Steps
If all tests pass:
- ✅ Architecture successfully refactored
- ✅ Ready to add new games (Snake, Pong, etc.)
- ✅ Can implement GameLauncher for game selection
If issues found:
- Document specific failing test
- Check relevant module (InputManager, TicTacToeGame, or main loop)
- Verify hardware connections (touch INT pin, button pins)
- Review debug serial output for clues
- Test with minimal configuration first