Applying CodeBERT for Automated Program Repair of Java Simple Bugs

Ehsan Mashhadi, Hadi Hemmati
3/22/2021
cs.SE

Official code: EhsanMashhadi/MSR2021-ProgramRepair (52 stars, Python, last commit 2022-11-27).

Abstract

Software debugging, and program repair are among the most time-consuming and labor-intensive tasks in software engineering that would benefit a lot from automation. In this paper, we propose a novel automated program repair approach based on CodeBERT, which is a transformer-based neural architecture pre-trained on large corpus of source code.

Show full abstract

We fine-tune our model on the ManySStuBs4J small and large datasets to automatically generate the fix codes. The results show that our technique accurately predicts the fixed codes implemented by the developers in 19-72% of the cases, depending on the type of datasets, in less than a second per bug. We also observe that our method can generate varied-length fixes (short and long) and can fix different types of bugs, even if only a few instances of those types of bugs exist in the training dataset.

View on arXivView PDF

Code Implementations(1)

Code of our paper Applying CodeBERT for Automated Program Repair of Java Simple Bugs which is accepted to MSR 2021.

5216Python, ShellMar 29, 20214 years ago
bert-modelmachine-learningmining-software-repositoriesprogram-repair

Similar Papers

Cite this paper

@article{mashhadi2021applying,
  title  = {Applying CodeBERT for Automated Program Repair of Java Simple Bugs},
  author = {Ehsan Mashhadi and Hadi Hemmati},
  year   = {2021},
  eprint = {2103.11626},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2103.11626}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2103.11626.svg)](https://codeofpaper.com/paper/2103.11626)

Discussion