Published November 14, 2024
| Version v1
Dataset
Open
Replication package for the paper: Harnessing Test Call Structures for Improved Fault Localization Effectiveness
Authors/Creators
Description
This repository contains the replication package for the paper "Harnessing Test Call Structures for Improved Fault Localization Effectiveness". The package includes the necessary scripts, data, and instructions to reproduce the results presented in the study, focusing on the effectiveness of Spectrum-Based Fault Localization (SBFL) using the Barinel algorithm.
Description of Folders and Files:
- algorithms/: Contains the SBFL algorithms implemented for this study. Note that only the Barinel algorithm was used in the presented results.
- base/: Contains the scripts needed for calculating spectra for SBFL.
- D4J/: Contains the Defects4J projects. These need to be unpacked using the appropriate scripts provided in this folder.
- changeset.json: Contains metadata about changesets for the projects analyzed in this study.
- main.py: The main script for calculating ranks and metrics for the selected projects and heuristics.
- SBFL ranks.csv: Contains the SBFL ranks calculated from the analysis.
Requirements
To run the scripts, you will need:
- Python 3.9
- Defects4J: The
D4Jfolder should contain unpacked Defects4J projects. Please ensure you have followed the instructions in theD4Jfolder to unpack the projects accordingly. - Required Python packages (install using
pip):pip install -r requirements.txt - Prepare the Defects4J Projects:
- Navigate to the
D4Jdirectory. - Run the provided scripts to unpack the necessary Defects4J projects.
- Ensure that each project folder is structured properly to be used by the
main.pyscript.
- Navigate to the
Running the Main Script
The main analysis script is main.py, which calculates the SBFL ranks using the Barinel algorithm based on the selected heuristics.
Usage
To run the main script:
python main.py
Parameters and Settings:
- Projects and Ranges: The projects are defined in the
projectslist, with their respective bug ranges in therangeslist. The script iterates over these projects and bug IDs to calculate SBFL ranks.
Outputs:
- The script outputs the ranks and coverage metrics directly to the console. Results can be redirected or saved as needed.
- It uses the
Ranks.RankContainerclass to calculate and print the minimum suspiciousness ranks for the selected metrics.