GithubHelp home page GithubHelp logo

assert-kth / drr Goto Github PK

View Code? Open in Web Editor NEW
10.0 10.0 6.0 2.61 GB

Tool & data on the correctness of Defects4 patches generated by program repair tools http://arxiv.org/pdf/1909.13694

Home Page: http://arxiv.org/pdf/1909.13694

License: Creative Commons Attribution Share Alike 4.0 International

Java 99.96% Python 0.01% Shell 0.01% JavaScript 0.01% HTML 0.02%

drr's Introduction

Automated Patch Assessment for Program Repair

A tool for automatic correctness assessment for patches generated by program repair systems. We consider the human patch as ground truth oracle and use Random tests based on the Ground Truth (RGT). See Automated Patch Assessment for Program Repair at Scale

If you use this repo, please cite:

@Article{Ye2021EMSE,
    author = {Ye, He and Martinez, Matias and Monperrus, Martin},
    title = "Automated Patch Assessment for Program Repair at Scale",
    journal="Empirical Software Engineering",
    volume = "26",
    issn = "1573-7616",
    doi = "https://doi.org/10.1007/s10664-020-09920-w",
    year = "2021"
}

Folder Structure

├── Patches 257 patches from Dcorrect and 381 patches from Doverfitting
│ 
├── RGT: incl. tests from Evosuite2019, Randoop2019, EvosuitASE15, RandoopASE15 and EvosuiteEMSE18
│   
├── DiffTGen
│   ├── Results: the running result overfitting patches found by DiffTGen. 
│   ├── runDrr.py: a command to reproduce DiffTGen experiment(details see below)
│ 
├── statistics: our exerimental statistics for all RQs
│ 
└──  run.py: a command to reproduce all experiments

Prerequisites

  • JDK 1.7
  • OS: Linux and Mac
  • Configure the DEFECTS4J_HOME="home_of_defects4j"
  • Add submodule defects4j and checkout the commit 486e2b4(Please note our experiment depends on several Defects4J commands)
git submodule add https://github.com/rjust/defects4j
git reset --hard 486e2b49d806cdd3288a64ee3c10b3a25632e991

Run

To assess an indiviual patch for Defects4J:

./run.py patch_assessment <patch_id> <dataset:Dcorrect|Doverfitting> <RGT:ASE15_Evosuite|ASE15_Randoop|EMSE18_Evosuite|2019_Evosuite|2019_Randoop>  
example:  ./run.py patch_assessment patch1-Lang-35-ACS.patch Dcorrect 2019_Evosuite

To perform different sanity checks:

./run.py applicable_check
./run.py plausible_check

To identify flaky tests:

./run.py flaky_check <patch_id> <dataset:Dcorrect|Doverfitting> <RGT:ASE15_Evosuite|ASE15_Randoop|EMSE18_Evosuite|2019_Evosuite|2019_Randoop>  
example:  ./run.py flaky_check patch1-Lang-35-ACS.patch Dcorrect 2019_Evosuite

To reproduce our Expriments with RGT patch assessment

RQ1: ./run.py RQ1
RQ3: ./run.py RQ3
RQ4: ./run.py RQ4
RQ5: cd ./statistics   ./RQ5-randomness-script.py  <Evosuite2019|Randoop2019>

Results

Credits

  • For more details about Defects4J, see the original repository of the Defects4J benchmark.
  • For more details about DiffTGen, see the original repository of the DiffTGen.

drr's People

Contributors

martinezmatias avatar monperrus avatar

Stargazers

 avatar Haoye TIAN avatar  avatar  avatar Junjielong Xu avatar Feng Yang avatar Pepe avatar stundejzw avatar Aldeida Aleti avatar Jian Gu avatar

Watchers

 avatar James Cloos avatar Thomas Durieux avatar  avatar Aldeida Aleti avatar Zhongxing Yu avatar  avatar siddharth avatar Ye avatar  avatar

drr's Issues

different patches among the 926 patches

so far we have 926 program repair patches.

maybe two approaches have produced the same patch.

how many actually different patches do we have? (different line changed or different content)

We must pay attention to execute correctly defects4j tests

In the previous execution, we had A LOT of trouble to have the correct behavior from the tests.
The tests are highly dependent of the environment.
Some test that should not fail fail.
It was a little bit better on grid5k.

We should pay attention to this in our evaluation

add a column for the experiment name to differentiate tool and experiment name (2 columns: tool name and paper name)

Problem: in https://github.com/kth-tcs/defects4-repair-reloaded/blob/master/tables/patches_info.csv
the tool name mixes the tool name and the experiment name.

For instance in Nopol2017, the tool name is "Nopol" and the "experiment name" is "Githubt2017".

For ACS, the tool name is "ACS" and the experiment name is "ICSE16".

I propose to add a column for the experiment name in all tables starting with patches_info.csv

naming convention for generated tests

convention for generated tests:

automated_generate_tests/<PAPER>
  • so rename automated_generate_tests/Evosuite to automated_generate_tests/EMSE18

open-question: what do we do

file name and folder conventions

(we maintain the convention in this first post)

Patches

** Patches folder convention**:

patches/<tool_folder>/<project_folder>/<bug_id>/*.patch
eg ACS/Lang/

Patch file naming convention:

  1. inside a folder of patches, each patch file has the name:
    patch<patch ID>-<Project>-<Bugid>-<approach>.patch

  2. If there one single patch, theere is also a patch ID, which is "1"
    patch1-<Project>-<Bugid>-<approach>.patch

Patched version

** Patched version folder convention**:

patched_programs/<tool_folder>/<project_folder>/<bug_id>/<patch_id>/*.java
(we don't keep the package structure as folders)

Java file naming convention:

The Java file name is the normal class name (as usual in Java)

we don't keep HDRepair

because the data in the paper is absent (no patch id, no listing) and the associated data is of bad quality.

[Minor issue] add .DS_Store into git ignore list

Hi @SophieHYe
It's a minor thing: the .DS_Store are files from the MacOs. (They contain information about the visualization of the windows those are placed)
In the local folder of your repo you can remove them (e.g., using command find with the argument delete) and then to add .DS_Store in the .gitignore file.
Here one Stackoverflow post that explain that
https://stackoverflow.com/questions/107701/how-can-i-remove-ds-store-files-from-a-git-repository

List of available patches

ACS-Math-25: it is not a test-suite adequate repair

ACS-Math-25: it is not a test-suite adequate repair, only one failing test is repaired, one remains (checkMissingFastMathClasses):

  • does Defects4J info gives the same list of originally failing tests?
  • is it because of the usage of Java8 (We may ony use Java7 for the whole experiment)?

Combining patches folder with correct_patches folder?

Hi @martinezmatias
I have updated the patches folder name from patches to -> correct_patches as I would also like to collect the plausible patches to perform the experiment. I have combined these two folders, could you pls check if they are correct, then we could remove patches folder:) 👍

Thanks a lot! I have script to run the ASE15 tests, will update the main table soon :)

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.