Skip to content

Latest commit

 

History

History
101 lines (76 loc) · 3.31 KB

File metadata and controls

101 lines (76 loc) · 3.31 KB

Testing Strategy

This repo keeps the current test style (JUnit 6 + jqwik + suite-based grouping). The goal is clarity and reproducibility rather than framework churn.

1) Unit / Smoke

  • Every solved task has direct tests in src/test/java/<package>.
  • The smoke suite groups these checks for a fast, deterministic review signal.
  • Run:
mvn -B test -Dgroups='smoke'
mvn -B test -Dtest='quality.SmokeSuite'

2) Integration

  • Transaction state and ordering behavior is covered in transactions.InMemoryValidationServiceTest.
  • The integration suite runs this group in CI and locally.
  • Run:
mvn -B test -Dgroups='integration'
mvn -B test -Dtest='quality.IntegrationSuite'

3) Property-based

  • Property tests use jqwik for invariants and edge-case generation.
  • This repository groups the current property-focused tests in quality.PropertySuite.
  • jqwik reporting is configured in src/test/resources/junit-platform.properties to keep successful CI logs compact while preserving failure diagnostics.
  • Maven Surefire redirects test stdout to per-test files so CI logs show results, not framework chatter.
  • Run:
mvn -B test -Dgroups='property'
mvn -B test -Dtest='quality.PropertySuite'

4) Static quality gates

  • Static checks are split into two layers:

    • lightweight maven verify run in CI categories/branch matrix;
    • dedicated static-only gates in .github/workflows/quality.yml:
      • Checkstyle
      • PMD
      • SpotBugs
  • The static workflow does not run tests and provides standalone artifacts for static tooling review.

  • Checkstyle, PMD and SpotBugs are expected to stay at zero reported findings in the current baseline.

  • All three static tools are enforced: violations fail the Maven build.

  • Checkstyle uses config/checkstyle/checkstyle.xml; generated smoke wrappers are documented in config/checkstyle/suppressions.xml.

  • SpotBugs compatibility exceptions are explicit in config/spotbugs-exclude.xml.

5) Additional quality checks (full build)

  • Full verification includes tests, JaCoCo reporting/checks and static tools.
  • Current enforced JaCoCo minimums:
    • line coverage: 70%
    • branch coverage: 70%
    • instruction coverage: 70%
  • Current verified local baseline: 594 tests. Coverage is enforced by the ratios above; the generated HTML/XML report under target/site/jacoco is the source of exact values.
  • Run:
mvn -B verify

Offline gate (PowerShell)

The repository also provides a network-free local gate:

.\scripts\run-offline-gate.ps1
.\scripts\run-offline-gate.ps1 -Goal test
.\scripts\run-offline-gate.ps1 -StrictDependencies

The script always passes Maven --offline. By default, when the exact JUnit BOM from pom.xml is not present locally, it warns and uses the newest cached release from the same major line for validation. -StrictDependencies disables that fallback and fails unless the exact dependency set is already cached.

  • CI uploads target/surefire-reports and target/site/jacoco.

6) CI matrix

  • Category workflow: smoke/integration/property tags (JDK 21)
  • Full verify workflow: JDK 17 and 21
  • Strict offline PowerShell gate: Windows, JDK 21 (after an explicit cache-prime step)
  • Static workflow: static checks only (JDK 21)

7) UI category status

  • UI tests: N/A for this repository (no UI module).