Skip to content

Feng-Jay/INFERROI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Replication Package of InferROI

This replication package include all the evaluation data and results in our work, and source code will be released upon the accpetance.

Environment

  • python >= 3.9
  • dependencies: openai, langchain, spacy, srctoolkit, torch, transformers

Source Code

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 main LLM4Leak class.
  • cfg.py: Define the CFG class.

CFG Example

The following figure presents the CFG correpsonding to the Fixed Version in Figure 1 in our paper.

CFG

Evaluation

Configuration

  • LLM Version Configuration
  • LLM Parameter Configuration
    • temperature = 0 for avoiding randomness.
    • max_tokens = 1024 for limiting the numbers of generated tokens

Data

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.

DroidLeaks

JLeaks

Scripts

The scripts used to evaluate InferROI are included in the script folder.

  • script/scan_droidleaks.py: Detect resource leaks for the DroidLeaks dataset
  • script/scan_jleaks.py: Detect resource leaks for the JLeaks dataset
  • script/scan_suspicious_100.py: Detect resource leaks for the 100 suspicious methods
  • script/scan_lucene_100.py: Detect resource leaks for the 100 Apache Lucene methods

Results

The following Venn Diagram shows the overlap among INFERROI-detected 29 bugs and PMD-detected 18 bugs.

Venn

Prompts

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages