JacoDB-based utility for extracting graphs from Java programs for CFPQ-based analyses.
To extract graphs used to evaluate CFPQ_PyAlgo, execute the following command in the project root.
./gradlew runAfter the gradle task completes, open the CFPQ_JavaMiner/graph folder, where you will find:
- extracted graphs in the format recognizable by optimized CFPQ_PyAlgo;
- mapping files needed to convert vertex, label, and type IDs back to the Java code elements they originated from (fields, expressions, types, etc.);
- type and supertype data for every vertex that can be used for type-aware analyses (experimental, subject to change).
As of now, CFPQ_JavaGraphMiner only supports extracting graphs for field-sensitive, context-insensitive points-to analysis with dynamic dispatch, but without reflection.
These graphs are intended to be used with this grammar.
The high-level pipeline is as follows:
- JacoDB converts JVM bytecode to three-address instructions (
JcInst). PtResolverconverts three-address instructions (JcInst) to a points-to graph model (PtModel).- Optional step:
PtSimplifiersimplifies the points-to graph model (PtModel) by eliminating someassignedges. IdGeneratoris used to assign identifiers to points-to graph model (PtModel) entities (i.e., create mappings).GraphMinerencodes the points-to graph model (PtModel) using these mappings and saves the encoded model and mappings.
The graph miner is covered with integration tests that:
- collect graphs for sample programs;
- simplify these graphs to remove implementation-dependent vertices;
- assert the equality of simplified graphs and manually verified ground-truth graphs;
To run tests, execute the following command in the project root.
./gradlew test- Kotlin
- JacoDB
- JUnit 5
- Gradle