This project extracts features from patches such as repair patterns.
PPD is the part of this project responsible for the detection of repair patterns in patches.
@inproceedings{Madeiral2018,
author = {Fernanda Madeiral and Thomas Durieux and Victor Sobreira and Marcelo Maia},
title = {Towards an automated approach for bug fix pattern detection},
booktitle = {Proceedings of the VI Workshop on Software Visualization, Evolution and Maintenance (VEM '18)},
year = {2018},
url = {https://arxiv.org/abs/1807.11286}
}- Clone this repository:
$ git clone https://github.com/lascam-UFU/automatic-diff-dissection.git- Run the script
./init.sh:
$ cd automatic-diff-dissection
$ chmod +x ./scripts/*.sh
$ ./scripts/init.shTo run ADD, you need to compile it, to locate the .jar file, and to call it:
$ cd automatic-diff-dissection
$ mvn package -DskipTests
$ ls target/*jar
target/automatic-diff-dissection-0.1-SNAPSHOT.jar
target/automatic-diff-dissection-0.1-SNAPSHOT-jar-with-dependencies.jar
target/automatic-diff-dissection-0.1-SNAPSHOT-sources.jar
$ java -jar target/automatic-diff-dissection-0.1-SNAPSHOT-jar-with-dependencies.jar <arguments>Note that ADD receives a set of arguments to run. The argument options are:
(-m|--launcherMode) <REPAIR_PATTERNS;REPAIR_ACTIONS;METRICS;ALL>
Provide the launcher mode, which is the type of the features that will
be extracted.
(-b|--bugId) <bugId>
Provide the bug id (this is used only for information presentation).
--buggySourceDirectory <buggySourceDirectory>
Provide the path to the buggy source code directory of the bug.
--diff <diffPath>
Provide the path to the diff file.
[(-o|--output) <outputDirectory>]
Provide an existing path to output the extracted features as a JSON file
(optional).The results will be printed in the terminal, and if a path was provided to the argument outputDirectory, the results will be saved in a JSON file.
TODO: to show an usage case with one bug.
- Clone
tdurieux/pattern-detector-experimentanywhere:
$ git clone https://github.com/tdurieux/pattern-detector-experiment.git- Change the configuration in
/automatic-diff-dissection/scripts/defects4j/run-tool-on-defects4j/config.cfgfile:
-
checkoutmust be set with the path of the repository cloned in step 1 plus/benchmark/defects4j. -
outputshould be set with an existing path to output the extracted features as a JSON file (optional).
- Enter in the directory where this project was cloned and compile this project:
$ mvn package -DskipTests- Run the feature extractor:
$ python scripts/defects4j/run-tool-on-defects4j/Launch.py <REPAIR_PATTERNS;REPAIR_ACTIONS;METRICS;ALL>- Check out the folder you set
outputto in step 2.