https://github.com/assert-kth/sequencer

Sequence-to-Sequence Learning for End-to-End Program Repair (IEEE TSE 2019). Open-science repo. http://arxiv.org/pdf/1901.01808

https://github.com/assert-kth/sequencer

Science Score: 23.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README
  • Academic publication links
    Links to: arxiv.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.7%) to scientific vocabulary

Keywords from Contributors

code-generation transformers static-analysis interactive projection generic sequences cryptocurrencies metaprogramming code-analysis
Last synced: 11 months ago · JSON representation

Repository

Sequence-to-Sequence Learning for End-to-End Program Repair (IEEE TSE 2019). Open-science repo. http://arxiv.org/pdf/1901.01808

Basic Info
  • Host: GitHub
  • Owner: ASSERT-KTH
  • Language: Java
  • Default Branch: master
  • Homepage:
  • Size: 118 MB
Statistics
  • Stars: 81
  • Watchers: 5
  • Forks: 41
  • Open Issues: 15
  • Releases: 0
Created over 7 years ago · Last pushed about 3 years ago
Metadata Files
Readme

README.md

SequenceR: Sequence-to-Sequence Learning for End-to-End Program Repair

SequenceR is a seq2seq model designed to predict bug fixes at the line level. The paper (doi:10.1109/TSE.2019.2940179) explains the approach.

If you use SequenceR for academic purposes, please cite the following publication: @article{chen2018sequencer, title={SequenceR: Sequence-to-Sequence Learning for End-to-End Program Repair}, author={Chen, Zimin and Kommrusch, Steve and Tufano, Michele and Pouchet, Louis-No{\"e}l and Poshyvanyk, Denys and Monperrus, Martin}, journal={IEEE Transaction on Software Engineering}, year={2019} }

Usage

Docker

Simply run the following two commands to set up use of the SequenceR Golden model: bash docker build --tag=sequencer . docker run -it sequencer

And now all dependecies are installed (including defects4j).

Or, use our this version from the Docker Hub.

Without docker

Install dependencies

First run src/setup_env.sh to setup enviroment and clone/compile project. Please view src/setup_env.sh for more details.

All models are versioned using git-lfs, make sure to configure it and correctly fetch the models before using.

Execution

Then run src/sequencer-predict.sh with the following parameters: bash ./sequencer-predict.sh --model=[model path] --buggy_file=[abs path] --buggy_line=[int] --beam_size=[int] --output=[abs path] * --model: Absolute path to the model * --buggyfile: Absolute path to buggy file * --buggyline: Line number indicating where the bug is, or just want it get changed. * --beam_size: Beam size for prediction * --output: Output directory to store the generated patches

Experiments

CodRep experiment

The training data consists of results/Golden/src-train.txt and results/Golden/tgt-train.txt (line to line correspondence).

The CodRep4 testing data consists of results/Golden/src-test.txt and results/Golden/tgt-test.txt (line to line correspondence).

Defects4J experiment

In results/Defects4J_patches you can find all patches that are found by SequencerR. Patches that are stored in *_compiled are patches that compiled. Patches that are stored in *_passed are patches that compiled and passed the test suite. Patches that are stored in *_correct are patches that compiled, passed the test suite and are equivalent to the human patch.

To rerun our experiment of SequenceR over Defects4J. Run src/Defects4J_Experiment/Defects4J_experiment.sh, make sure you have defects4j installed.

Defects4J_oneLiner_metadata.csv contains metadata for all Defects4J bugs that we consider. src/Defects4J_Experiment/validatePatch.py contains the precedure for running Defects4J test, we have time limit on compile time (60s) and test running time (300s).

Model creation, training and use:

Prerequisites

SequenceR uses the OpenNMT library to set up program repair as a translation from buggy code to fixed code. Documentation on OpenNMT including parameter setup is at http://opennmt.net/OpenNMT-py/

Setup

Choose a directory and: bash git clone https://github.com/OpenNMT/OpenNMT-py When testing a new configuration, copy a working data directory and modify *sh files as desired.

Set up environment variables:

bash export CUDA_VISIBLE_DEVICES=0 export THC_CACHING_ALLOCATOR=0 export OpenNMT_py=.../OpenNMT-py export data_path=.../results/Golden # Or a new directory path as desired

Train

For details on model training, refer to OpenNMT documentation. To run SequenceR training:

bash cd src sequencer-train.sh

Test

For details on model usage (translation), refer to OpenNMT documentation. To run SequenceR testing:

bash cd src sequencer-test.sh

License

The code and data in this repository are under the MIT license.

Owner

  • Name: ASSERT
  • Login: ASSERT-KTH
  • Kind: organization
  • Location: Sweden

assertEquals("Research group at KTH Royal Institute of Technology, Stockholm, Sweden", description);

GitHub Events

Total
  • Watch event: 4
Last Year
  • Watch event: 4

Committers

Last synced: almost 3 years ago

All Time
  • Total Commits: 84
  • Total Committers: 10
  • Avg Commits per committer: 8.4
  • Development Distribution Score (DDS): 0.512
Past Year
  • Commits: 3
  • Committers: 2
  • Avg Commits per committer: 1.5
  • Development Distribution Score (DDS): 0.333
Top Committers
Name Email Commits
Zimin Chen c****n@h****m 41
Javier Ron j****0@g****m 10
Steve Kommrusch s****h@g****m 9
Gabriel Chaperon g****b@g****m 9
Martin Monperrus m****s@g****g 6
Martin Monperrus m****s 3
Reza Gharibi r****g@g****m 2
claudeyj 4****j 2
dependabot[bot] 4****] 1
nashid n****d 1
Committer Domains (Top 20 + Academic)

Dependencies

Dockerfile docker
  • ubuntu 16.04 build