Skip to content

Commit f9942b2

Browse files
Copilotrjaegers
andcommitted
docs: add inline SBDL declarations to Gherkin feature files
Co-authored-by: rjaegers <45816308+rjaegers@users.noreply.github.com>
1 parent eccdb49 commit f9942b2

6 files changed

Lines changed: 31 additions & 0 deletions

File tree

test/cpp/features/compatibility.feature

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
Feature: Compatibility
2+
# @sbdl compatibility is aspect { description is "As a software craftsperson, I want my development environment to be compatible with commonly used tools and systems." }
23

34
As a software craftsperson,
45
to ensure that my development environment works well with a variety of tools and systems,
56
I want my development environment to be compatible with commonly used tools and systems.
67

78
@REQ-COMPAT-0001
89
Rule: Open Container Initiative (OCI) Image Specification
10+
# @sbdl req-compat-0001 is requirement { description is "amp-devcontainer images *SHALL* be compatible with the [OCI image specification](https://github.com/opencontainers/image-spec/blob/main/spec.md)" aspect is compatibility }
911
amp-devcontainer images *SHALL* be compatible with the [OCI image specification](https://github.com/opencontainers/image-spec/blob/main/spec.md)
1012

1113
To guarantee compatibility with container runtimes and container- and image tooling; amp-devcontainer should be compatible with the OCI image specification.
1214

1315
@REQ-COMPAT-0002
1416
Rule: Host architecture
17+
# @sbdl req-compat-0002 is requirement { description is "amp-devcontainer *SHALL* be compatible with both the x86-64 (AMD64) *and* AArch64 (ARM64) host architectures." aspect is compatibility }
1518
amp-devcontainer *SHALL* be compatible with both the x86-64 (AMD64) *and* AArch64 (ARM64) host architectures.
1619

1720
Supporting both x86-64 and AArch64 has several advantages:
@@ -21,6 +24,7 @@ Feature: Compatibility
2124

2225
@REQ-COMPAT-0003
2326
Rule: Integrated Development Environment (IDE)
27+
# @sbdl req-compat-0003 is requirement { description is "amp-devcontainer *SHOULD* be compatible with [VS Code](https://code.visualstudio.com/) *and* [GitHub Codespaces](https://github.com/features/codespaces)." aspect is compatibility }
2428
amp-devcontainer *SHOULD* be compatible with [VS Code](https://code.visualstudio.com/) *and* [GitHub Codespaces](https://github.com/features/codespaces).
2529

2630
It should be possible to use amp-devcontainer and all of its features in both VS Code and GitHub Codespaces with minimal effort.
@@ -29,6 +33,7 @@ Feature: Compatibility
2933

3034
@REQ-COMPAT-0004
3135
Rule: GitHub Actions
36+
# @sbdl req-compat-0004 is requirement { description is "amp-devcontainer *SHOULD* support seamless integration with [GitHub Actions](https://github.com/features/actions) without additional configuration." aspect is compatibility }
3237
amp-devcontainer *SHOULD* support seamless integration with [GitHub Actions](https://github.com/features/actions) without additional configuration.
3338

3439
Seamless integration with GitHub Actions allows users to easily incorporate amp-devcontainer into their ci/cd workflows.

test/cpp/features/compilation.feature

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
Feature: Compilation
2+
# @sbdl compilation is aspect { description is "As a software developer, source code needs to be compiled into working software." }
23

34
As a software developer,
45
to generate a working product, when using compiled languages,
56
source code needs to be compiled into working software.
67

78
@REQ-COMP-0001
89
Rule: Compile for container host architecture and operating system
10+
# @sbdl req-comp-0001 is requirement { description is "amp-devcontainer *SHALL* be able to compile valid source code into a working executable targeting the container host architecture and operating system." aspect is compilation }
911
amp-devcontainer *SHALL* be able to compile valid source code into a working executable targeting the container host architecture and operating system.
1012

1113
Compiling valid source code into working software, able to run on the container host architecture and operating system,
@@ -17,13 +19,15 @@ Feature: Compilation
1719

1820
@flavor:cpp
1921
Scenario: Compile valid source code into working software targeting the container host architecture
22+
# @sbdl compile-valid-source-code-into-working-software-targeting-the-container-host-architecture is test { description is "Compile valid source code into working software targeting the container host architecture" requirement is req-comp-0001 }
2023
Given build configuration "gcc" is selected
2124
And build preset "gcc" is selected
2225
When the selected target is built
2326
Then the output should contain "Build finished with exit code 0"
2427

2528
@REQ-COMP-0002
2629
Rule: Compile for ARM Cortex target architecture
30+
# @sbdl req-comp-0002 is requirement { description is "amp-devcontainer *SHOULD* be able to compile valid source-code into a working ELF executable targeting the ARM Cortex architecture." aspect is compilation }
2731
amp-devcontainer *SHOULD* be able to compile valid source-code into a working ELF executable targeting the ARM Cortex architecture.
2832

2933
Compiling valid source-code into working ELF executables, able to run on the ARM Cortex architecture,
@@ -32,6 +36,7 @@ Feature: Compilation
3236

3337
@REQ-COMP-0003
3438
Rule: Compile for Microsoft® Windows operating system
39+
# @sbdl req-comp-0003 is requirement { description is "amp-devcontainer *SHOULD* be able to compile valid source-code into a working executable targeting the Microsoft® Windows operating system." aspect is compilation }
3540
amp-devcontainer *SHOULD* be able to compile valid source-code into a working executable targeting the Microsoft® Windows operating system.
3641

3742
Compiling valid source-code into working executables, able to run on the Microsoft® Windows operating system, can be necessary in several scenarios e.g.
@@ -41,6 +46,7 @@ Feature: Compilation
4146

4247
@REQ-COMP-0004
4348
Rule: Compilation cache
49+
# @sbdl req-comp-0004 is requirement { description is "amp-devcontainer *MAY* be able to cache the results of a compilation to speed-up subsequent compilations." aspect is compilation }
4450
amp-devcontainer *MAY* be able to cache the results of a compilation to speed-up subsequent compilations.
4551

4652
Maintaining a compilation cache can be useful in both local and ci development scenarios. A compilation cache can provide benefits like:

test/cpp/features/debugging.feature

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
Feature: Debugging
2+
# @sbdl debugging is aspect { description is "As a software craftsperson, I want to be able to debug my source code within the development environment." }
23

34
As a software craftsperson,
45
to efficiently identify and resolve issues in my code,
56
I want to be able to debug my source code within the development environment.
67

78
@REQ-DBG-0001
89
Rule: Debugging support
10+
# @sbdl req-dbg-0001 is requirement { description is "amp-devcontainer *SHALL* provide debugging support for the primary programming language(s) used within the container." aspect is debugging }
911
amp-devcontainer *SHALL* provide debugging support for the primary programming language(s) used within the container.
1012

1113
Providing debugging support within the development environment enhances the developer experience and productivity.
@@ -15,6 +17,7 @@ Feature: Debugging
1517

1618
@REQ-DBG-0002
1719
Rule: Upload firmware to micro-controller
20+
# @sbdl req-dbg-0002 is requirement { description is "amp-devcontainer *MAY* provide tools to upload compiled firmware to a connected micro-controller." aspect is debugging }
1821
amp-devcontainer *MAY* provide tools to upload compiled firmware to a connected micro-controller.
1922

2023
Providing tools to upload compiled firmware to a connected micro-controller enhances the development workflow for embedded systems.

test/cpp/features/maintainability.feature

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
Feature: Maintainability
2+
# @sbdl maintainability is aspect { description is "As a software craftsperson, I want my development environment to be maintainable over time." }
23

34
As a software craftsperson,
45
to ensure that I have access to a stable and reliable development environment,
56
I want my development environment to be maintainable over time.
67

78
@REQ-MAINT-0001
89
Rule: Tool and dependency updates
10+
# @sbdl req-maint-0001 is requirement { description is "amp-devcontainer *SHOULD* contain up-to-date tools and dependencies." aspect is maintainability }
911
amp-devcontainer *SHOULD* contain up-to-date tools and dependencies.
1012

1113
Keeping tools and dependencies up-to-date helps ensure that the development environment remains secure, stable, and compatible with the latest technologies.
@@ -14,6 +16,7 @@ Feature: Maintainability
1416

1517
@REQ-MAINT-0002
1618
Rule: Automatic updates
19+
# @sbdl req-maint-0002 is requirement { description is "amp-devcontainer *SHOULD* provide support for automatic updates when consumed as a dependency." aspect is maintainability }
1720
amp-devcontainer *SHOULD* provide support for automatic updates when consumed as a dependency.
1821

1922
Providing support for automatic updates when amp-devcontainer is consumed as a dependency helps ensure that users always have access to the latest features, bug fixes, and security patches.
@@ -22,13 +25,15 @@ Feature: Maintainability
2225

2326
@REQ-MAINT-0003
2427
Rule: Re-usable build system
28+
# @sbdl req-maint-0003 is requirement { description is "amp-devcontainer *SHOULD* provide re-usable building blocks to enable building, publishing and testing derived containers." aspect is maintainability }
2529
amp-devcontainer *SHOULD* provide re-usable building blocks to enable building, publishing and testing derived containers.
2630

2731
Providing re-usable building blocks for building, publishing and testing derived containers reduces duplication, and ensures consistent application of practices.
2832
Derived containers (i.e. containers using amp-devcontainer as a base for further extension) should be able to build, push and test in the same way that amp-devcontainer does, without the need to duplicate the build system.
2933

3034
@REQ-MAINT-0004
3135
Rule: Architectural decisions
36+
# @sbdl req-maint-0004 is requirement { description is "amp-devcontainer *SHOULD* document its architectural decisions." aspect is maintainability }
3237
amp-devcontainer *SHOULD* document its architectural decisions.
3338

3439
Documenting architectural decisions helps provide context and rationale for the design choices made in the development environment.
@@ -37,6 +42,7 @@ Feature: Maintainability
3742

3843
@REQ-MAINT-0005
3944
Rule: Container image size
45+
# @sbdl req-maint-0005 is requirement { description is "amp-devcontainer *SHOULD* aim to keep its container image size as small as possible without compromising functionality." aspect is maintainability }
4046
amp-devcontainer *SHOULD* aim to keep its container image size as small as possible without compromising functionality.
4147

4248
Keeping the container image size small helps improve performance, reduce resource consumption, and minimize the time required to download and deploy the development environment.

test/cpp/features/security.feature

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
Feature: Security
2+
# @sbdl security is aspect { description is "As a security engineer, I want to have controls in place to identify and mitigate supply-chain vulnerabilities." }
23

34
As a security engineer and security conscious developer,
45
to have control over the security posture of my development environment,
56
I want to have controls in place to identify and mitigate supply-chain vulnerabilities.
67

78
@REQ-SEC-0001
89
Rule: Build provenance
10+
# @sbdl req-sec-0001 is requirement { description is "amp-devcontainer *SHALL* include build provenance as specified in [SLSA v1.0 Build L3](https://slsa.dev/spec/v1.0/levels)." aspect is security }
911
amp-devcontainer *SHALL* include build provenance as specified in [SLSA v1.0 Build L3](https://slsa.dev/spec/v1.0/levels).
1012

1113
Including provenance gives confidence that the container images haven't been tampered with and can be securely traced back to its source code.
@@ -15,6 +17,7 @@ Feature: Security
1517

1618
@REQ-SEC-0002
1719
Rule: Signing
20+
# @sbdl req-sec-0002 is requirement { description is "amp-devcontainer *SHALL* cryptographically sign its released container images." aspect is security }
1821
amp-devcontainer *SHALL* cryptographically sign its released container images.
1922

2023
Cryptographically signing released container images provides integrity and authenticity guarantees.
@@ -23,6 +26,7 @@ Feature: Security
2326

2427
@REQ-SEC-0003
2528
Rule: Software Bill of Materials (SBOM)
29+
# @sbdl req-sec-0003 is requirement { description is "amp-devcontainer *SHOULD* provide a Software Bill of Materials (SBOM) for its released container images." aspect is security }
2630
amp-devcontainer *SHOULD* provide a Software Bill of Materials (SBOM) for its released container images.
2731

2832
Providing a Software Bill of Materials (SBOM) enables consumers to identify and manage security risks associated with the software components included in the container images.

test/cpp/features/static-dynamic-analysis.feature

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
Feature: Static and dynamic analysis
2+
# @sbdl static-and-dynamic-analysis is aspect { description is "As a software craftsperson, I want my source code to be statically and dynamically analyzed." }
23

34
As a software craftsperson,
45
to maintain consistent, high-quality and bug-free code,
56
I want my source code to be statically and dynamically analyzed.
67

78
@REQ-SDA-0001
89
Rule: Code formatting
10+
# @sbdl req-sda-0001 is requirement { description is "amp-devcontainer *MAY* provide code formatting tools for the primary programming language(s) used within the container." aspect is static-and-dynamic-analysis }
911
amp-devcontainer *MAY* provide code formatting tools for the primary programming language(s) used within the container.
1012

1113
Providing code formatting tools helps maintain a consistent coding style across the codebase, improving readability and reducing friction during code reviews.
@@ -14,13 +16,15 @@ Feature: Static and dynamic analysis
1416

1517
@flavor:cpp @fixme
1618
Scenario: Format source code according to a formatting style
19+
# @sbdl format-source-code-according-to-a-formatting-style is test { description is "Format source code according to a formatting style" requirement is req-sda-0001 }
1720
Given the file "clang-tools/unformatted.cpp" is opened in the editor
1821
When the active document is formatted
1922
And the active document is saved
2023
Then the contents of "clang-tools/unformatted.cpp" should match the contents of "clang-tools/formatted.cpp"
2124

2225
@REQ-SDA-0002
2326
Rule: Static analysis
27+
# @sbdl req-sda-0002 is requirement { description is "amp-devcontainer *MAY* provide static analysis tools for the primary programming language(s) used within the container." aspect is static-and-dynamic-analysis }
2428
amp-devcontainer *MAY* provide static analysis tools for the primary programming language(s) used within the container.
2529

2630
Providing static analysis tools helps identify potential issues in the code before it is executed, improving code quality and reducing the likelihood of runtime errors.
@@ -29,6 +33,7 @@ Feature: Static and dynamic analysis
2933

3034
@REQ-SDA-0003
3135
Rule: Coverage analysis
36+
# @sbdl req-sda-0003 is requirement { description is "amp-devcontainer *SHOULD* provide code coverage analysis tools for the primary programming language(s) used within the container." aspect is static-and-dynamic-analysis }
3237
amp-devcontainer *SHOULD* provide code coverage analysis tools for the primary programming language(s) used within the container.
3338

3439
Providing code coverage analysis tools helps assess the effectiveness of the existing test suite by measuring how much of the code is exercised by the tests.
@@ -37,6 +42,7 @@ Feature: Static and dynamic analysis
3742

3843
@REQ-SDA-0004
3944
Rule: Mutation testing
45+
# @sbdl req-sda-0004 is requirement { description is "amp-devcontainer *MAY* provide mutation testing tools for the primary programming language(s) used within the container." aspect is static-and-dynamic-analysis }
4046
amp-devcontainer *MAY* provide mutation testing tools for the primary programming language(s) used within the container.
4147

4248
Providing mutation testing tools helps assess the effectiveness of the existing test suite by introducing small changes (mutations) to the code and checking if the tests can detect these changes.
@@ -45,6 +51,7 @@ Feature: Static and dynamic analysis
4551

4652
@REQ-SDA-0005
4753
Rule: Fuzz testing
54+
# @sbdl req-sda-0005 is requirement { description is "amp-devcontainer *MAY* provide fuzz testing tools for the primary programming language(s) used within the container." aspect is static-and-dynamic-analysis }
4855
amp-devcontainer *MAY* provide fuzz testing tools for the primary programming language(s) used within the container.
4956

5057
Providing fuzz testing tools helps identify potential security vulnerabilities and robustness issues in the code by automatically generating and executing a large number of random inputs.

0 commit comments

Comments
 (0)