Skip to content

test(stjm): close the remaining core branch coverage gap #249

Description

@egil

Follow-up to #208 and merged #223.

The typed migration dispatch work is complete, but the repository's requirement for 100% branch coverage in core components is still not met. Aggregate coverage above 95% does not satisfy that requirement. Merging #223 did not establish a coverage-policy exception.

The last verified snapshot was aafe5a1714b01cc5e388887119a8276bff728f15, merged by #223:

Framework Covered production branches Branch coverage
.NET 10 654/671 97.47%
.NET 11 904/919 98.37%

MigratorReference.Typed.cs, MigratorInvokerFactory.cs, and JsonMigratableTypes reached 100% on both frameworks. UnionCaseRouting.cs reached 100% on .NET 11. The remaining uncovered branches were:

Component .NET 10 .NET 11
ExternalMigratorInvoker.cs 2 2
JsonMigratableConverter.cs 1 1
JsonMigratableConverter.NonObjectMatching.cs 9 9
JsonMigrationTypeInfoResolver.cs 1 0
MigratorReference.cs 1 1
ResolverLeaves.cs 2 1
SourceValueShape.cs 1 1

These include defensive reader checks, type-name and reflection fallbacks, and guards following earlier validation. Reachability needs to be established before deciding how to cover or simplify them.

Work

  • Rebaseline coverage against current origin/main on .NET 10 and .NET 11, recording the exact commit and per-component branch counts.
  • Classify each remaining uncovered core branch: reachable behavior, redundant/unreachable defensive code, or a runtime/configuration-dependent fallback.
  • Add meaningful tests through supported public entry points for reachable behavior. Exercise runtime-dependent behavior with the relevant real configuration where feasible.
  • For redundant branches, consider a focused, behavior-preserving cleanup with evidence that the protected behavior remains covered.
  • Do not manufacture private framework state or exclude code merely to reach a percentage. Any justified exception or policy change requires explicit owner approval.

Acceptance

  • Fresh coverage evidence identifies the exact commit and branch counts for each core component on both frameworks.
  • Every remaining uncovered core branch has an explicit disposition supported by evidence.
  • Core components reach 100% branch coverage, or the owner explicitly approves and documents a narrowly scoped exception or policy change for the remaining gap.
  • The existing minimum of 95% branch coverage for other production code remains satisfied.
  • Release builds are warning-free and the relevant tests pass on both frameworks.

Keep evidence in CI artifacts or the issue. Do not reintroduce the issue-208 development performance reports. Discriminator lookup changes and a general performance-documentation refresh are outside this issue's scope.

Activity

  1. added
    stjmEgil.SystemTextJson.Migration scope
    on Sep 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stjmEgil.SystemTextJson.Migration scope

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions