arrow
Return

Automated Code Editing With Search-Generate-Modify

delete2024-07-01
delete0
delete
OA
AI
C
Changshu Liu *
P
Pelin Cetin
Y
Yogesh Patodia
B
Baishakhi Ray
S
Saikat Chakraborty
Y
Yangruibo Ding
DOI:10.1109/TSE.2024.3376387delete
deleteOriginal
deleteOriginal request for help
deleteShare
deleteSave
Abstract

Abstract

En 中文
Code editing is essential in evolving software development. In literature, several automated code editing tools are proposed, which leverage Information Retrieval-based techniques and Machine Learning-based code generation and code editing models. Each technique comes with its own promises and perils, and for this reason, they are often used together to complement their strengths and compensate for their weaknesses. This paper proposes a hybrid approach to better synthesize code edits by leveraging the power of code search, generation, and modification. Our key observation is that a patch that is obtained by search & retrieval, even if incorrect, can provide helpful guidance to a code generation model. However, a retrieval-guided patch produced by a code generation model can still be a few tokens off from the intended patch. Such generated patches can be slightly modified to create the intended patches. We developed a novel tool to solve this challenge: SarGaM, which is designed to follow a real developer's code editing behavior. Given an original code version, the developer may search for the related patches, generate or write the code, and then modify the generated code to adapt it to the right context. Our evaluation of SarGaM on edit generation shows superior performance w.r.t. the current state-of-the-art techniques. SarGaM also shows its effectiveness on automated program repair tasks.
Keywords:
Bug fixing
automated program repair
edit-based neural network
Bug fixing
automated program repair
edit-based neural network

Journal

IEEE Transactions on Software Engineering cover
IEEE Transactions on Software Engineering
IF:
5.6
Papers:
2.9K
Citations:
1.1W

Organization

C
Columbia University
Scholars:
7.1W
Papers: 6.4W
Citations: 263
M
Microsoft
Scholars:
3.0K
Papers: 2.7K
Citations: 7
Cited Papers

Cited Papers

Identification of effective DNA barcodes for Triticum plants through chloroplast genome-wide analysis
err2017-12-01
err0
PREAI
errMohamed Awad; Ragab M. Fahmy; Kareem A. Mosa; Mohamed Helmy; Fawzy A. El-Feky
errShare
errSave
Balanocarpol, a new polyphenol from Balanocarpus zeylanicus(trimen) and Hopea jucunda(Thw.)(Dipterocarpaceae)
err1985-01-01
err0
PREAI
errM. N. Champika Diyasena; Subramaniam Sotheeswaran; Sivagnanasunderam Surendrakumar; Sinnathamby Balasubramanian; Michael Bokel; Wolfgang Kraus
errShare
errSave
errShare
errSave
Caveolin-1 and -2 regulate cell motility in castration-resistant prostate cancer
err2018-10-01
err0
errOAAI
errToyoharu Kamibeppu; Koji Yamasaki; Kozue Nakahara; Takahiro Nagai; Naoki Terada; Hiromasa Tsukino; Shoichiro Mukai; Toshiyuki Kamoto
errShare
errSave
Chapter Twenty‐Eight Qualitative and Quantitative Characterization of Autophagy in Caenorhabditis elegans by Electron Microscopy
err2008-01-01
err0
PREAI
errTimea Sigmond; Judit Fehér; Attila Baksa; Gabriella Pásti; Zsolt Pálfia; Krisztina Takács‐Vellai; János Kovács; Tibor Vellai; Attila L. Kovács
errShare
errSave
Autophagy protects against PI3K/Akt/mTOR-mediated apoptosis of spinal cord neurons after mechanical injury
err2017-08-01
err0
PREAI
errZhenYu Wang; LinQuan Zhou; XiaoTing Zheng; Gang Chen; RongFeng Pan; JinHuang Li; WenGe Liu
errShare
errSave
researcher View more