1.4 KiB
1.4 KiB
Testing & Debugging Protocols
1. Automated Testing Strategy
You are required to maintain a tests/ directory. Use pytest for unit logic and pytest-qt for UI interactions.
A. Core Logic Validation
- Requirement: Every math formula in
GAME_MECHANICS.mdmust have a corresponding unit test intests/test_math.py. - Edge Cases: Test for 0.00 PED loot, maximum stack sizes, and 100% item decay.
B. Log Parsing Verification
- Mocking: Do not rely on real game logs for testing. Create a
tests/mock_logs/folder containing samplechat.logsnippets. - Goal: The
LogWatchermust correctly identify loots, globals, and damage values from these mocks with 100% accuracy.
2. Debugging Routine
When a bug is reported or a test fails, follow the "Plan-Act-Reflect" pattern:
- Hypothesize: Use Sequential Thinking to identify the most likely failure point.
- Trace: Use the Filesystem tool to read the latest
logs/debug.logfile. - Isolate: Create a minimal reproduction script to confirm the bug.
- Fix: Apply the fix and run all existing tests to ensure no regressions.
3. Playwright UI Testing
Use the Playwright MCP to:
- Verify that the HUD overlay remains "Always on Top."
- Test button clicks and navigation between the Hunter and Miner modules.
- Ensure that "Project Selection" correctly loads historical data into the dashboard.