|
| 1 | +--- |
| 2 | +title: "Software test plan for amp-devcontainer" |
| 3 | +author: ["@rjaegers"] |
| 4 | +colorlinks: true |
| 5 | +date: "March-2026" |
| 6 | +keywords: [Software, Test, Plan, STP, 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 | +... |
| 16 | + |
| 17 | +{% macro reencode(text) -%} |
| 18 | +{{ text.encode('utf-8').decode('unicode_escape') }} |
| 19 | +{%- endmacro -%} |
| 20 | + |
| 21 | +{%- macro strip_gherkin_prefix(text) -%} |
| 22 | +{{ text | replace('Rule: ', '') | replace('Feature: ', '') }} |
| 23 | +{%- endmacro %} |
| 24 | + |
| 25 | +# Introduction |
| 26 | + |
| 27 | +## Purpose |
| 28 | + |
| 29 | +This document describes the test plan for amp-devcontainer. |
| 30 | +It defines the test strategy, methodology, and environment, and enumerates the tests that verify each requirement. |
| 31 | + |
| 32 | +For the full requirement descriptions, refer to the *Software Requirements Specification (SRS)*. |
| 33 | +For the coverage overview, refer to the *Requirements Traceability Matrix (RTM)*. |
| 34 | + |
| 35 | +## Scope |
| 36 | + |
| 37 | +This document covers the following types of tests: |
| 38 | + |
| 39 | +- **Gherkin verification tests**: Scenario-based tests defined in Gherkin feature files and executed with Playwright. These tests verify behavioral requirements at the system level. |
| 40 | +- **BATS integration tests**: Shell-based integration tests defined in BATS (Bash Automated Testing System) files. These tests verify tool availability, version alignment, and end-to-end compilation and analysis workflows. |
| 41 | + |
| 42 | +## References |
| 43 | + |
| 44 | +| Identifier | Title | |
| 45 | +|------------|---------------------------------------------------------------------------------------------------------------------------------------| |
| 46 | +| SRS | Software Requirements Specification for amp-devcontainer | |
| 47 | +| RTM | Requirements Traceability Matrix for amp-devcontainer | |
| 48 | +| RFC 2119 | [Key words for use in RFCs to Indicate Requirement Levels](https://www.rfc-editor.org/rfc/rfc2119) | |
| 49 | + |
| 50 | +## Document Control |
| 51 | + |
| 52 | +| Property | Value | |
| 53 | +|------------------|----------------------| |
| 54 | +| Document version | {{ version }} | |
| 55 | +| Generation date | {{ generated_at }} | |
| 56 | +| Source revision | {{ git_sha }} | |
| 57 | +| Source branch/tag| {{ git_ref }} | |
| 58 | +| Model | sbdl {{ sbdl_version }} | |
| 59 | + |
| 60 | +This document is generated from a formal requirements model defined in [sbdl](https://sbdl.dev) and versioned alongside the source code in Git. |
| 61 | + |
| 62 | +## Definitions of key words |
| 63 | + |
| 64 | +The key words *MUST*, *MUST NOT*, *REQUIRED*, *SHALL*, *SHALL NOT*, *SHOULD*, *SHOULD NOT*, *RECOMMENDED*, *MAY*, and *OPTIONAL* in this document are to be interpreted as described in [RFC 2119](https://www.rfc-editor.org/rfc/rfc2119). |
| 65 | + |
| 66 | +# Test environment |
| 67 | + |
| 68 | +Tests are executed in a container built from the amp-devcontainer image. The container provides all necessary compilers, tools, and dependencies. |
| 69 | + |
| 70 | +| Component | Description | |
| 71 | +|---|---| |
| 72 | +| Container runtime | OCI-compatible container engine (e.g. Docker, Podman) | |
| 73 | +| Gherkin test runner | Playwright with Gherkin step definitions | |
| 74 | +| Integration test runner | BATS (Bash Automated Testing System) | |
| 75 | +| CI platform | GitHub Actions | |
| 76 | + |
| 77 | +# Test methodology |
| 78 | + |
| 79 | +## Gherkin verification tests |
| 80 | + |
| 81 | +Gherkin scenarios follow the Given-When-Then structure. Each scenario exercises a specific capability of the devcontainer by automating interactions with the development environment. Tests are executed via Playwright inside a running devcontainer instance (GitHub Codespace or local). A scenario passes when all of its steps complete without error. |
| 82 | + |
| 83 | +## BATS integration tests |
| 84 | + |
| 85 | +BATS tests verify tool presence, version alignment, and end-to-end workflows (compilation, analysis, formatting) by executing shell commands inside the devcontainer. Each test function runs in isolation. A BATS test passes when the test function exits with code 0. |
| 86 | + |
| 87 | +## Expected results |
| 88 | + |
| 89 | +> **Note**: Structured expected-result data per test is not yet available in the current toolchain. This section will be extended when test result rendering is implemented. Currently, a test is considered passed when it completes without error as described above. |
| 90 | + |
| 91 | +# Tests by requirement area |
| 92 | +{%- for aspect_id, aspect in sbdl.items() %} |
| 93 | +{%- if aspect.type == 'aspect' %} |
| 94 | + |
| 95 | +## {{ reencode(strip_gherkin_prefix(aspect['custom:title'])) }} |
| 96 | + |
| 97 | +{%- if 'requirement' in aspect %} |
| 98 | +{%- for req_ref in aspect.requirement %} |
| 99 | +{%- set req = sbdl[req_ref.identifier] %} |
| 100 | + |
| 101 | +### {{ req_ref.identifier }}: {{ reencode(strip_gherkin_prefix(req['custom:title'])) }} |
| 102 | + |
| 103 | +{%- set ns_tests = namespace(has_tests=false) -%} |
| 104 | + |
| 105 | +{%- for test_id, test_elem in sbdl.items() -%} |
| 106 | +{%- if test_elem.type == 'test' -%} |
| 107 | +{%- if 'requirement' in test_elem -%} |
| 108 | +{%- for test_req_ref in test_elem.requirement if test_req_ref.identifier == req_ref.identifier -%} |
| 109 | +{%- set ns_tests.has_tests = true %} |
| 110 | +- {{ reencode(strip_gherkin_prefix(test_elem['custom:title'])) }} |
| 111 | +{%- endfor -%} |
| 112 | +{%- endif -%} |
| 113 | +{%- endif -%} |
| 114 | +{%- endfor -%} |
| 115 | + |
| 116 | +{%- if not ns_tests.has_tests %} |
| 117 | +- *No tests traced to this requirement.* |
| 118 | +{%- endif -%} |
| 119 | + |
| 120 | +{%- endfor %} |
| 121 | +{%- endif %} |
| 122 | +{%- endif %} |
| 123 | +{%- endfor %} |
| 124 | + |
| 125 | +# Anomaly handling |
| 126 | + |
| 127 | +Test failures are tracked as issues in the project's issue tracker. Each failure is triaged, assigned a severity, and linked to the affected requirement(s). Resolution is verified by re-running the affected test(s). |
0 commit comments