Skip to content
Switch branches/tags
Go to file

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

ADD; Automatic Diff Dissection Build Status Coverage Status

This project extracts features from patches such as repair patterns.

PPD; Patch Pattern Detector

PPD is the part of this project responsible for the detection of repair patterns in patches.

  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 = {}


Running ADD

  1. Clone this repository:
$ git clone
  1. Compile the project:
$ cd automatic-diff-dissection
$ mvn package -DskipTests
  1. Locate the .jar file and call it:
$ ls target/*jar
$ java -jar target/automatic-diff-dissection-1.1-SNAPSHOT-jar-with-dependencies.jar <arguments>

Note that ADD receives a set of arguments to run. The argument options are:

        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

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.

Example on a dataset: extract features from Defects4J patches

  1. Clone tdurieux/pattern-detector-experiment anywhere:
$ git clone
  1. Change the configuration in /automatic-diff-dissection/scripts/defects4j/run-tool-on-defects4j/config.cfg file:
  • checkout must be set with the path of the repository cloned in step 1 plus /benchmark/defects4j.

  • output should be set with an existing path to output the extracted features as a JSON file (optional).

  1. Enter in the directory where this project was cloned and compile this project:
$ mvn package -DskipTests
  1. Run the feature extractor:
$ python scripts/defects4j/run-tool-on-defects4j/ <REPAIR_PATTERNS;REPAIR_ACTIONS;METRICS;ALL>
  1. Check out the folder you set output to in step 2.