Skip to content

Latest commit

 

History

History
41 lines (34 loc) · 2.12 KB

File metadata and controls

41 lines (34 loc) · 2.12 KB

example-java

coverage badge complexity badge

A small, idiomatic Java gradebook library used as the Java reference example for Coverage Tracker. It exists to give the Java row in the coverage report generation guide a live, working reference, and to populate the demo dashboard with real trend data.

This is a demo/marketing repo, not a test suite for Coverage Tracker itself.

What's here

  • Grade.java — maps a numeric score to a letter grade band (A–F).
  • GpaPoints.java — converts a letter grade, with an optional +/- modifier, to 4.0-scale GPA points.
  • Student.java — a transcript of credit-hour-weighted course results, GPA, and honor-roll status.
  • Roster.java — aggregate stats (average/median GPA, top student, honor roll count) across a group of students.
  • Each class has unit tests, but some real branches are deliberately left untested — the D grade band and out-of-range score checks in Grade, the descriptive label() method, the MINUS GPA modifier, and the invalid-input guard clauses in Student/Roster — landing at ~85% line / ~71% branch coverage, so branch_coverage < line_coverage is visible on the dashboard.
  • .github/workflows/coverage.yml — runs tests under JaCoCo via Maven, then reports to the demo instance via the coverage-tracker reporting Action. No separate complexity step is needed — JaCoCo's COMPLEXITY counter gives cyclomatic complexity for free.

Running locally

mvn test jacoco:report   # writes target/site/jacoco/jacoco.xml