Skip to content

Simplify TraceMatrix by removing TestResultEntry and using TestMetrics throughout#96

Merged
Malcolmnixon merged 11 commits intomainfrom
copilot/simplify-trace-matrix
Feb 8, 2026
Merged

Simplify TraceMatrix by removing TestResultEntry and using TestMetrics throughout#96
Malcolmnixon merged 11 commits intomainfrom
copilot/simplify-trace-matrix

Conversation

Copy link
Contributor

Copilot AI commented Feb 8, 2026

Simplify Trace Matrix Implementation

Implementation Complete ✓

  • Remove TestResultEntry class - use TestMetrics directly
  • Add helper properties to TestMetrics (Executed, AllPassed)
  • Change GetTestResult to return TestMetrics (not nullable)
  • Return TestMetrics(0, 0) instead of null for not-found tests
  • Update GetAllTestResults to filter out tests with 0 executions
  • Update all test files to use new API
  • All 117 tests passing
  • Update architecture documentation
  • Code review completed
  • Security check passed
  • Quality lint issues fixed
  • Use Serializer.Deserialize for automatic format detection

Quality Checks ✓

  • ✅ Markdown linting: 0 errors
  • ✅ Spell checking: 0 issues
  • ✅ YAML linting: 0 errors
  • ✅ Build: 0 warnings, 0 errors
  • ✅ Tests: 117/117 passing

Final Design

TestMetrics - Single unified type for test metrics:

  • Passes - number of passing executions
  • Fails - number of failing executions
  • Executed - computed property (Passes + Fails)
  • AllPassed - computed property (Fails == 0 && Executed > 0)

API Changes:

  • GetTestResult(string testName) returns TestMetrics (not nullable)
  • Returns TestMetrics(0, 0) if test not found (simpler than null checks)
  • GetAllTestResults() returns IReadOnlyDictionary<string, TestMetrics>
  • Filters to only include tests with Executed > 0

Test Result Parsing:

  • Uses Serializer.Deserialize() from DemaConsulting.TestResults library
  • Automatically detects TRX or JUnit format
  • Simpler and cleaner than manual try/catch with multiple deserializers

All quality checks passing. Ready for merge.

Original prompt

This section details on the original issue you should resolve

<issue_title>[Feature]: Simplify Trace Matrix</issue_title>
<issue_description>### Problem Statement

The Trace Matrix logic is a little convoluted.

Proposed Solution

The TraceMatrix needs to provide the following capabilities:

  • Export documentation showing for each requirement the test metrics (linked, passed, failed, not-executed)
  • Export documentation showing for each test the requirement and metrics (passed, failed)
  • Provide the list of unsatisfied requirements

It should satisfy these capabilities in the clearest and most concise way - with a design so obvious that its correct behavior is immediately obvious. Firstly we can recognize some basic facts:

  • Every requirement ID is unique
  • Any TestOutcome that is not 'IsExecuted' should be ignored
  • The combination of TestFileBaseName and TestResult.Name may not be unique because they may come from different TestResult.ClassName, but these duplicate results can be collapsed to a single record counting the passes and fails.

The implementation should therefore be to create a record of TestExecution consisting of:

  • FileNameBase (the base name of the test file)
  • Name (the test name)
  • Passes (number of passes in the file matching the test name)
  • Fails (number of fails in the file matching the test name)

For fast access it's possible to assemble a Dictionary[TestName,List[TestExecution]]. This then becomes exceedingly easy to process - a simple FindTestExecutions method given the test name (with or without test source filter) can be:

  1. Split into test source and test name
  2. Look up the test name in the dictionary
  3. Iterate through the list of TestExecution gathering those tests matching the test source

The three core capabilities can be built on top of this core FindTestExecutions functionality.

Alternatives Considered

No response

Usage Examples

Benefits

Exceedingly easy processing, and using a dictionary by test name should improve performance. In almost all projects the number of unique tests is far larger than the number of test files, so the implementation optimizes in the important area.

Priority

Medium - Would improve my workflow

Willingness to Contribute

Yes, I can submit a pull request

Additional Context

Remember to update the architecture.

Checklist

  • I have searched existing issues to ensure this is not a duplicate
  • I have provided a clear description of the feature
  • I have explained why this feature would be useful</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits February 8, 2026 16:18
Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Copilot AI changed the title [WIP] Simplify Trace Matrix logic for clearer documentation Simplify TraceMatrix with TestExecution record pattern Feb 8, 2026
Copilot AI requested a review from Malcolmnixon February 8, 2026 16:22
Copilot AI and others added 2 commits February 8, 2026 16:34
Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Copilot AI changed the title Simplify TraceMatrix with TestExecution record pattern Simplify TraceMatrix with TestExecution record pattern and capture all tests Feb 8, 2026
Copilot AI requested a review from Malcolmnixon February 8, 2026 16:36
Copilot AI and others added 2 commits February 8, 2026 16:41
Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
…x.cs

Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Copilot AI changed the title Simplify TraceMatrix with TestExecution record pattern and capture all tests Simplify TraceMatrix with TestExecution record pattern and TestMetrics Feb 8, 2026
Copilot AI requested a review from Malcolmnixon February 8, 2026 16:44
@Malcolmnixon
Copy link
Contributor

@copilot Can you fix my recent comments

…ify API

Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 8, 2026

@copilot Can you fix my recent comments

All comments addressed. Test Human updated and architecture documentation updated. All 117 tests pass. (f84c352)

Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Copilot AI changed the title Simplify TraceMatrix with TestExecution record pattern and TestMetrics Simplify TraceMatrix by removing TestResultEntry and using TestMetrics throughout Feb 8, 2026
@Malcolmnixon
Copy link
Contributor

@copilot Please fix quality lint issues

Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 8, 2026

@copilot Please fix quality lint issues

Fixed. Resolved 7 markdown linting errors in ARCHITECTURE.md (MD036: changed bold text to headings, MD032: added blank lines around lists). All quality checks now pass: ✅ Markdown lint (0 errors) ✅ Spell check (0 issues) ✅ YAML lint (0 errors). (6de6811)

Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Copilot AI requested a review from Malcolmnixon February 8, 2026 17:48
@Malcolmnixon Malcolmnixon marked this pull request as ready for review February 8, 2026 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Simplify Trace Matrix

2 participants