diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 828619a..147e38d 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -2,6 +2,12 @@ "version": 1, "isRoot": true, "tools": { + "demaconsulting.reqstream": { + "version": "0.1.0", + "commands": [ + "reqstream" + ] + }, "demaconsulting.spdxtool": { "version": "2.6.0", "commands": [ diff --git a/.cspell.json b/.cspell.json index 957be6e..f9cb0ce 100644 --- a/.cspell.json +++ b/.cspell.json @@ -25,7 +25,8 @@ "weasyprint", "pagetitle", "dcterms", - "Blockquotes" + "Blockquotes", + "tracematrix" ], "ignorePaths": [ "node_modules", diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 64a33d5..d2acac9 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -65,6 +65,15 @@ jobs: --configuration Release --verbosity normal --collect "XPlat Code Coverage;Format=opencover" + --logger "trx;LogFileName=test-results-${{ inputs.os }}.trx" + + - name: Upload test results + if: always() + uses: actions/upload-artifact@v6 + with: + name: test-results-${{ inputs.os }} + path: | + test/**/TestResults/*.trx - name: End Sonar Scanner run: > diff --git a/.github/workflows/build_docs.yaml b/.github/workflows/build_docs.yaml index 01d4e95..7e89e57 100644 --- a/.github/workflows/build_docs.yaml +++ b/.github/workflows/build_docs.yaml @@ -15,6 +15,20 @@ jobs: - name: Checkout repository uses: actions/checkout@v6 + - name: Download test results from Windows + uses: actions/download-artifact@v6 + with: + name: test-results-windows-latest + path: test-results + continue-on-error: true + + - name: Download test results from Linux + uses: actions/download-artifact@v6 + with: + name: test-results-ubuntu-latest + path: test-results + continue-on-error: true + - name: Setup Node.js uses: actions/setup-node@v4 with: @@ -31,6 +45,14 @@ jobs: - name: Restore dotnet tools run: dotnet tool restore + - name: Generate Requirements Report and Trace Matrix + run: > + dotnet reqstream + --requirements requirements.yaml + --tests "test-results/**/*.trx" + --report docs/requirements/requirements.md + --matrix docs/tracematrix/tracematrix.md + - name: Generate HTML with Pandoc run: > dotnet pandoc @@ -42,10 +64,34 @@ jobs: run: > dotnet weasyprint docs/guide/guide.html - docs/guide/guide.pdf + docs/guide.pdf + + - name: Generate Requirements HTML with Pandoc + run: > + dotnet pandoc + --defaults docs/requirements/definition.yaml + --output docs/requirements/requirements.html + + - name: Generate Requirements PDF with Weasyprint + run: > + dotnet weasyprint + docs/requirements/requirements.html + docs/requirements.pdf + + - name: Generate Trace Matrix HTML with Pandoc + run: > + dotnet pandoc + --defaults docs/tracematrix/definition.yaml + --output docs/tracematrix/tracematrix.html + + - name: Generate Trace Matrix PDF with Weasyprint + run: > + dotnet weasyprint + docs/tracematrix/tracematrix.html + docs/tracematrix.pdf - name: Upload documentation uses: actions/upload-artifact@v6 with: name: documentation - path: docs/guide/guide.pdf + path: docs/*.pdf diff --git a/.github/workflows/build_on_push.yaml b/.github/workflows/build_on_push.yaml index afd1d83..1ccc5ce 100644 --- a/.github/workflows/build_on_push.yaml +++ b/.github/workflows/build_on_push.yaml @@ -63,7 +63,9 @@ jobs: build-docs: name: Build Documentation - needs: quality-checks + needs: + - build-windows # Needed for test results + - build-linux # Needed for test results permissions: contents: read uses: ./.github/workflows/build_docs.yaml diff --git a/.gitignore b/.gitignore index 40af974..1abbfa5 100644 --- a/.gitignore +++ b/.gitignore @@ -119,4 +119,8 @@ node_modules/ # Generated documentation docs/guide/*.html -docs/guide/*.pdf +docs/requirements/*.html +docs/requirements/requirements.md +docs/tracematrix/*.html +docs/tracematrix/tracematrix.md +docs/*.pdf diff --git a/docs/requirements/definition.yaml b/docs/requirements/definition.yaml new file mode 100644 index 0000000..9858d00 --- /dev/null +++ b/docs/requirements/definition.yaml @@ -0,0 +1,11 @@ +--- +resource-path: + - docs/requirements + - docs/template +input-files: + - docs/requirements/title.txt + - docs/requirements/introduction.md + - docs/requirements/requirements.md +template: guide_template.html +table-of-contents: true +number-sections: true diff --git a/docs/requirements/introduction.md b/docs/requirements/introduction.md new file mode 100644 index 0000000..de9fdba --- /dev/null +++ b/docs/requirements/introduction.md @@ -0,0 +1,32 @@ +# Introduction + +This document specifies the requirements for the ReqStream tool, a .NET command-line application designed for +managing software requirements in YAML format. + +## Purpose + +The purpose of this document is to define the functional and non-functional requirements that the ReqStream tool +must satisfy. These requirements guide the development, testing, and validation of the tool. + +## Scope + +This document covers: + +- Command-line interface requirements +- Requirements file processing capabilities +- Test integration features +- Reporting and export functionality +- Platform and runtime support + +## Document Conventions + +Throughout this document: + +- Requirements are identified with unique identifiers (e.g., CLI-001, REQ-001) +- Each requirement uses the keyword "shall" to indicate mandatory functionality +- Requirements are organized hierarchically by functional area + +## References + +- ReqStream User Guide: Provides detailed usage instructions and examples +- ReqStream Repository: diff --git a/docs/requirements/title.txt b/docs/requirements/title.txt new file mode 100644 index 0000000..69e9bd8 --- /dev/null +++ b/docs/requirements/title.txt @@ -0,0 +1,12 @@ +--- +title: ReqStream Requirements +subtitle: Requirements Specification for the ReqStream Tool +lang: en-US +keywords: + - ReqStream + - Requirements + - Specification + - .NET + - YAML + - Command-Line Tool +--- diff --git a/docs/tracematrix/definition.yaml b/docs/tracematrix/definition.yaml new file mode 100644 index 0000000..d1f8943 --- /dev/null +++ b/docs/tracematrix/definition.yaml @@ -0,0 +1,11 @@ +--- +resource-path: + - docs/tracematrix + - docs/template +input-files: + - docs/tracematrix/title.txt + - docs/tracematrix/introduction.md + - docs/tracematrix/tracematrix.md +template: guide_template.html +table-of-contents: true +number-sections: true diff --git a/docs/tracematrix/introduction.md b/docs/tracematrix/introduction.md new file mode 100644 index 0000000..fe25ad2 --- /dev/null +++ b/docs/tracematrix/introduction.md @@ -0,0 +1,37 @@ +# Introduction + +This document provides a traceability matrix that maps ReqStream requirements to their associated test cases. +This matrix ensures that each requirement is adequately tested and verified. + +## Purpose + +The purpose of this trace matrix is to: + +- Demonstrate test coverage for all requirements +- Provide traceability between requirements and tests +- Support verification and validation activities +- Facilitate impact analysis when requirements change + +## Scope + +This document covers the traceability between: + +- ReqStream requirements defined in the requirements specification +- Test cases implemented in the ReqStream test suite + +## Matrix Organization + +The trace matrix is organized by requirement, showing: + +- Requirement identifier and title +- Associated test cases that verify the requirement +- Test execution status + +## How to Use This Document + +Use this trace matrix to: + +- Verify that all requirements have associated tests +- Identify which tests verify each requirement +- Assess test coverage across the requirement set +- Plan testing activities when requirements change diff --git a/docs/tracematrix/title.txt b/docs/tracematrix/title.txt new file mode 100644 index 0000000..8e3398f --- /dev/null +++ b/docs/tracematrix/title.txt @@ -0,0 +1,12 @@ +--- +title: ReqStream Trace Matrix +subtitle: Test Traceability Matrix for the ReqStream Tool +lang: en-US +keywords: + - ReqStream + - Trace Matrix + - Traceability + - Testing + - .NET + - Command-Line Tool +--- diff --git a/requirements.yaml b/requirements.yaml new file mode 100644 index 0000000..4844d5c --- /dev/null +++ b/requirements.yaml @@ -0,0 +1,189 @@ +--- +sections: + - title: "ReqStream Requirements" + sections: + - title: "Command-Line Interface" + requirements: + - id: "CLI-001" + title: "The tool shall provide a command-line interface." + tests: + - "Create_NoArguments_ReturnsDefaultContext" + - "Create_MultipleArguments_ParsesAllCorrectly" + + - id: "CLI-002" + title: "The tool shall display version information when requested." + tests: + - "Run_WithVersionFlag_PrintsVersion" + - "Create_VersionFlag_SetsVersionProperty" + + - id: "CLI-003" + title: "The tool shall display help information when requested." + tests: + - "Run_WithHelpFlag_PrintsHelp" + - "Create_HelpFlags_SetsHelpProperty" + + - title: "Requirements File Processing" + requirements: + - id: "REQ-001" + title: "The tool shall process YAML requirements files." + tests: + - "Read_SimpleRequirement_ParsesCorrectly" + - "Run_WithRequirementsFiles_ProcessesSuccessfully" + - "Read_ComplexStructure_ParsesCorrectly" + + - id: "REQ-002" + title: "The tool shall support glob patterns for requirements files." + tests: + - "Create_WithRequirementsPattern_ExpandsGlobPattern" + + - id: "REQ-003" + title: "The tool shall validate requirements file structure." + tests: + - "Read_BlankSectionTitle_ThrowsExceptionWithFileLocation" + - "Read_BlankRequirementId_ThrowsExceptionWithFileLocation" + - "Read_BlankRequirementTitle_ThrowsExceptionWithFileLocation" + - "Read_DuplicateRequirementId_ThrowsException" + - "Read_DuplicateRequirementId_ExceptionIncludesFileLocation" + + - id: "REQ-004" + title: "The tool shall support hierarchical sections and subsections." + tests: + - "Read_NestedSections_ParsesHierarchyCorrectly" + - "Export_NestedSections_CreatesHierarchy" + + - id: "REQ-005" + title: "The tool shall support file includes in requirements files." + tests: + - "Read_WithIncludes_MergesFilesCorrectly" + - "Read_MultipleFiles_MergesAllFiles" + - "Read_IncludeLoop_DoesNotCauseInfiniteLoop" + + - id: "REQ-006" + title: "The tool shall merge sections with the same hierarchy path." + tests: + - "Read_IdenticalSections_MergesCorrectly" + - "Read_MultipleFilesWithSameSections_MergesSections" + + - title: "Requirements Definition" + requirements: + - id: "REQ-007" + title: "The tool shall require each requirement to have a unique identifier." + tests: + - "Read_DuplicateRequirementId_ThrowsException" + - "Read_BlankRequirementId_ThrowsExceptionWithFileLocation" + - "Read_MultipleFilesWithDuplicateIds_ThrowsException" + + - id: "REQ-008" + title: "The tool shall require each requirement to have a title." + tests: + - "Read_BlankRequirementTitle_ThrowsExceptionWithFileLocation" + + - id: "REQ-009" + title: "The tool shall support parent-child relationships between requirements." + tests: + - "Read_RequirementWithChildren_ParsesChildrenCorrectly" + - "Export_WithChildRequirements_ConsidersChildTests" + + - id: "REQ-010" + title: "The tool shall support test mappings for requirements." + tests: + - "Read_RequirementWithTests_ParsesTestsCorrectly" + - "Read_BlankTestNameInRequirement_ThrowsExceptionWithFileLocation" + - "Read_TestMappings_AppliesMappingsCorrectly" + - "Read_BlankTestNameInMapping_ThrowsExceptionWithFileLocation" + - "Read_BlankMappingId_ThrowsExceptionWithFileLocation" + + - title: "Test Integration" + requirements: + - id: "TEST-001" + title: "The tool shall support processing test result files." + tests: + - "TraceMatrix_WithNoFiles_CreatesEmptyMatrix" + - "TraceMatrix_MissingFile_ThrowsFileNotFoundException" + - "TraceMatrix_WithMultipleFiles_AggregatesResults" + + - id: "TEST-002" + title: "The tool shall support TRX format test results." + tests: + - "TraceMatrix_WithTrxFile_ParsesCorrectly" + - "TraceMatrix_WithFailedTests_TracksFailures" + + - id: "TEST-003" + title: "The tool shall support JUnit format test results." + tests: + - "TraceMatrix_WithJUnitFile_ParsesCorrectly" + - "TraceMatrix_WithJUnitFailedTests_TracksFailures" + + - id: "TEST-004" + title: "The tool shall support glob patterns for test result files." + tests: + - "Create_WithTestsPattern_ExpandsGlobPattern" + - "TraceMatrix_WithMixedFormats_ProcessesBoth" + + - title: "Reporting" + requirements: + - id: "RPT-001" + title: "The tool shall export requirements to markdown format." + tests: + - "Run_WithRequirementsExport_GeneratesReport" + - "Export_SimpleRequirements_CreatesMarkdownFile" + - "Export_MultipleSections_ExportsAll" + - "Export_EmptyRequirements_CreatesEmptyFile" + + - id: "RPT-002" + title: "The tool shall support configurable markdown header depth for requirements reports." + tests: + - "Create_ReportDepth_SetsReportDepthProperty" + - "Export_WithCustomDepth_UsesCorrectHeaderLevel" + + - id: "RPT-003" + title: "The tool shall export trace matrices to markdown format." + tests: + - "Run_WithTraceMatrixExport_GeneratesMatrix" + - "Export_SimpleTraceMatrix_CreatesMarkdownFile" + - "Export_WithFailedTests_ShowsFailures" + - "Export_WithNoTests_ShowsNotSatisfied" + - "Export_WithNotExecutedTests_ShowsNotExecuted" + + - id: "RPT-004" + title: "The tool shall support configurable markdown header depth for trace matrices." + tests: + - "Create_MatrixDepth_SetsMatrixDepthProperty" + - "Export_WithCustomDepth_UsesCorrectHeaderLevel" + + - title: "Logging" + requirements: + - id: "LOG-001" + title: "The tool shall support writing output to a log file." + tests: + - "Create_WithLogFile_WritesToLogFile" + - "Create_WithLogFileAndSilent_WritesToLogOnly" + - "Dispose_WithLogFile_ClosesLogFile" + + - title: "Validation" + requirements: + - id: "VAL-001" + title: "The tool shall support self-validation mode." + tests: + - "Run_WithValidateFlag_ShowsPlaceholder" + - "Create_ValidateFlag_SetsValidateProperty" + + - title: "Platform Support" + requirements: + - id: "PLT-001" + title: "The tool shall run on Windows operating systems." + + - id: "PLT-002" + title: "The tool shall run on Linux operating systems." + + - id: "PLT-003" + title: "The tool shall run on macOS operating systems." + + - id: "PLT-004" + title: "The tool shall support .NET 8.0 runtime." + + - id: "PLT-005" + title: "The tool shall support .NET 9.0 runtime." + + - id: "PLT-006" + title: "The tool shall support .NET 10.0 runtime."