Skip to content

Remove observable-behavior violations from tests - #151

Merged
Malcolmnixon merged 2 commits into
mainfrom
test-standard-cleanup
Nov 21, 2026
Merged

Malcolmnixon merged 2 commits into
mainfrom
test-standard-cleanup

Conversation

@Malcolmnixon

Copy link
Copy Markdown
Member

Pull Request

Description

Removes test-standard violations ("Assert Observable Behavior") from the test projects.

  • StdlibProviderTests: removed the 50 ms Stopwatch assertion; added GetSymbolTable_RepeatedCalls_ReturnSameDiagnostics (caching through the public API). The wall-clock "Performance" requirement was removed (the Caching requirement stays; caching is described in the design docs).
  • WorkspaceLoaderTests: removed the Task.WhenAny/10 s timeout (plain await, assert result); removed the reflection signature tripwire and the reflected invoke of the two-parameter overload (the direct call is kept).
  • AstSerializerTests: removed the reflection DeclaringType tripwire.
  • GeneralViewLayoutStrategyTests: replaced the two reflection tests of the private DecorateTruncated with public BuildLayout tests (TruncatedBoxBesideRoutedEdge_DecoratesOnlyTruncatedBox, TruncatedNestedPackages_DecorateOnlyMatchingBoxes). Removed the four reflection tests of the private ClearEndDecorations post-pass; they cannot be reached deterministically through the public API, and the public EndDecorationsHaveCleanApproach tests (including the gallery views) remain.
  • Updated docs/reqstream and docs/verification for the renamed and removed tests.
  • PublicApiAnalyzers was not added (it would need Shipped/Unshipped files for all library projects); the tripwires were removed instead.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code quality improvement

Related Issues

None.

Pre-Submission Checklist

Build and Test

  • Code builds successfully and all tests pass: pwsh ./build.ps1
  • Code produces zero warnings

Code Quality

  • New code has appropriate XML documentation comments
  • Static analyzer warnings have been addressed

Quality Checks

  • All linters pass: pwsh ./lint.ps1

Testing

  • Added unit tests for new functionality
  • Updated existing tests if behavior changed
  • All tests follow the AAA (Arrange, Act, Assert) pattern
  • Test coverage is maintained or improved (the removed private-method tests reduce direct coverage of ClearEndDecorations)

Documentation

  • Updated README.md (if applicable)
  • Updated docs/ documentation (if applicable)
  • Added code examples for new features (if applicable)
  • Updated requirements.yaml (if applicable)

Additional Notes

Borderline items left unchanged: ResxResourceTests (reflection over public accessor properties and embedded resources only); InternalsVisibleTo for the Tests project (by design); tests that read output files produced by the tool or checked-in model/golden fixtures.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings November 21, 2026 12:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

An active moderate finding remains because the test does not verify the documented reference-caching contract for the diagnostics list.

1 open issue
What changed in this PR

This pull request removes timing-, reflection-, and private-implementation-based test assertions, replacing them with public API and observable layout behavior checks while updating related verification and requirement artifacts.

Changes:

  • Replaced timing and reflection tests with deterministic public behavior coverage.
  • Added repeated-call diagnostics coverage and public truncation layout tests.
  • Updated verification and ReqStream documentation for renamed and removed tests.
File Description
test/​DemaConsulting.SysML2Tools.Tests/​Semantic/​WorkspaceLoaderTests.cs Removes the load timeout and reflection-based overload checks while retaining direct overload behavior coverage.
test/​DemaConsulting.SysML2Tools.Tests/​Semantic/​StdlibProviderTests.cs Replaces the wall-clock caching assertion with repeated-call diagnostics coverage.
test/​DemaConsulting.SysML2Tools.Tests/​Semantic/​AstSerializerTests.cs Removes the reflection-based property declaration tripwire.
test/​DemaConsulting.SysML2Tools.Tests/​Layout/​GeneralViewLayoutStrategyTests.cs Replaces private-method reflection tests with public BuildLayout tests and removes private post-pass fixtures.
docs/​verification/​sysml2-tools-stdlib/​stdlib-provider.md Removes timing verification and documents repeated-call diagnostics coverage.
docs/​verification/​sysml2-tools-stdlib.md Updates standard-library verification evidence after removing the performance requirement.
docs/​verification/​sysml2-tools-language/​semantic/​workspace-loader.md Updates overload verification documentation after removing the reflection-based signature test.
docs/​verification/​sysml2-tools-language/​semantic/​model/​sysml-node.md Removes the property-declaration tripwire from the verification matrix.
docs/​verification/​sysml2-tools-core/​layout/​internal/​general-view-layout-strategy.md Updates truncation and end-decoration verification entries for the revised public tests.
docs/​reqstream/​sysml2-tools-stdlib/​stdlib-provider.yaml Replaces the timing-linked test with diagnostics caching coverage.
docs/​reqstream/​sysml2-tools-stdlib.yaml Removes the wall-clock performance requirement from the requirement hierarchy.
docs/​reqstream/​sysml2-tools-language/​semantic/​workspace-loader.yaml Removes the reflection-based signature test from requirement traceability.
docs/​reqstream/​sysml2-tools-language/​semantic/​model/​sysml-node.yaml Removes the property-declaration test from requirement traceability.
docs/​reqstream/​sysml2-tools-core/​layout/​internal/​general-view-layout-strategy.yaml Updates linked layout tests for the revised truncation coverage and removed private tests.

Review effort: Lite

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings November 21, 2026 13:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The change leaves binary-compatibility coverage incomplete and makes the verification documentation overstate the remaining evidence by retaining an outdated test count.

No open issues 🎉

2 previously missed issues

In code that hasn't changed since last review

Low severity Restore coverage for declared forwarding properties

docs/​verification/​sysml2-tools-language/​semantic/​model/​sysml-node.md:86

Removing this verification row leaves the requirement's binary-compatibility clause unverified: the remaining source-location and round-trip tests validate property values, but not that the getters remain declared on SysmlViewNode. The linked ReqStream requirement still explicitly promises forwarding properties declared on that type, so please retain an API-level check or revise the requirement and verification text together.

Low severity Correct the binary-compatibility test count

docs/​verification/​sysml2-tools-language/​semantic/​workspace-loader.md:76

This removal leaves the documentation claiming that binary compatibility is verified by two tests, but only the direct-call behavior test remains; the exact signature tripwire was removed. Please update the count so the verification document does not overstate the evidence.

1 resolved since last review

Review effort: Lite

@Malcolmnixon
Malcolmnixon merged commit 4a9e0bd into main Nov 21, 2026
10 checks passed
@Malcolmnixon
Malcolmnixon deleted the test-standard-cleanup branch November 21, 2026 13:34
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.

2 participants