|
1 |
| -# CFPQ_JavaGraphMiner |
2 |
| -Java graph mainer |
| 1 | +## CFPQ_JavaGraphMiner |
| 2 | + |
| 3 | +JacoDB-based utility for extracting graphs from Java programs for CFPQ-based analyses. |
| 4 | + |
| 5 | +## Usage |
| 6 | + |
| 7 | +To extract graphs used to [evaluate CFPQ_PyAlgo](https://github.com/FormalLanguageConstrainedPathQuerying/CFPQ_PyAlgo/tree/murav/optimize-matrix/cfpq_eval) |
| 8 | +execute the following command in the project root. |
| 9 | +```bash |
| 10 | +./gradlew run |
| 11 | +``` |
| 12 | + |
| 13 | +After gradle task completes, open `CFPQ_JavaMiner/graph` folder, where you will find: |
| 14 | +* extracted graphs in the format recognizable by [optimized CFPQ_PyAlgo](https://github.com/FormalLanguageConstrainedPathQuerying/CFPQ_PyAlgo/tree/murav/optimize-matrix) |
| 15 | +* mapping files needed to convert vertex, label and type ids back to Java elements they originated from (fields, expressions, types, etc.) |
| 16 | +* type and super type data for every vertex that can be used for type-aware analyses (experimental, subject to change) |
| 17 | + |
| 18 | +## Supported analyses |
| 19 | + |
| 20 | +As of now `CFPQ_JavaGraphMiner` only supports extracting graphs for: |
| 21 | +* field-sensitive context-insensitive points-to analysis with dynamic dispatch, but without reflection |
| 22 | + * these graphs are intended to be used with [this grammar](https://formallanguageconstrainedpathquerying.github.io/CFPQ_Data/grammars/data/java_points_to.html#java-points-to) |
| 23 | + |
| 24 | +## Implementation overview |
| 25 | + |
| 26 | +The high-level pipeline is as follows: |
| 27 | +* [JacoDB](https://jacodb.org/) converts JVM-bytecode to three-address instruction (`JcInst`) |
| 28 | +* `PtResolver` converts three-address instruction (`JcInst`) to points-to graph model (`PtModel`) |
| 29 | +* **optional step**: `PtSimplifier` simplifies points-to graph model (`PtModel`) by eliminating some `assign` edges |
| 30 | +* `IdGenerator` is used to assign identifiers to points-to graph model (`PtModel`) entities (i.e. create mappings) |
| 31 | +* `GraphMiner` encodes points-to graph model (`PtModel`) using these mappings and saves encoded model and mappings |
| 32 | + |
| 33 | +## Tests |
| 34 | + |
| 35 | +Graph miner is covered with integration tests that: |
| 36 | +* collect graphs for sample programs |
| 37 | +* simplify these graphs to remove implementation dependent vertices |
| 38 | +* assert equality of simplified graphs and manually verified ground-truth graphs |
| 39 | + |
| 40 | +To run tests execute the following command in the project root. |
| 41 | +```bash |
| 42 | +./gradlew test |
| 43 | +``` |
| 44 | + |
| 45 | +## Technologies |
| 46 | + |
| 47 | +* Kotlin |
| 48 | +* JacoDB |
| 49 | +* JUnit 5 |
| 50 | +* Gradle |
0 commit comments