Requirements guides
Requirements traceability matrix: a worked example for hardware
A requirements traceability matrix (RTM) is a table that links every requirement to the tests that verify it, and every test back to the requirement it exists for. Read one way, it answers "is each requirement verified?". Read the other way, it answers "why does this test exist?". For a hardware team, a useful matrix also records the result of each test and the level it was run at, because a pass on a bench prototype is not the same evidence as a pass on a pre-production unit. This guide builds one on a small product, shows the three gaps it must reveal, and ends with a template you can download.
Why the matrix is worth the effort
A requirement that nobody tests is a requirement nobody knows is met. Finding that out late is expensive. A NASA study of hardware and software systems estimated how the cost of fixing a requirements error grows with the phase in which it is found. Its composite of three estimation methods puts the factor at 3 to 8 times in design, 7 to 16 times during build, 21 to 78 times in integration and test, and 29 to more than 1,500 times in operations, compared with fixing it while the requirements are being written.
A matrix does not prevent requirement errors. It makes the missing links visible while they are still cheap: a requirement with no test is easy to see in a matrix and easy to miss in a folder of test reports.
The columns that matter
ISO/IEC/IEEE 29148, the international standard for requirements engineering, defines what a good requirement looks like and the attributes requirements carry. For the matrix itself, the NASA Systems Engineering Handbook gives an example requirements verification matrix and suggests the minimum information it should hold. Its columns, condensed, are the ones most hardware teams need:
| Column | What it holds | Why it matters |
|---|---|---|
| Requirement ID | A unique identifier | Links survive renaming and reordering |
| Requirement text | The "shall" statement | The test is written against this wording |
| Source | The document and paragraph it comes from | Backward trace to the parent or customer |
| Verification method | Test, analysis, inspection or demonstration | Not every requirement is verified by a test |
| Success criteria | What counts as a pass | Removes argument at review time |
| Phase or level | Where the verification is done | A bench pass is not a production pass |
| Results | The document that holds the evidence | The proof, not a claim of proof |
Two columns are worth adding for a team that changes requirements while it builds: the revision of the requirement each test was run against, and the level reached by each run. Without them the matrix cannot tell a current pass from an old one.
Forward and backward traceability
Forward traceability starts from a requirement and follows it down to design and tests: every requirement must reach at least one verification. Backward traceability starts from a test, or a lower-level requirement, and follows it up: everything must trace to a reason. The NASA handbook asks for both directions, which it calls bidirectional traceability, between stakeholder expectations, requirements at each level, design documents, and test plans and procedures. It is direct about the backward case: a requirement with no parent is either an acceptable self-derived requirement, or a sign that the trace is flawed or that the requirement is gold plating.
A matrix that is only filled in one direction hides half the problems. Teams usually fill it forward, from the requirements list, so the tests nobody can explain never show up.
A worked example: a handheld gas detector
The example below is sample data: GD-1, a handheld carbon monoxide detector invented for this guide. It has 14 requirements and 16 test cases, and three levels of evidence: L1 on the bench, L2 on prototypes, L3 on pre-production units. Each requirement states the level its verification must reach.
Use the filters to show the gaps, select a requirement to light its tests, or select a test to light its requirement. Then change the alarm threshold in GD-01 from 50 ppm to 35 ppm and watch what happens to its results.
Pick a requirement or a test case to see what it is linked to.
- Verified
- Passed below required level
- Failed
- Not run
- Result is stale (requirement changed)
- Test without requirement
This is a picture with sample data. Build the live one with your own requirements.
The three gaps a matrix must reveal
A requirement with no test. GD-09 (self-test at power on) and GD-13 (alarm log survives a battery drain) have no test case. They may be met; nobody can show it. In a review these are the first rows to discuss: write a test, choose another verification method, or agree that the requirement is not needed.
A test with no requirement. TC-15 (vibration endurance) and TC-16 (backlight flicker) pass, but verify nothing in the specification. Either a requirement is missing, which is common for vibration, or the test is spending bench time on something nobody asked for. Backward traceability is the only way to find these.
A test that passed below the level it must reach. GD-03 (12 h runtime) and GD-11 (water jets) passed on prototypes, but both requirements must be shown on pre-production units. A matrix that only records pass and fail shows these rows as green. The required level and the level reached have to sit side by side in the matrix to catch it.
The example also has one failure (TC-09, charge time) and one test that has not run (TC-11, keypad with gloves). Those are visible in any test report. The three gaps above are not, which is why they are the reason to keep a matrix.
When a requirement changes
Change GD-01 in the matrix above and its two results turn stale. They were run against the 50 ppm wording; the requirement now says 35 ppm. The tests may still be valid, or the threshold in TC-01 may need to change, but until someone looks, a pass recorded against revision 1 says nothing about revision 2.
This is the most common way a matrix goes wrong over a project: it stays green while the requirements under it move. Recording the revision a test was run against is what makes the stale results visible.
What breaks when the matrix lives in a spreadsheet
A spreadsheet is a fine way to start, and the template below is one. The problems show up as the project grows:
- Copies drift. The matrix is a copy of the requirements and of the test results. Each update to either has to be made twice, by hand, and the copy is the one that falls behind. (How results land on the requirement instead)
- Revisions are not tracked. A cell can be edited without anyone seeing what it said before, so a test can silently end up verifying a different sentence from the one it was written for. (What a reworded requirement touches)
- Many-to-many links get flattened. One requirement with three tests becomes three rows, or one row with three IDs in a cell. Both make the backward view hard to build. (Following the links both ways)
- Nothing stops a gap. A filter shows the empty test column today; nothing warns you when a new requirement is added without one tomorrow. (Requirements with no test, shown as they appear)
- Review and approval happen elsewhere. The matrix records links, not who approved the requirement text that the tests were written against. (Review and approval on the change itself)
When to move it into a system
Keep the spreadsheet while one person owns the requirements and the tests, and the list fits on a screen. Move the matrix into requirements management software when any of these becomes true: several people change requirements, requirements change after tests have been written, someone outside the team (a customer or an auditor) will ask to see the trace, or the same product ships in variants that share most requirements. The point of the move is that the matrix stops being a document someone maintains and becomes a view of links that exist anyway.
Download the template
The sample set comes in two forms. The CSV template holds the rows above, one line per requirement and test pair, with the requirement revision, the required level and the level reached; it is for working in a spreadsheet. Replace the rows with your own and keep the columns.
The ReqIF file holds the same 14 sample requirements, to open in a free workspace: requirements management software imports it, and Plotune RMS brings it in as drafts for review. It carries the requirements only; you add the test cases in the workspace.
CSV template for a spreadsheet ReqIF file to open in a free workspace
In Plotune RMS
In Plotune RMS the matrix is not a separate file. Each test case is linked to the requirement revision it was written for, each run records its result and the level it reached, and a reworded requirement shows which tests were written for the old text before a person approves the change. Requirements without a test, and passes below the required level, show on their own. You can create a free workspace, import the sample ReqIF file and add the tests yourself.
Sources
- Stecklein, J. M., Dabney, J., Dick, B., Haskins, B., Lovell, R. and Moroney, G., Error Cost Escalation Through the Project Life Cycle, NASA Johnson Space Center, 2004 (NTRS 20100036670). Abstract and Table 13, systems cost factors.
- NASA, NASA Systems Engineering Handbook, NASA/SP-2016-6105 Rev2. Section 6.2 (requirements management and bidirectional traceability), Table 4.2-2 (requirements metadata), Appendix D (requirements verification matrix).
- IEEE, ISO/IEC/IEEE 29148:2018, Systems and software engineering: Life cycle processes, Requirements engineering, abstract.
