-
Notifications
You must be signed in to change notification settings - Fork 7
docs: add stp and rtm documents #1210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
0f3fa44
docs: add stp and rtm documents
rjaegers b41f257
docs: fix encoding issue
rjaegers 04b7e43
Apply suggestions from code review
rjaegers 79721ef
Merge branch 'main' into docs/add-stp-and-rtm-documents
rjaegers e99e7d5
Merge branch 'main' into docs/add-stp-and-rtm-documents
rjaegers 92b1473
docs: correctly fill document context
rjaegers 4693dcf
docs: apply document control to all documents
rjaegers 8b286e9
docs: fix test name rendering
rjaegers 0d8c764
docs: update document control
rjaegers 0c3b5c2
docs: change page numbering to x of y
rjaegers 5a31038
docs: clearly mark non-release documents as draft
rjaegers 3056b21
docs: add more traceability
rjaegers 518ecad
ci: also publish SBDL model
rjaegers 43e71f4
docs: use partials and custom filter support
rjaegers 725e9f7
ci: remove dummy arguments for SBDL version directives
rjaegers b44f9c8
docs: process review comments
rjaegers 7afe757
docs: process review comments
rjaegers File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| from datetime import datetime | ||
|
|
||
| def strftime_filter(value, fmt): | ||
|
rjaegers marked this conversation as resolved.
|
||
| if value.endswith('Z'): | ||
| value = value[:-1] + '+00:00' | ||
|
|
||
| return datetime.fromisoformat(value).strftime(fmt) | ||
|
|
||
| filters = { 'strftime': strftime_filter } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| | Property | Value | | ||
| |-------------------|---------------------------------------------------------------------------------------------------------------------------| | ||
| | Document version | {{ sbdl['doc_control']['custom:version'] }} | | ||
| | Generation date | {{ sbdl['doc_control']['custom:generated_at'] | strftime('%Y-%m-%d') }} | | ||
| | Source revision | {{ sbdl['doc_control']['custom:git_sha'] }} | | ||
| | Source branch/tag | {{ sbdl['doc_control']['custom:git_ref'] }} | | ||
| | Model | SBDL {{ sbdl['doc_control']['custom:sbdl_compiler_version'] }} (DSL {{ sbdl['doc_control']['custom:sbdl_dsl_version'] }}) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| {% macro reencode(text) -%} | ||
| {{ text.encode('utf-8').decode('unicode_escape') }} | ||
| {%- endmacro -%} | ||
|
|
||
| {%- macro strip_gherkin_prefix(text) -%} | ||
| {{ text | replace('Rule: ', '') | replace('Feature: ', '') }} | ||
| {%- endmacro -%} | ||
|
|
||
| {%- macro strip_bats_syntax(text) -%} | ||
| {{ text | replace('@test "', '') | replace('" \{', '') | replace('" {', '') }} | ||
| {%- endmacro -%} | ||
|
|
||
| {%- macro display_short(text) -%} | ||
| {{ text[:60] }} | ||
| {%- endmacro %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,115 @@ | ||
| --- | ||
| title: "Requirements traceability matrix for amp-devcontainer" | ||
| author: ["@rjaegers"] | ||
| colorlinks: true | ||
| date: "{{ sbdl['doc_control']['custom:generated_at'] | strftime('%Y-%m-%d') }}" | ||
| keywords: [Traceability, Requirements, RTM, amp-devcontainer] | ||
| lang: "en" | ||
| titlepage: true | ||
| titlepage-color: "0B5ED7" | ||
| titlepage-text-color: "FFFFFF" | ||
| titlepage-rule-color: "FFFFFF" | ||
| titlepage-rule-height: 2 | ||
| toc: true | ||
| toc-own-page: true | ||
| header-includes: | ||
| - \AtEndDocument{\label{lastpage}} | ||
| {%- if sbdl['doc_control']['custom:is_release'] != 'true' %} | ||
| watermark: "DRAFT" | ||
| {%- endif %} | ||
| footer-right: "\\thepage \\hspace{1pt} of \\pageref*{lastpage}" | ||
| ... | ||
|
|
||
| {% import "partials/text-utilities.j2" as utils %} | ||
|
|
||
| # Introduction | ||
|
|
||
| ## Purpose | ||
|
|
||
| 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. | ||
|
|
||
| ## Abstract | ||
|
|
||
| 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)*. | ||
|
|
||
| ## Document Control | ||
|
|
||
| {% include "partials/document-control.md.j2" with context %} | ||
|
|
||
| This document is generated from a formal model defined in [sbdl](https://sbdl.dev) and versioned alongside the source code in Git. | ||
| 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. | ||
|
|
||
| # Traceability Matrix | ||
| {%- for id, item in sbdl.items() %} | ||
| {%- if item.type == 'aspect' and 'custom:title' in item %} | ||
|
|
||
| ## {{ utils.reencode(utils.strip_gherkin_prefix(item['custom:title'])) }} | ||
|
|
||
| | Requirement | Test | Status | | ||
| |-------------|------|--------| | ||
|
|
||
| {%- if 'requirement' in item %} | ||
| {%- for req_ref in item.requirement %} | ||
| {%- set req = sbdl[req_ref.identifier] %} | ||
| {%- set req_name = utils.reencode(utils.strip_gherkin_prefix(req['custom:title'])) | trim %} | ||
|
|
||
| {%- set ns_tests = namespace(test_list=[]) -%} | ||
|
|
||
| {%- for test_id, test_elem in sbdl.items() -%} | ||
| {%- if test_elem.type == 'test' -%} | ||
| {%- if 'requirement' in test_elem -%} | ||
| {%- for test_req_ref in test_elem.requirement if test_req_ref.identifier == req_ref.identifier -%} | ||
| {%- set _ = ns_tests.test_list.append(test_id) -%} | ||
| {%- endfor -%} | ||
| {%- endif -%} | ||
| {%- endif -%} | ||
| {%- endfor -%} | ||
|
|
||
| {%- if ns_tests.test_list -%} | ||
| {%- for test_id in ns_tests.test_list %} | ||
| {%- set test_name = utils.strip_bats_syntax(sbdl[test_id]['custom:title']) | trim %} | ||
| | {{ utils.display_short(req_name) }} | {{ test_id }}: {{ utils.display_short(test_name) }} | Traced | | ||
| {%- endfor -%} | ||
| {%- else %} | ||
| | {{ utils.display_short(req_name) }} | — | **Not covered** | | ||
| {%- endif -%} | ||
|
|
||
| {%- endfor %} | ||
| {%- endif %} | ||
| {%- endif %} | ||
| {%- endfor %} | ||
|
|
||
| # Coverage Summary | ||
|
|
||
| {%- set ns_summary = namespace(total_reqs=0, covered_reqs=0, total_tests=0) -%} | ||
|
|
||
| {%- for elem_id, elem in sbdl.items() -%} | ||
| {%- if elem.type == 'requirement' -%} | ||
| {%- set ns_summary.total_reqs = ns_summary.total_reqs + 1 -%} | ||
|
|
||
| {%- set ns_covered = namespace(is_covered=false) -%} | ||
| {%- for test_id, test_elem in sbdl.items() -%} | ||
| {%- if test_elem.type == 'test' and 'requirement' in test_elem -%} | ||
| {%- for req_ref in test_elem.requirement if req_ref.identifier == elem_id -%} | ||
| {%- set ns_covered.is_covered = true -%} | ||
| {%- endfor -%} | ||
| {%- endif -%} | ||
| {%- endfor -%} | ||
|
|
||
| {%- if ns_covered.is_covered -%} | ||
| {%- set ns_summary.covered_reqs = ns_summary.covered_reqs + 1 -%} | ||
| {%- endif -%} | ||
|
|
||
| {%- endif -%} | ||
|
|
||
| {%- if elem.type == 'test' -%} | ||
| {%- set ns_summary.total_tests = ns_summary.total_tests + 1 -%} | ||
| {%- endif -%} | ||
| {%- endfor %} | ||
|
|
||
| | Metric | Value | | ||
| |---|---| | ||
| | Total requirements | {{ ns_summary.total_reqs }} | | ||
| | Requirements with tests | {{ ns_summary.covered_reqs }} | | ||
| | Requirements without tests | {{ ns_summary.total_reqs - ns_summary.covered_reqs }} | | ||
| | Total tests | {{ ns_summary.total_tests }} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.