This is a replication package for the paper "An Empirical Investigation on the use of Large Language Models for Performance Bug Detection"
Python
0
3 commits
updated Mar 13, 2025
This repository contains the replication package for the study on performance bug detection using Large Language Models (LLMs) and Machine Learning (ML) models. It includes all necessary scripts and instructions to replicate the experiments and analyses presented in the study.
requirements.txtpip install --upgrade pip
pip install -r requirements.txt
config.json file before running inference.{
"HUGGINGFACE_TOKEN": "Your_token"
}
The token should be replaced with your actual Hugging Face API token.
This package is structured as follows:
replication-package_per_bug_detection_LLM/
│── data/ # Contains input and output data
│── projects/ # Contains source code of analyzed projects
│── scripts/ # Contains Python scripts for LLM and ML processing
│── runner/ # Contains batch and shell scripts for execution
│── config.json # Stores API key for Hugging Face
│── requirements.txt # Lists dependencies
│── README.md # This file
scripts/: Contains all Python scripts for inference, processing, analysis, and ML.runner/: Contains execution scripts for running different parts of the pipeline.To run zero-shot inference, execute:
python scripts/zero-shot_inference.py
To run few-shot inference, execute:
python scripts/few-shot_inference.py
On Windows:
runner\run_llm_inference.bat
On Linux/macOS:
bash runner/run_llm_inference.sh
Outputs: Results are stored in data/output/llm_inference/.
To execute ML models:
python scripts/ml_model_runner.py
Output: ML performance metrics will be stored in data/output/with_without_anti_pattern_metrics_ML_Models.csv.
After running LLM inference, process and analyze the results. On Windows:
runner\run_llm_analysis_pipeline.bat
On Linux/macOS:
bash runner/run_llm_analysis_pipeline.sh
Outputs:
combined_LLM_outputs_cleaned.csv → processed and combined output of LLM inferencememory_errors_files.csv → list of files that could not be inferred due to possible GPU memory limitationdata/output/summary_llms.csv → Summary of LLM performancedata/output/project_wise_metrics.csv → Project-wise evaluation resultsThis step generates results for RQ1, RQ2, and RQ3 and creates necessary visualizations.
On Windows:
runner\generate_results.bat
On Linux/macOS:
bash runner/generate_results.sh
Outputs:
data/output/rq1_zeroshot_results.csv → RQ1 resultsdata/output/rq2_fewshot_results.csv → RQ2 resultsdata/output/rq3_combined_matrix.csv → RQ3 resultsdata/output/figures/ → Generated plotsdata/output/summary_llms.csvdata/output/project_wise_metrics.csvdata/output/with_without_anti_pattern_metrics_ML_Models.csvdata/output/rq1_zeroshot_results.csvdata/output/rq2_fewshot_results.csvdata/output/rq3_combined_matrix.csvdata/output/figures/This is a replication package for the paper "An Empirical Investigation on the use of Large Language Models for Performance Bug Detection"
Python
0
3 commits
updated Mar 13, 2025
This repository contains the replication package for the study on performance bug detection using Large Language Models (LLMs) and Machine Learning (ML) models. It includes all necessary scripts and instructions to replicate the experiments and analyses presented in the study.
requirements.txtpip install --upgrade pip
pip install -r requirements.txt
config.json file before running inference.{
"HUGGINGFACE_TOKEN": "Your_token"
}
The token should be replaced with your actual Hugging Face API token.
This package is structured as follows:
replication-package_per_bug_detection_LLM/
│── data/ # Contains input and output data
│── projects/ # Contains source code of analyzed projects
│── scripts/ # Contains Python scripts for LLM and ML processing
│── runner/ # Contains batch and shell scripts for execution
│── config.json # Stores API key for Hugging Face
│── requirements.txt # Lists dependencies
│── README.md # This file
scripts/: Contains all Python scripts for inference, processing, analysis, and ML.runner/: Contains execution scripts for running different parts of the pipeline.To run zero-shot inference, execute:
python scripts/zero-shot_inference.py
To run few-shot inference, execute:
python scripts/few-shot_inference.py
On Windows:
runner\run_llm_inference.bat
On Linux/macOS:
bash runner/run_llm_inference.sh
Outputs: Results are stored in data/output/llm_inference/.
To execute ML models:
python scripts/ml_model_runner.py
Output: ML performance metrics will be stored in data/output/with_without_anti_pattern_metrics_ML_Models.csv.
After running LLM inference, process and analyze the results. On Windows:
runner\run_llm_analysis_pipeline.bat
On Linux/macOS:
bash runner/run_llm_analysis_pipeline.sh
Outputs:
combined_LLM_outputs_cleaned.csv → processed and combined output of LLM inferencememory_errors_files.csv → list of files that could not be inferred due to possible GPU memory limitationdata/output/summary_llms.csv → Summary of LLM performancedata/output/project_wise_metrics.csv → Project-wise evaluation resultsThis step generates results for RQ1, RQ2, and RQ3 and creates necessary visualizations.
On Windows:
runner\generate_results.bat
On Linux/macOS:
bash runner/generate_results.sh
Outputs:
data/output/rq1_zeroshot_results.csv → RQ1 resultsdata/output/rq2_fewshot_results.csv → RQ2 resultsdata/output/rq3_combined_matrix.csv → RQ3 resultsdata/output/figures/ → Generated plotsdata/output/summary_llms.csvdata/output/project_wise_metrics.csvdata/output/with_without_anti_pattern_metrics_ML_Models.csvdata/output/rq1_zeroshot_results.csvdata/output/rq2_fewshot_results.csvdata/output/rq3_combined_matrix.csvdata/output/figures/