# E2E & Unit Test Infra: Character Stat Aggregator

## Test Philosophy
- Opaque-box requirement verification combined with deep mathematical assertions and integration testing.
- Methodology: Category-Partition + Boundary Value Analysis + Pairwise Combinations + Real-World Workload Testing.

## Feature Inventory & Test Coverage Goals
| # | Feature | Source | Tier 1 (Coverage) | Tier 2 (Boundary) | Tier 3 (Combinations) | Tier 4 (Workloads) |
|---|---------|--------|:-----------------:|:-----------------:|:---------------------:|:------------------:|
| 1 | Base Stats Calculation | ORIGINAL_REQUEST R1 | >= 5 | >= 5 | ✓ | ✓ |
| 2 | Flat Modifiers | ORIGINAL_REQUEST R1 | >= 5 | >= 5 | ✓ | ✓ |
| 3 | Percentage Modifiers (Inc/Red/More/Less) | ORIGINAL_REQUEST R1 | >= 5 | >= 5 | ✓ | ✓ |
| 4 | Tag-Based Filtering | ORIGINAL_REQUEST R1 | >= 5 | >= 5 | ✓ | ✓ |
| 5 | Conditional Modifiers | ORIGINAL_REQUEST R1 | >= 5 | >= 5 | ✓ | ✓ |
| 6 | Inventory Affix Ingestion | ORIGINAL_REQUEST R1 | >= 5 | >= 5 | ✓ | ✓ |
| 7 | Meridian Passive Ingestion | ORIGINAL_REQUEST R1 | >= 5 | >= 5 | ✓ | ✓ |
| 8 | AST & JSON Serialization | ORIGINAL_REQUEST R2 | >= 5 | >= 5 | ✓ | ✓ |
| 9 | SQLite Formula Persistence | ORIGINAL_REQUEST R2 | >= 5 | >= 5 | ✓ | ✓ |
| 10 | Server Engine Loop CombatActor Wiring | ORIGINAL_REQUEST R3 | >= 5 | >= 5 | ✓ | ✓ |
| 11 | Engine Loop Backward Compatibility | ORIGINAL_REQUEST R3 | >= 5 | >= 5 | ✓ | ✓ |

## Test Scenarios
1. **Tier 1 (Feature Coverage)**: Individual stat computation happy paths for attack, HP, crit, resistances, and speed.
2. **Tier 2 (Boundary & Corner Cases)**: Zero base stats, negative modifiers (reduced/less > 100%), empty equipment, empty passives, unmapped tags.
3. **Tier 3 (Cross-Feature Combinations)**: Items + Meridian + Tag filters + Active conditions interacting simultaneously.
4. **Tier 4 (Real-World Application Scenarios)**: High-level endgame player (12 equipped items with T1-T15 affixes, fully allocated Meridian passive constellation, low life condition) registering in `ServerEngineLoop` entering a map instance.
5. **Tier 5 (Adversarial Gaps & Forensic Checks)**: Verify formula AST tree matches exact arithmetic result, ensure SQLite queries return valid JSON, and verify `CombatActor.base_attack > 50.0`.
