tidaldb/.sdlc/features/p1-quality-diversity-baseline/qa-plan.md

2.7 KiB

QA Plan: Quality & Diversity Baseline

Scope

Verify that the new brief built-in ranking profile enforces quality gates and diversity constraints as specified, without regressing existing functionality.

Test Matrix

1. Quality Gate Verification

# Scenario Input Expected Type
Q1 Low-view items excluded 10 items: 5 with 1-2 views, 5 with >= 3 views. All have >= 1 completion. Only the 5 high-view items appear in results Integration
Q2 Zero-completion items excluded 10 items: all have >= 3 views, 5 have 0 completions Only the 5 items with completions appear Integration
Q3 Both gates combined Items with mixed view/completion. Some fail view gate, some fail completion gate, some pass both Only items passing both gates appear Integration
Q4 Edge case: exactly at threshold Items with exactly 3 views and exactly 1 completion Items appear in results (>= threshold, not >) Integration

2. Diversity Verification

# Scenario Input Expected Type
D1 Creator diversity 30 items from 5 creators, 10 from dominant creator. Limit 10. Multiple creators represented, no single creator has all 10 Integration
D2 Format dominance prevented 12 items: 6 video, 6 podcast. Different creators, all pass quality gates. No format exceeds 60% of results Integration
D3 Combined constraints 13 items: mixed quality, skewed creators, mixed formats Quality gates + creator diversity + format max 60% all hold Integration

3. Profile Registration

# Scenario Expected Type
R1 Profile resolvable brief profile found in registry, query executes without error Integration
R2 Builtin count Total registered builtins includes brief Unit (existing test updated)

4. Regression

# Scenario Expected Type
RG1 Existing lib tests pass cargo test --lib passes with no failures Automated
RG2 Clippy clean cargo clippy -D warnings passes Automated
RG3 Format clean cargo fmt --check passes Automated

Pass Criteria

  • All Q1-Q4, D1-D3, R1-R2 tests pass.
  • All RG1-RG3 checks pass.
  • No new warnings introduced.

Automation

All tests are automated via cargo test. No manual testing required.

# Quality and diversity integration tests
cargo test --manifest-path tidal/Cargo.toml --test p1_quality_diversity

# Lib unit tests (includes builtin count check)
cargo test --manifest-path tidal/Cargo.toml --lib

# Lint
cargo clippy --manifest-path tidal/Cargo.toml -- -D warnings
cargo fmt --manifest-path tidal/Cargo.toml --check