lin-tan / knod

For our ICSE 2023 paper KNOD: Domain Knowledge Distilled Tree Decoder for Automated Program Repair
Other
30 stars 3 forks source link

KNOD: Domain Knowledge Distilled Tree Decoder for Automated Program Repair

This is the artifact of paper "KNOD: Domain Knowledge Distilled Tree Decoder for Automated Program Repair, Nan Jiang, Thibaud Lutellier, Yiling Lou, Lin Tan, Dan Goldwasser, and Xiangyu Zhang", ICSE 2023.

Dependency

To Run in Docker

Content

The file structure of the artifact is as follow:

KNOD's patches

The correct/plausible patches KNOD generated for Defects4J v1.2, Defects4J v2.0 and QuixBugs benchmarks are under the results folder, which refers to result of RQ1 in the paper.

To train KNOD models

cd src
python train.py

There are several configurations you may want to modify: training_data_path is the path to the training data, validating_data_path is the path to the validation data, and save_dir is the folder to save the models (default set to ../data/models/).

Our training data is shared atvia Zenodo at https://doi.org/10.5281/zenodo.7570475.

To generate patches for Defects4J

cd src
python prepare_defects4j_input.py
python generate_defects4j_output.py

To generate patches for QuixBugs

cd src
python prepare_quixbugsj_input.py
python generate_quixbugs_output.py

Citation

If you find this code to be useful for your research, please consider citing:

@inproceedings{jiang@domain,
   author = {Jiang, Nan and Lutellier, Thibaud and Lou, Yiling and Tan, Lin and Goldwasser, Dan and Zhang, Xiangyu},
   title = {KNOD: Domain Knowledge Distilled Tree Decoder for Automated Program Repair},
   year = {2023},
   isbn = {9781665457019},
   publisher = {IEEE Press},
   url = {https://doi.org/10.1109/ICSE48619.2023.00111},
   doi = {10.1109/ICSE48619.2023.00111},
   booktitle = {Proceedings of the 45th International Conference on Software Engineering},
   pages = {1251–1263},
   numpages = {13},
   keywords = {abstract syntax tree, deep learning, automated program repair},
   location = {Melbourne, Victoria, Australia},
   series = {ICSE '23}
}