Skip to content

Improve test coverage#137

Merged
ctmay4 merged 5 commits into
masterfrom
feature/improve-coverage
Jul 21, 2026
Merged

Improve test coverage#137
ctmay4 merged 5 commits into
masterfrom
feature/improve-coverage

Conversation

@ctmay4

@ctmay4 ctmay4 commented Jul 21, 2026

Copy link
Copy Markdown
Member

Summary

Improve test coverage across the staging APIs, decision engine, data providers, and algorithm-specific data wrappers. Add enforceable coverage thresholds and separate the slow CS comparison suite from regular builds.

Changes

Expanded test coverage

  • Add coverage for public Staging.getInputs and getOutputs APIs:
    • Table paths and mappings
    • Input/output mappings
    • Inclusion and exclusion contexts
    • Excluded inputs
    • Context-key removal
    • Explicit and inferred schema outputs
  • Expand SchemaLookup tests:
    • Site and histology mutation
    • Equality and hash-code contracts
    • Allowed-key validation
    • Clearing inputs
    • Discriminator edge cases
  • Add contract tests for CS, TNM, and EOD staging data:
    • Constructors
    • Typed input/output accessors
    • SSF boundaries and validation
    • Builder methods
    • EOD discriminators
  • Add meaningful DecisionEngine branch scenarios:
    • Missing and malformed data
    • Mapping inclusion and exclusion
    • Defaults and validation
    • Null table paths and mappings
    • Input/output key interactions
  • Expand provider coverage:
    • In-memory provider contracts and unsupported glossary operations
    • Missing tables and schemas
    • Valid-value range expansion and zero padding
    • Invalid table input definitions
    • External glossary loading and matching
    • Malformed and inconsistent algorithm ZIP files

Coverage enforcement

  • Upgrade JaCoCo from 0.8.12 to 0.8.15 for Java 25 compatibility.
  • Add bundle-level coverage checks during Maven verify:
    • Minimum line coverage: 95%
    • Minimum branch coverage: 89%
  • Upload the generated JaCoCo report as a GitHub Actions artifact.

Current coverage:

Metric Coverage
Lines 97.70%
Branches 92.31%
Methods 98.96%
Instructions 97.71%

CS comparison separation

  • Move the slow manual CS comparison into a dedicated source set:
    • src/cs-comparison/java
    • src/cs-comparison/resources
  • Rename the runner to CsComparisonRunner.
  • Add a disabled-by-default cs-comparison Maven profile.
  • Pin the supporting Maven plugins:
    • build-helper-maven-plugin 3.6.1
    • exec-maven-plugin 3.6.3
  • Make comparison mismatches fail the Maven execution instead of only being logged.
  • Update the manual workflow to run:
./mvnw -B -Pcs-comparison verify

Regular builds no longer compile the comparison runner or copy its 115 large resource files.

@sonarqubecloud

Copy link
Copy Markdown

@ctmay4
ctmay4 merged commit 9ecd07f into master Jul 21, 2026
4 checks passed
@ctmay4
ctmay4 deleted the feature/improve-coverage branch July 21, 2026 23:33
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.

1 participant