Context
Eclipse SCORE needs automated test-to-requirement traceability (score eclipse-score/score#2521, score eclipse-score/baselibs#145). Their current approach uses Python decorators (@add_test_properties(partially_verifies=["req_id"])) and comment tags (# req-traceability: <NEED_ID>) parsed by custom Sphinx extensions. This is fragile and language-specific.
Problem
Safety-critical standards (ASPICE SWE.4-6, ISO 26262) require bidirectional traceability between test cases and requirements. Currently Rivet tracks test artifacts manually in YAML. For large codebases, maintaining manual test-to-requirement YAML is unsustainable.
Proposed approach
- Source code scanning: extract traceability markers from test source code
- Rust:
#[rivet::verifies("REQ-001")] attribute macro or // rivet: verifies REQ-001 comments
- Python:
@rivet_verifies("REQ-001") decorator or # rivet: verifies REQ-001 comments
- Generic: configurable regex patterns per language
- Test result linking: parse JUnit XML / cargo test JSON output and link test results to artifacts via test name conventions or embedded markers
- Ephemeral injection: similar to commit nodes, inject test-artifact links into the link graph at analysis time without materializing YAML
- Coverage reporting:
rivet coverage --tests showing which requirements have test coverage and which don't
Rivet artifacts
References
Context
Eclipse SCORE needs automated test-to-requirement traceability (score eclipse-score/score#2521, score eclipse-score/baselibs#145). Their current approach uses Python decorators (
@add_test_properties(partially_verifies=["req_id"])) and comment tags (# req-traceability: <NEED_ID>) parsed by custom Sphinx extensions. This is fragile and language-specific.Problem
Safety-critical standards (ASPICE SWE.4-6, ISO 26262) require bidirectional traceability between test cases and requirements. Currently Rivet tracks test artifacts manually in YAML. For large codebases, maintaining manual test-to-requirement YAML is unsustainable.
Proposed approach
#[rivet::verifies("REQ-001")]attribute macro or// rivet: verifies REQ-001comments@rivet_verifies("REQ-001")decorator or# rivet: verifies REQ-001commentsrivet coverage --testsshowing which requirements have test coverage and which don'tRivet artifacts
References