trace-doc
A Rust-based framework for compile-time, zero-cost traceability and specification modeling.
Overview
trace-doc enables you to model requirements, realizations, and tests directly in Rust's type system. It provides zero-runtime-cost traceability for safety-critical and high-assurance software.
Features
- Compile-time traceability: Link requirements, realizations, and tests using Rust traits.
- Zero runtime cost: All traceability is enforced at compile time.
Future Feature ideas
- Artifact Model Extraction & Visualization: Extract types and their trait implementations (e.g., using rustdoc's JSON format) to reconstruct the artifact model. This will enable generating a complete traceability graph of requirements, realizations, and tests.
- Rustdoc Integration: Display the reconstructed artifact model and traceability graph directly in the generated rustdoc HTML, making documentation interactive and navigable.
- Sphinx-Needs Export: Export requirements, realizations, tests, and interfaces to Sphinx-Needs for integration with Sphinx-based documentation workflows.
Example
/// The system shall be able to calculate the mathematical constant π.
;
/// This realization implements the calculation of π.
; // implements pub fn calculate_pi() -> f64
How to Use
- Model your requirements, realizations, and tests as Rust types and traits.
- Use the provided traits to link them (e.g.,
Realizes,Tests). - Build your project as usual. The Rust compiler enforces traceability at compile time.
Related Traceability Tools
mantra: An alternative approach to requirement tracing that uses string-based requirement IDs with automatic source code scanning and database-backed reporting.