45 lines
2.0 KiB
Markdown
45 lines
2.0 KiB
Markdown
# QA Plan: Briefing UX & Reason Labels
|
|
|
|
## Scope
|
|
|
|
Verify that reason labels are correctly populated on query results, that the reason taxonomy is complete and type-safe, that signal snapshots are populated, and that the feature adds no measurable performance regression.
|
|
|
|
## Test Strategy
|
|
|
|
### Unit Tests
|
|
|
|
| ID | Area | Test | Pass Criteria |
|
|
|---|---|---|---|
|
|
| U1 | `ReasonCode` enum | Serde round-trip for all 19 variants | `serialize -> deserialize` produces identical enum value |
|
|
| U2 | `ReasonLabel` | Construction with context and weight | Fields accessible, `Debug` and `Clone` work |
|
|
| U3 | `ScoredCandidate` | Reasons field defaults to empty vec | Compiles and works |
|
|
| U4 | Signal snapshot | Profile with boosts populates snapshot | `signal_snapshot.len() > 0` |
|
|
| U5 | Signal snapshot | Profile without boosts leaves snapshot empty | `signal_snapshot.is_empty()` |
|
|
| U6 | Dominance threshold | Reasons below 10% weight are filtered | Only reasons with `weight >= 0.10` survive |
|
|
| U7 | Max reasons | At most 3 reasons per result | `result.reasons.len() <= 3` |
|
|
| U8 | Reason ordering | Reasons sorted by weight descending | `reasons[0].weight >= reasons[1].weight` |
|
|
| U9 | Sort-mode mapping | Each Sort variant produces correct ReasonCode | Verified per sort mode |
|
|
|
|
### Integration Tests
|
|
|
|
| ID | Profile | Expected Reasons |
|
|
|---|---|---|
|
|
| I1 | `for_you` | `PreferenceMatch`, `FollowedCreator`, or `SocialProof` |
|
|
| I2 | `trending` | `TrendingGlobal` |
|
|
| I3 | `following` | `FollowedCreator` |
|
|
| I4 | `search` (text) | `TextRelevance` |
|
|
| I5 | `search` (vector) | `SemanticMatch` |
|
|
| I6 | `hidden_gems` | `HiddenGem` |
|
|
| I7 | `rising` | `Rising` |
|
|
| I8 | `controversial` | `Controversial` |
|
|
|
|
### Regression Protection
|
|
|
|
- All existing unit tests pass
|
|
- All existing integration tests pass
|
|
- Clippy clean, format clean
|
|
|
|
## Pass/Fail Criteria
|
|
|
|
- **Pass**: All unit tests, integration tests, edge cases, and regression checks pass. Performance < 5% regression.
|
|
- **Fail**: Any integration test fails, any regression check fails, or performance regression > 5%. |