Skip to content

research(bench): add javac compilation step to Java fixture for javacg-static comparison #1307

@carlos-alm

Description

@carlos-alm

Context

The Jelly comparison document (PR #1304, issue #1301) intended to include a Java call graph comparison using "ACG", but the linked tool (github.com/maccioni/acg) is actually a JavaScript adaptive call graph library — not a Java tool.

For Java, established static call graph tools (WALA, Soot, javacg-static) all require compiled bytecode (.class files or JARs), not raw .java source. The current Java fixture contains only source files with no build system.

Current codegraph Java metrics on the fixture:

  • Precision: 100%, Recall: 53% (9/17 edges)
  • Missed: same-file (0/2), static (0/2), class-inheritance (0/3)

What's needed

  1. Add a Makefile or build.sh to tests/benchmarks/resolution/fixtures/java/ that compiles the fixture with javac and produces a JAR
  2. Add a scripts/compare-javacg.mjs (mirrors compare-jelly.mjs) that:
    • Runs javacg-static (github.com/gousiosg/java-callgraph) on the compiled JAR
    • Parses its output format (M:ClassName:method(args)(I)OtherClass:method)
    • Maps to the source/target name format used in expected-edges.json
    • Computes precision/recall vs the ground truth
  3. Update docs/benchmarks/RESOLUTION-COMPARISON.md with the Java comparison table

Tool choice rationale

javacg-static is the lightest-weight option: it's a single JAR, reads any compiled JAR, and outputs a simple text call graph. WALA and Soot are heavier and require more setup.

Expected impact

Validates (or challenges) codegraph's 53% Java recall claim with an independent tool. javacg-static uses CHA, so it should handle class-inheritance and interface-dispatched edges that codegraph currently misses.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions