All Projects → xgdsmileboy → Simfix

xgdsmileboy / Simfix

Licence: gpl-2.0
Automatically fix programs by leveraging existing patches from other projects and similar code snippets from the faulty project.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Simfix

Androidsnooper
Android library to record the network calls through the interceptor mechanism of the http clients.
Stars: ✭ 132 (-23.7%)
Mutual labels:  debugging-tool
Android Debugport
A Read-Eval-Print-Loop server for Android and SQLite
Stars: ✭ 147 (-15.03%)
Mutual labels:  debugging-tool
Bugsnag Cocoa
Bugsnag crash reporting for iOS, macOS and tvOS apps
Stars: ✭ 167 (-3.47%)
Mutual labels:  debugging-tool
Gdb Frontend
☕ GDBFrontend is an easy, flexible and extensionable gui debugger.
Stars: ✭ 2,104 (+1116.18%)
Mutual labels:  debugging-tool
Frodo2
Android Library for Logging RxJava2 Components
Stars: ✭ 142 (-17.92%)
Mutual labels:  debugging-tool
Electron Inject
Inject javascript into closed source electron applications e.g. to enable developer tools for debugging.
Stars: ✭ 150 (-13.29%)
Mutual labels:  debugging-tool
Xamarin.forms.breadcrumb
This is a breadcrumb navigation control that is complete automatic and uses the Navigation stack and page titles to generate the breadcrumbs.
Stars: ✭ 130 (-24.86%)
Mutual labels:  automatic
Scapix
Scapix Language Bridge
Stars: ✭ 171 (-1.16%)
Mutual labels:  automatic
Dbgchild
Debug Child Process Tool (auto attach)
Stars: ✭ 145 (-16.18%)
Mutual labels:  debugging-tool
Grub2 Theme Preview
🌇 Preview a full GRUB 2.x theme (or just a background image) using KVM / QEMU
Stars: ✭ 153 (-11.56%)
Mutual labels:  debugging-tool
Wxread Webautoreader
微信读书自动阅读器,全自动刷阅读时长,轻轻松松冲顶霸榜,您的微读挂机好帮手
Stars: ✭ 138 (-20.23%)
Mutual labels:  automatic
Ololog
A better console.log for the log-driven debugging junkies
Stars: ✭ 141 (-18.5%)
Mutual labels:  debugging-tool
Automatic Youtube Reddit Text To Speech Video Generator And Uploader
A series of 3 programs that will automatically receive scripts from Reddit, allow the user to edit them, then be sent off to a video generator where they will be uploaded to YouTube automatically.
Stars: ✭ 152 (-12.14%)
Mutual labels:  automatic
Imgui sdl
ImGuiSDL: SDL2 based renderer for Dear ImGui
Stars: ✭ 134 (-22.54%)
Mutual labels:  debugging-tool
Compile Hero
🔰Visual Studio Code Extension For Compiling Language
Stars: ✭ 169 (-2.31%)
Mutual labels:  automatic
Twili
Homebrew debug monitor for the Nintendo Switch.
Stars: ✭ 131 (-24.28%)
Mutual labels:  debugging-tool
Pwn debug
Aim to help building exploitation of CTFs pwn game quickly
Stars: ✭ 149 (-13.87%)
Mutual labels:  debugging-tool
Proxyman
Modern and Delightful Web Debugging Proxy for macOS, iOS, and Android ⚡️
Stars: ✭ 2,571 (+1386.13%)
Mutual labels:  debugging-tool
Coot
玩转 IFTTT 体验极客生活,互联网自动化神器【已经停止开发】
Stars: ✭ 172 (-0.58%)
Mutual labels:  automatic
Bugsnag Go
Automatic panic monitoring for Go and Go web frameworks, like negroni, gin, and revel
Stars: ✭ 155 (-10.4%)
Mutual labels:  debugging-tool
NOTE: SimFix depends on several Defects4J commands. Therefore, if you want to conduct your experiment on other projects outside Defects4J, please adapt the project to the Defects4J framework.
As an alternative, if you don't want to compile SimFix by youself, you also can download the replication package [HERE] directly, which will save your time for setting up the running environment.

SimFix

I. Introduction

SimFix is an automatic program repair technique, which leverages exisiting patches from other projects and similar code snippets in the same project to generate patches. The following figure is the workflow of our approach.

The workflow of this technique.\label{workflow}

Mining Stage

  1. Mine repair patterns from existing open-source projects, after which we can obtain a set of frequent repair patterns. Those patterns can be reused for other repairing scenarios as well.

Repairing Stage

  1. Fault Localization : obtain a ranking list of candidate faulty statements and extract corresponding code snippets.
  2. Donor Snippet Identification : identify the similarity between faulty code snippet and each candidate similar code snippet by leveraging three similarity metrics, according to which we obtain a list of candidate similar snippets with decending order of similarity value.
  3. Variable Mapping : establish the mapping relationship between variables in faulty and similar code snippets by leveraging similarity metrics and then obtain a mapping table, based on which the variables in the donor code snippet will be replaced with the corresponding variables.
  4. Modification Extraction and Intersection : extract code modifications to faulty code snippet via AST (Abstract Syntax Tree) matching and differencing against the donor snippet, and then the frequent patterns from the mining stage will be used to take intersection with those modifications to further ruled out invalid ones.
  5. Patch Generation & Validation : generate repair patches by applying extracted code modifications to the faulty code snippet with combining and ranking whose modifications, then using the test suite to validate the correctness of candidate patches until a correct patch found or timeout.

If you want to use this project, please cite our technical paper published at ISSTA'18.

@inproceedings{Simfix:2018,
    author   = {Jiang, Jiajun and Xiong, Yingfei and Zhang, Hongyu and
                Gao, Qing and Chen, Xiangqun},
    title    = {Shaping Program Repair Space with Existing Patches and Similar Code},
    series   = {ISSTA},
    year     = {2018},
    location = {Amsterdam, Netherlands},
    doi      = {10.1145/3213846.3213871},
} 

II. Environment

  • OS: Linux (Tested on Ubuntu 16.04.2 LTS)
  • JDK: Oracle jdk1.7 (important!)
  • Download and configure Defects4J (branch fee5ddf020) running environment.
  • Configure the following path.
    • DEFECTS4J_HOME="home_of_defects4j"

III. How to run

SimFix was traditionally developed as an Eclipse Java project, you can simply import this project to your workspace and run it as a common Java program. The main class is cofix.main.Main, and for the running option please refer to the Running Options.

Before running

  • unzip file sbfl/data.zip to sbfl/data : used for fault localization

  • using the command line provided by Defects4J to checkout a buggy version of benchmark for testing.

    Example: defects4j checkout -p Chart -v 1b -w ${buggy_program_path}/chart/chart_1_buggy

    NOTE : the path of the buggy version of benchmark have to be set as:

    …/projectName/projectName_id_buggy => Example: /home/user/chart/chart_1_buggy

Step 1, Build The Project

Originally, SimFix was developed as an Eclipse Java Project, you can simply import the project into your workspace and the class cofix.main.Main is the entry of the whole program.

Step 2, Running Options

Our prototype of SimFix needs three input options for running.

  • --proj_home : the home of buggy program of benchmark. (${buggy_program_path} for the example)

  • --proj_name : the project name of buggy program of benchmark. (chart for the example)

  • --bug_id : the identifier of the buggy program. (1 for the example)

    • The option of --bugy_id supports multiple formats:

      single_id : repair single bug, e.g., 1.

      startId-endId : repair a series of bugs with consecutive identifiers, e.g., 1-3.

      single_id,single_id,single_id : repair any bugs for the specific program, e.g., 1,5,9.

      all : repair all buggy versions of a specific project, i.e., all.

    Usage: --proj_home=${proj_home} --proj_name=${proj_name} --bug_id=${bug_id}
    Example: --proj_home=/home/user --proj_name=chart --bug_id=1
    Another: --proj_home=/home/user --proj_name=chart --bug_id=1,4,8
    

OPTION 1 : Run within eclipse (please use the old version: tested on Mars, which depends on Java7).

  • From the Main class:

    Run AsRun Configurations…Arguments : set the above arguments as Program Arguments.

OPTION 2 : run using command line.

  • We also provide runnable jar file of SimFix in the home folder of the project i.e., simfix.jar.

    Set the home directory of the SimFix project as your correct path and then run as:

    java -jar simfix.jar --proj_home=/home/user --proj_name=chart --bug_id=1

Step 3, Result Analysis

After finishing the repair, there will be two additional folders: log and patch.

  • log : debug output, including buggy statements already tried, patches and reference code snippet for correct patch generation.

  • patch : a single source file repaired by SimFix that can pass the test suite. In the source file, you can find the patch, which is formatted as (example of Chart_1):

    // start of generated patch
    int index=this.plot.getIndexOf(this);
    CategoryDataset dataset=this.plot.getDataset(index);
    if(dataset==null){
    return result;
    }
    // end of generated patch
    /* start of original code
            int index = this.plot.getIndexOf(this);
            CategoryDataset dataset = this.plot.getDataset(index);
            if (dataset != null) {
                return result;
            }
     end of original code*/
    

IV. Evaluation Result

Totally, SimFix successfully repair 34 bugs among 357 bugs in Defects4J v1.0 benchmark with generating 22 plausible but incorrect patches. The following table and venn diagram are comparison with existing approaches. More details are presented in the sub-folder final (latest).

The comparison with existing approaches.\label{compare} Intersection among different approaches.\label{venn}
The comparison with existing approaches. Intersections.

V. Structure of the project

  |--- README.md   :  user guidance
  |--- bin         :  binary code
  |--- d4j-info    :  defects4j information
  |--- doc         :  document
  |--- final       :  evaluation result
  |--- lib         :  dependent libraries
  |--- sbfl        :  fault localization tool
  |--- src         :  source code
  |--- test        :  test suite

ALL suggestions are welcomed.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].