| name | quality-assurance |
| description | Use when ensuring feature quality through testing, coverage gates, and pre-merge verification. Load during the Testing phase of SDLC. |
quality-assurance
SDLC Phase: Testing
Ensure feature quality through thorough testing and verification.
Principles
- Test behaviour, not implementation — Tests should verify what the code does, not how it does it.
- Cover the edges — Happy path is the minimum. Edge cases (empty, error, boundary, overflow) are where bugs live.
- Dogfood rvtest — Every workspace crate tests itself with rvtest's BDD API. This is mandatory, not optional.
- Tests are documentation — Well-written tests serve as executable documentation of expected behaviour.
- One behaviour per test — Each
describe/it block tests exactly one scenario.
Test Placement
| Test Type | Location | Purpose |
|---|
| Unit test | src/ inline #[cfg(test)] | Internal helper functions, private methods |
| Integration test | tests/ at crate root | Public API behaviour from an external perspective |
| Doc test | /// code blocks in doc comments | Usage examples that are always up-to-date |
| Dogfooded spec | tests/ using describe/it | BDD-style behavioural tests for rvtest features |
What to Test
Every new public function should be tested for:
- Happy path — Normal inputs produce correct output.
- Edge cases — Empty input, zero values, negative values, overflow, domain boundaries.
- Error cases — Invalid inputs produce appropriate errors, not panics.
- Invariants — Properties that should always hold (e.g.,
a + b == b + a).
Floating-point comparisons use assert!((a - b).abs() < EPSILON) rather than assert_eq!.
Dogfooding Requirements
- Every workspace crate uses rvtest's BDD API for complex test scenarios.
- Raw
#[test] functions are reserved for bootstrapping and doc-tests only.
- Every
describe block ends with .run().assert_all_pass() to surface failures.
- New public API requires a corresponding dogfooded test.
Pre-Merge Verification
Before considering work complete:
Output Requirements
- Test files for all new functionality
- Test results confirming all tests pass
- Note of any coverage gaps or areas that could benefit from additional testing