You can cite FlexiRepair using the following bibtex:
@article{koyuncu2020flexirepair,
title={Flexirepair: Transparent program repair with generic patches},
author={Koyuncu, Anil and Bissyand{\'e}, Tegawend{\'e} F and Klein, Jacques and Traon, Yves Le},
journal={arXiv preprint arXiv:2011.13280},
year={2020}
}
We have presented FlexiRepair, an open framework for template-based program repair where we build on the concept of generic patch to define a unified representation/notation for specifying fix patterns (aka templates).
- Docker
- Download the docker file
- Build the docker image. It will install all the necessary requirements.
docker build -t flexi .
- Create a folder to storage the data that is going to be shared with the docker image.
mkdir flexi-data
- Run the following commmand with the full path the created folder:
docker run -v /home/user/flexi-data/:/data/flexi-data -it flexi:latest /bin/bash
- Update config file to change projects to mine.
In order to launch FlexiRepair, execute flexi.sh as follows:
bash flexi.sh [CONFIG_FILE] [JOB]
e.g. bash flexi.sh src/main/resources/config.yml miner
A log file (app.log) is created after every execution of the flexi.sh. Please check this log file in order to access more information.
FlexiRepair needs to follow an execution, in the order listed below in order to create clusters of patches.
-
miner: Miner performs patch clustering, grouping together the code changes that are representing a repeating code context and change operations. The changes are collected from the projects listed in datasets.csv.
-
inferrer: The goal of the Inferrer is to derive generic patches from the clusters of similar concrete patches.
-
validateCodeFlaws: Creates patch candidates and validates them on the preinstalled CodeFlaws benchmark.
The plausible patches generated with FlexRepair are listed in patches folder.
|--- patches : plausible patches
|--- introclass_black : plausible patches passing introclass blackbox test-suite
|--- introclass_white : plausible patches passing introclass whitebox test-suite
|--- generic_black : generic patches used for generating "introclass_black"
|--- generic_white : generic patches used for generating "introclass_white"
|--- actions : clusters of patches grouped together
|--- commitsDF : pickle objects containing data related to mine projects and patches
|--- datasets : clones of projects to be mined
|--- pairs : cluster comparsion index files
|--- patches : patches of the projects, inference indexes, and infered generic patches
|------cocci : generic patches
The intermediate data provided computed during the steps are listed in directory flexi-data (or the corresponding folder shared with docker)
The data is stored in different formats. (e.g. pickle, redis db, csv, etc..)
The see content of the .pickle file the following script could be used.
import pickle as p
import gzip
def load_zipped_pickle(filename):
with gzip.open(filename, 'rb') as f:
loaded_object = p.load(f)
return loaded_object
Usage
result = load_zipped_pickle('/data/flexi-data/commitsDF/git.pickle')
# Result is pandas object which can be exported to several formats
# Details on how to export is listed in offical library documentation
# https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html