ddf icon indicating copy to clipboard operation
ddf copied to clipboard

[TEST] Increase Test Coverage to 90%+ Across All Modules

Open montge opened this issue 2 months ago • 0 comments

Objective

Increase DDF unit test coverage to 90%+ overall, with individual modules, functions, interfaces, classes, and branches at 80%+ minimum.


Current State

Metric Current Target
Modules with tests 269 (49%) 500+ (90%)
Modules without tests 279 (51%) <50 (10%)
Coverage threshold 75% 90%
Branch coverage 75% 80%

JaCoCo Configuration:

  • Version: 0.8.12
  • Current thresholds: 75% instruction, 75% branch, 75% complexity
  • Halt on failure: enabled

Priority Modules Requiring Tests

Security Modules (HIGH PRIORITY)

Platform security is critical infrastructure. These modules need comprehensive coverage:

  • platform/security/filter/ - Security filters
  • platform/security/handler/ - Authentication handlers
  • platform/security/interceptor/ - CXF interceptors
  • platform/security/pdp/ - Policy Decision Point
  • platform/security/realm/ - Security realms

Catalog Core (HIGH PRIORITY)

Core catalog functionality:

  • catalog/core/catalog-core-standardframework/
  • catalog/core/catalog-core-api-impl/
  • catalog/plugin/ - All catalog plugins

Integration & Federation (MEDIUM PRIORITY)

  • catalog/opensearch/
  • catalog/spatial/
  • Federated source implementations

Implementation Plan

Phase 1: Infrastructure (Week 1)

  • [ ] Update JaCoCo thresholds to 80% minimum
  • [ ] Add coverage report aggregation
  • [ ] Create CI coverage gate

Phase 2: Security Module Tests (Weeks 2-4)

  • [ ] security-filter-* modules
  • [ ] security-handler-* modules
  • [ ] security-interceptor-* modules
  • [ ] security-pdp-* modules

Phase 3: Catalog Core Tests (Weeks 5-7)

  • [ ] catalog-core-* modules
  • [ ] catalog-plugin-* modules
  • [ ] catalog-transformer-* modules

Phase 4: Remaining Modules (Weeks 8-10)

  • [ ] platform/* remaining
  • [ ] libs/* modules
  • [ ] distribution/* tests

Acceptance Criteria

  • [ ] All modules with src/main/java have corresponding src/test/java
  • [ ] Overall project coverage ≥ 90%
  • [ ] Individual module coverage ≥ 80%
  • [ ] Branch coverage ≥ 80%
  • [ ] CI enforces coverage gates
  • [ ] No regressions in existing test suites

Technical Notes

Test Framework:

  • JUnit 4/5 with Mockito
  • Hamcrest matchers
  • Pax Exam for OSGi integration tests

Coverage Configuration:

<jacoco.instruction.covered.ratio>0.90</jacoco.instruction.covered.ratio>
<jacoco.branch.covered.ratio>0.80</jacoco.branch.covered.ratio>

Related Issues

  • #6936 - Commons-Collections upgrade (requires test updates)
  • #6935 - Spring Framework upgrade (requires test updates)

montge avatar Dec 06 '25 13:12 montge