This replication package include all the evaluation data and results in our work, and source code will be released upon the accpetance.
- python >= 3.9
- dependencies:
openai,langchain,spacy,srctoolkit,torch,transformers
Source files can be found in the folders named app.
llms.py: Define classes for different LLMs, including ChatGPT-series LLMs, Llama-3, and Gemma-2.prompts.py: Define different prompt variants used in our experiments.llm4leak.py: Define the mainLLM4Leakclass.cfg.py: Define theCFGclass.
The following figure presents the CFG correpsonding to the Fixed Version in Figure 1 in our paper.
- LLM Version Configuration
gpt-4: gpt-4-0613gpt-4-turbo: gpt-4-turbo-2024-04-09Llama-3-8B: Meta-Llama-3-8B-InstructGemma-2-9B: gemma-2-9b-it
- LLM Parameter Configuration
temperature = 0for avoiding randomness.max_tokens = 1024for limiting the numbers of generated tokens
Download datasets using this figshare link. Unzip the data.zip file, which includes the DroidLeaks dataset, JLeaks dataset, the 100 suspicious methods, and the 100 Apache Lucene methods. The statistics of resource distribution in two datasets are excerpted from their papers as follow.
The scripts used to evaluate InferROI are included in the script folder.
script/scan_droidleaks.py: Detect resource leaks for the DroidLeaks datasetscript/scan_jleaks.py: Detect resource leaks for the JLeaks datasetscript/scan_suspicious_100.py: Detect resource leaks for the 100 suspicious methodsscript/scan_lucene_100.py: Detect resource leaks for the 100 Apache Lucene methods
-
RQ1: The detection results for the DroidLeaks and JLeaks datasets can be found in
results/rq1/droidleaks.logandresults/rq1/jleaks.log. The detailed execution information of key steps is also included in the log files. -
RQ2:
- The detection results for the 100 suspicious open-source methods can be found in
results/rq2/suspicious-100.log. - the detection results for the 100 method sampled from Apache Lucene can be found in
results/rq2/lucene-100.log. - We submitted 12 pull requests, and 7 of them are confirmed by developers. The pull requests can be found in
results/rq2/PR.md.
- The detection results for the 100 suspicious open-source methods can be found in
The following Venn Diagram shows the overlap among INFERROI-detected 29 bugs and PMD-detected 18 bugs.
- RQ3: The prompts used in the ablation study are shown in Figure 5 below. The results of GPTLeak, GPTLeak-exp, and GPTLeak-roi on DroidLeaks can be found in
results/rq3/droidleaks-gptleak.log,results/rq3/droidleaks-gptleak-exp.log, andresults/rq3/droidleaks-gptleak-roi.log.
-
RQ4: The results of Llama-3-8B and Gemma-2-9B on DroidLeaks can be found in
results/rq4/droidleaks-llama-3-8b.logandresults/rq4/droidleaks-gemma-2-9b.log. -
RQ5: The results of the intention inference can be found in
results/rq5/intentions.csv.




