---
title: "Requirements coverage"
---

# Requirements coverage

Import requirements from ReqIF 1.2, link CANoe test cases, diagnostic test cases and test design cases to them, see coverage from the latest recorded runs, and export a traceability report with provenance.

**State:** ReqIF 1.2 reading is verified against 126 public ReqIF files from two projects, compared with an independent reader (strictdoc's `reqif`). Coverage, links and the report are built; their results come from the run records of CANoe test units (kit shipped), diagnostic tests and test designs (modelled). No customer requirements were read.

## Import requirements from ReqIF

Every `.reqif` and `.reqifz` file in the workspace is read in place; nothing is written into it. For each spec object: its ID (`ReqIF.ForeignID`, else the identifier), text (`ReqIF.Text`, XHTML as text), name, type, last change, every other attribute by its long name, its relations and its place in the hierarchy. A spec object with `ReqIF.ChapterName` and no text is a heading, and the requirements below it are shown under it with their section numbers. What the reader cannot read is a problem at its place, and the rest of the file is still read.

Where a tool keeps the ID or text in other attributes, run **Choose ReqIF ID and Text Attributes...** (the ReqIF file's context menu in the Explorer); the choice is kept in the link file.

## Link test cases

**Link Test Case to Requirements...** (a test case's context menu in the Testing view, the coverage view's title bar, or the Command Palette) offers every requirement of the workspace, with those already linked ticked. CANoe test cases and diagnostic test cases are linked in `.vscode/automotive-trace-links.json` of the test unit's workspace folder, which has a JSON schema; test design cases are linked in the design file itself. Problems reports links to requirements, test units or test cases that do not exist, IDs two ReqIF files both define, and invalid JSON.

Trace item files (`.vti-tso`) that CANoe test units name are listed per test unit, and a missing one is reported; their content is not read, because the format is not published.

## See coverage

The **Requirements Coverage** view in the Testing view shows each ReqIF file's requirements under their chapters, each with what the latest recorded run of each linked test says:

| Coverage | When |
|---|---|
| Passed | Every linked test passed |
| Failed | Any linked test failed or erred |
| Not run | None failed, but one has no recorded run or was left out by its variant or chosen parameter sets |
| Not tested | No test is linked |

Under each requirement, the linked test cases with their verdict, run time, variant and parameter sets. The view also lists requirements with no test, test cases with no requirement and trace item files. Coverage reports recorded results; it is not a verdict of its own. Opening a requirement opens its place in the ReqIF file; opening a test case opens its entry.

![Requirements Coverage listing ReqIF requirements with their linked test cases and those without a test.](https://neuralinverse.com/docs-images/modules/automotive/requirements-coverage.webp)

## Export a traceability report

**Generate Traceability Report...** (the coverage view's title bar) writes into a folder you choose an HTML page without scripts, one CSV per table (requirements with coverage, links, requirements with no test, test cases with no requirement, run records used, trace item files, problems) and a provenance file `report.csv` naming every source file with its size and SHA-256, the Editor's name and version, and the time. Two reports of the same sources from the same version give byte-identical CSV files.

Agents use `requirementsCoverage` (read only) and `linkTestCaseToRequirements` (asks before it writes).

**Not verified:** ReqIF files exported by DOORS, DOORS Next, Polarion or Codebeamer were seen only where the public samples hold them; ReqIF tool extensions are not read; results from a real CANoe run.
