Git Product home page Git Product logo

FlexiRepair

Citing FlexiRepair

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

I. Introduction

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). The workflow of this technique.\label{workflow}

II. Environment setup

Requirement

  • Docker

Setup

  • 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

III. Step-by-Step execution

Inside the docker image

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.

Jobs

FlexiRepair needs to follow an execution, in the order listed below in order to create clusters of patches.

  1. 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.

  2. inferrer: The goal of the Inferrer is to derive generic patches from the clusters of similar concrete patches.

  3. validateCodeFlaws: Creates patch candidates and validates them on the preinstalled CodeFlaws benchmark.

IV. Generated Patch Candidates

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"

V. Structure of the shared folder

  |--- 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

Data Viewer

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..)

Pickle

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

flexirepair's Projects

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.