---
title: "Traceability with Sphinx-Needs"
description: "Requirements traced to ECUs, models and tests, as docs-as-code"
source: https://developer.remotivelabs.com/docs/get-started/examples/traceability
last_updated: 2026-11-24
---

# Traceability with Sphinx-Needs

- Goal: Process
- From: [RemotiveCar v0.9.0](https://github.com/remotivelabs/remotivelabs-remotive-car/tree/v0.9.0)
- Vehicle domains: Lighting

## Run it

```bash
git clone https://github.com/remotivelabs/remotivelabs-remotive-car.git
cd remotivelabs-remotive-car

pip install -r docs/requirements.txt

sphinx-build -W -b html docs build/html
```

Open build/html/index.html.

[Sphinx-Needs](https://sphinx-needs.readthedocs.io/) allows you to combine Docs-as-Code with Application Lifecycle
Management, to track requirements, specifications, test cases, and other engineering objects in your documentation.

This example adds ISO 26262-style traceability to RemotiveCar, developed together with [useblocks](https://useblocks.com/).
It is a limited sample of what the full documentation would look like: features, system and component requirements,
the ECUs, channels and behavioral models of the platform, the test cases that verify them, and FMEA entries, all as
linked "needs" in `.rst` files next to the code.

```
Feature <- (satisfies) <- System Req <- (satisfies) <- Component Req <- (verifies) <- Test Case
                                                             ^
                                                  (mitigates) FMEA Entry
```

- Part of the [RemotiveCar example](https://github.com/remotivelabs/remotivelabs-remotive-car/blob/v0.9.0/DOCS.md)
- [Using Sphinx-Needs](https://github.com/remotivelabs/remotivelabs-remotive-car/blob/v0.9.0/docs/README.md): what the project contains, how to build it and the tools available
- Need types, link types and fields: [ubproject.toml](https://github.com/remotivelabs/remotivelabs-remotive-car/blob/v0.9.0/docs/ubproject.toml)
- Validation rules that run on every build: [schemas.json](https://github.com/remotivelabs/remotivelabs-remotive-car/blob/v0.9.0/docs/schemas.json)

Build the HTML documentation (PlantUML and Python 3.10 or later are needed):

```bash
pip install -r docs/requirements.txt
sphinx-build -W -b html docs build/html
```

Then open `build/html/index.html`.

Notice:
- `-W` turns warnings into errors, so a missing ASIL rating or a test case that verifies nothing fails the build.

## Where it lives in the repo

- [docs/requirements/](https://github.com/remotivelabs/remotivelabs-remotive-car/tree/v0.9.0/docs/requirements)
- [docs/verification/](https://github.com/remotivelabs/remotivelabs-remotive-car/tree/v0.9.0/docs/verification)
- [docs/index.rst](https://github.com/remotivelabs/remotivelabs-remotive-car/blob/v0.9.0/docs/index.rst)
- [docs/README.md](https://github.com/remotivelabs/remotivelabs-remotive-car/blob/v0.9.0/docs/README.md)
- [docs/ubproject.toml](https://github.com/remotivelabs/remotivelabs-remotive-car/blob/v0.9.0/docs/ubproject.toml)

[Read this use case on GitHub](https://github.com/remotivelabs/remotivelabs-remotive-car/blob/v0.9.0/usecases/TRACEABILITY_SPHINX.md)

## Works well with

- [Scenario tests with behave](https://developer.remotivelabs.com/docs/get-started/examples/behave.md): Tests written as scenarios that domain experts can read
- [Test cases with pytest](https://developer.remotivelabs.com/docs/get-started/examples/pytest.md): Integration tests as Python code, run as part of the topology
