|
| 1 | +--- |
| 2 | +title: "Requirements traceability matrix for amp-devcontainer" |
| 3 | +author: ["@rjaegers"] |
| 4 | +colorlinks: true |
| 5 | +date: "{{ sbdl['doc_control']['custom:generated_at'] | strftime('%Y-%m-%d') }}" |
| 6 | +keywords: [Traceability, Requirements, RTM, amp-devcontainer] |
| 7 | +lang: "en" |
| 8 | +titlepage: true |
| 9 | +titlepage-color: "0B5ED7" |
| 10 | +titlepage-text-color: "FFFFFF" |
| 11 | +titlepage-rule-color: "FFFFFF" |
| 12 | +titlepage-rule-height: 2 |
| 13 | +toc: true |
| 14 | +toc-own-page: true |
| 15 | +header-includes: |
| 16 | + - \AtEndDocument{\label{lastpage}} |
| 17 | +{%- if sbdl['doc_control']['custom:is_release'] != 'true' %} |
| 18 | +watermark: "DRAFT" |
| 19 | +{%- endif %} |
| 20 | +footer-right: "\\thepage \\hspace{1pt} of \\pageref*{lastpage}" |
| 21 | +... |
| 22 | + |
| 23 | +{% import "partials/text-utilities.j2" as utils %} |
| 24 | + |
| 25 | +# Introduction |
| 26 | + |
| 27 | +## Purpose |
| 28 | + |
| 29 | +This document provides a requirements traceability matrix (RTM) for amp-devcontainer. It maps each requirement to its associated verification tests, providing evidence of test coverage across the system. |
| 30 | + |
| 31 | +## Abstract |
| 32 | + |
| 33 | +amp-devcontainer is a set of [devcontainers](https://containers.dev/) tailored towards modern, embedded, software development. This traceability matrix traces requirements from the *Software Requirements Specification (SRS)* to their corresponding verification tests as enumerated in the *Software Test Plan (STP)*. |
| 34 | + |
| 35 | +## Document Control |
| 36 | + |
| 37 | +{% include "partials/document-control.md.j2" with context %} |
| 38 | + |
| 39 | +This document is generated from a formal model defined in [sbdl](https://sbdl.dev) and versioned alongside the source code in Git. |
| 40 | +The authoritative source of change history is the [Git log](https://github.com/philips-software/amp-devcontainer/commits/) of the source material from which the model is built. |
| 41 | + |
| 42 | +# Traceability Matrix |
| 43 | +{%- for id, item in sbdl.items() %} |
| 44 | +{%- if item.type == 'aspect' and 'custom:title' in item %} |
| 45 | + |
| 46 | +## {{ utils.reencode(utils.strip_gherkin_prefix(item['custom:title'])) }} |
| 47 | + |
| 48 | +| Requirement | Test | Status | |
| 49 | +|-------------|------|--------| |
| 50 | + |
| 51 | +{%- if 'requirement' in item %} |
| 52 | +{%- for req_ref in item.requirement %} |
| 53 | +{%- set req = sbdl[req_ref.identifier] %} |
| 54 | +{%- set req_name = utils.reencode(utils.strip_gherkin_prefix(req['custom:title'])) | trim %} |
| 55 | + |
| 56 | +{%- set ns_tests = namespace(test_list=[]) -%} |
| 57 | + |
| 58 | +{%- for test_id, test_elem in sbdl.items() -%} |
| 59 | +{%- if test_elem.type == 'test' -%} |
| 60 | +{%- if 'requirement' in test_elem -%} |
| 61 | +{%- for test_req_ref in test_elem.requirement if test_req_ref.identifier == req_ref.identifier -%} |
| 62 | +{%- set _ = ns_tests.test_list.append(test_id) -%} |
| 63 | +{%- endfor -%} |
| 64 | +{%- endif -%} |
| 65 | +{%- endif -%} |
| 66 | +{%- endfor -%} |
| 67 | + |
| 68 | +{%- if ns_tests.test_list -%} |
| 69 | +{%- for test_id in ns_tests.test_list %} |
| 70 | +{%- set test_name = utils.strip_bats_syntax(sbdl[test_id]['custom:title']) | trim %} |
| 71 | +| {{ utils.display_short(req_name) }} | {{ test_id }}: {{ utils.display_short(test_name) }} | Traced | |
| 72 | +{%- endfor -%} |
| 73 | +{%- else %} |
| 74 | +| {{ utils.display_short(req_name) }} | — | **Not covered** | |
| 75 | +{%- endif -%} |
| 76 | + |
| 77 | +{%- endfor %} |
| 78 | +{%- endif %} |
| 79 | +{%- endif %} |
| 80 | +{%- endfor %} |
| 81 | + |
| 82 | +# Coverage Summary |
| 83 | + |
| 84 | +{%- set ns_summary = namespace(total_reqs=0, covered_reqs=0, total_tests=0) -%} |
| 85 | + |
| 86 | +{%- for elem_id, elem in sbdl.items() -%} |
| 87 | +{%- if elem.type == 'requirement' -%} |
| 88 | +{%- set ns_summary.total_reqs = ns_summary.total_reqs + 1 -%} |
| 89 | + |
| 90 | +{%- set ns_covered = namespace(is_covered=false) -%} |
| 91 | +{%- for test_id, test_elem in sbdl.items() -%} |
| 92 | +{%- if test_elem.type == 'test' and 'requirement' in test_elem -%} |
| 93 | +{%- for req_ref in test_elem.requirement if req_ref.identifier == elem_id -%} |
| 94 | +{%- set ns_covered.is_covered = true -%} |
| 95 | +{%- endfor -%} |
| 96 | +{%- endif -%} |
| 97 | +{%- endfor -%} |
| 98 | + |
| 99 | +{%- if ns_covered.is_covered -%} |
| 100 | +{%- set ns_summary.covered_reqs = ns_summary.covered_reqs + 1 -%} |
| 101 | +{%- endif -%} |
| 102 | + |
| 103 | +{%- endif -%} |
| 104 | + |
| 105 | +{%- if elem.type == 'test' -%} |
| 106 | +{%- set ns_summary.total_tests = ns_summary.total_tests + 1 -%} |
| 107 | +{%- endif -%} |
| 108 | +{%- endfor %} |
| 109 | + |
| 110 | +| Metric | Value | |
| 111 | +|---|---| |
| 112 | +| Total requirements | {{ ns_summary.total_reqs }} | |
| 113 | +| Requirements with tests | {{ ns_summary.covered_reqs }} | |
| 114 | +| Requirements without tests | {{ ns_summary.total_reqs - ns_summary.covered_reqs }} | |
| 115 | +| Total tests | {{ ns_summary.total_tests }} | |
0 commit comments