Skip to content

changheng10000/java-jacoco-coverage-backfill

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java JaCoCo Coverage Backfill Skill

Universal skill for Codex and Claude Code to backfill Java test coverage using JaCoCo, focused on branch-quality improvement with guardrail metrics.

What This Skill Solves

  • Detects Maven/Gradle projects and report locations quickly.
  • Standardizes coverage analysis around CLASS, METHOD, LINE, BRANCH.
  • Prioritizes lowest BRANCH classes for targeted test design.
  • Supports iterative baseline/post snapshot comparison.
  • Works for single-module and multi-module Java repositories.

Repository Structure

java-jacoco-coverage-backfill/
├── install.sh
├── SKILL.md
├── scripts/
│   ├── detect_build_tool.sh
│   ├── generate_jacoco_report.sh
│   ├── find_jacoco_reports.sh
│   ├── analyze_jacoco_xml.py
│   └── compare_jacoco_snapshots.py
├── INSTALL.md
├── CONTRIBUTING.md
├── SECURITY.md
└── LICENSE

Requirements

  • Java project built by Maven or Gradle.
  • JaCoCo XML report generation enabled (jacoco.xml or jacocoTestReport.xml).
  • Python 3.9+ for analysis scripts.

Install (Codex + Claude Code)

See INSTALL.md for complete steps.

Quick one-command install to both tools:

./install.sh both

Install only for Claude Code:

./install.sh claude

Quick Usage

Run from this skill directory (or call with absolute paths):

scripts/detect_build_tool.sh <repo_or_module_path>
scripts/generate_jacoco_report.sh <repo_or_module_path>
scripts/find_jacoco_reports.sh <repo_or_module_path>
python3 scripts/analyze_jacoco_xml.py --xml <jacoco.xml> --top 10 --out .coverage/baseline.json
python3 scripts/compare_jacoco_snapshots.py --before .coverage/baseline.json --after .coverage/post.json

Recommended Workflow

  1. Generate baseline report and snapshot.
  2. Use jacoco_reporter_server + snapshot to choose the lowest BRANCH classes.
  3. Add targeted tests for missing branch directions.
  4. Regenerate report and compare snapshots.
  5. Repeat until threshold is met or blockers are documented.

Open Source

About

Universal Codex and Claude Code skill for Java JaCoCo coverage backfill with branch-first analysis, scriptable workflows, and snapshot diffing for Maven and Gradle projects.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors