Skip to content

Test-to-requirement traceability extraction #20

@avrabe

Description

@avrabe

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

  1. 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
  2. Test result linking: parse JUnit XML / cargo test JSON output and link test results to artifacts via test name conventions or embedded markers
  3. Ephemeral injection: similar to commit nodes, inject test-artifact links into the link graph at analysis time without materializing YAML
  4. Coverage reporting: rivet coverage --tests showing which requirements have test coverage and which don't

Rivet artifacts

  • REQ-026
  • FEAT-043

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions