Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/agents/test-developer.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,32 @@ public void ClassName_MethodUnderTest_Scenario_ExpectedBehavior()
- Clear failure messages for assertions
- Consider edge cases and error conditions

### Tests and Requirements

- **All requirements MUST have linked tests** - this is enforced in CI
- **Not all tests need requirements** - tests may be created for:
- Exploring corner cases not explicitly stated in requirements
- Testing design decisions and implementation details
- Failure-testing and error handling scenarios
- Verifying internal behavior beyond requirement scope

### Test Source Filters

Test links in `requirements.yaml` can include a source filter prefix to restrict which test results count as
evidence. These filters are critical for platform and framework requirements - **do not remove them**.

- `windows@TestName` - proves the test passed on a Windows platform
- `ubuntu@TestName` - proves the test passed on a Linux (Ubuntu) platform
- `net8.0@TestName` - proves the test passed under the .NET 8 target framework
- `net9.0@TestName` - proves the test passed under the .NET 9 target framework
- `net10.0@TestName` - proves the test passed under the .NET 10 target framework
- `dotnet8.x@TestName` - proves the self-validation test ran on a machine with .NET 8.x runtime
- `dotnet9.x@TestName` - proves the self-validation test ran on a machine with .NET 9.x runtime
- `dotnet10.x@TestName` - proves the self-validation test ran on a machine with .NET 10.x runtime

Removing a source filter means a test result from any environment can satisfy the requirement, which invalidates
the evidence-based proof that the tool works on a specific platform or framework.

### SpdxTool-Specific

- **NOT self-validation tests** - those are handled by Software Developer Agent
Expand Down Expand Up @@ -97,8 +123,18 @@ Common anti-patterns to avoid (not exhaustive):
// ✅ Good: Assert.HasCount(3, collection);
```

5. **Avoid Assert.IsTrue for string prefix checks** - Use `Assert.StartsWith` instead of wrapping
`string.StartsWith` in `Assert.IsTrue`, as it produces clearer failure messages that show the expected prefix
and actual value:

```csharp
// ❌ Bad: Assert.IsTrue(value.StartsWith("prefix"));
// ✅ Good: Assert.StartsWith("prefix", value);
```

## Defer To

- **Requirements Agent**: For test strategy and coverage requirements
- **Software Developer Agent**: For self-validation tests and production code issues
- **Technical Writer Agent**: For test documentation in markdown
- **Code Quality Agent**: For test linting and static analysis
Expand Down
19 changes: 17 additions & 2 deletions src/DemaConsulting.SpdxTool/DemaConsulting.SpdxTool.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
<LangVersion>12</LangVersion>
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

Expand Down Expand Up @@ -46,11 +46,27 @@
<SBOMPackageSupplier>Organization: $(Company)</SBOMPackageSupplier>
</PropertyGroup>

<!-- Runtime Dependencies -->
<ItemGroup>
<PackageReference Include="DemaConsulting.SpdxModel" Version="2.5.0" />
<PackageReference Include="DemaConsulting.TestResults" Version="1.5.0" />
<PackageReference Include="YamlDotNet" Version="16.3.0" />
</ItemGroup>

<!-- Build Tool Dependencies -->
<ItemGroup>
<PackageReference Include="Microsoft.Sbom.Targets" Version="4.1.5" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="10.0.103" PrivateAssets="All" />
<PackageReference Include="Polyfill" Version="9.12.0" PrivateAssets="All" />
</ItemGroup>

<!-- Code Analysis Dependencies -->
<ItemGroup>
<!-- Analyzer packages use child-element form to configure both PrivateAssets and IncludeAssets:
- PrivateAssets="all" prevents these build-time analyzers from becoming transitive dependencies
in packages that consume this tool.
- IncludeAssets lists all asset types (including 'analyzers' and 'buildtransitive') to ensure
Roslyn analyzers and MSBuild targets are fully activated during the build. -->
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="10.0.103">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand All @@ -59,7 +75,6 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="YamlDotNet" Version="16.3.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@
</PackageReference>
</ItemGroup>

<!-- Implicit Usings -->
<ItemGroup>
<Using Include="Microsoft.VisualStudio.TestTools.UnitTesting" />
<Using Include="Polyfills" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@
</ProjectReference>
</ItemGroup>

<!-- Implicit Usings -->
<ItemGroup>
<Using Include="Microsoft.VisualStudio.TestTools.UnitTesting" />
<Using Include="Polyfills" />
</ItemGroup>

</Project>
Loading