返回
Automated Code Editing With Search-Generate-Modify
DOI:10.1109/TSE.2024.3376387.png)
摘要
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.
Keyword:
Bug fixing
automated program repair
edit-based neural network
Bug fixing
automated program repair
edit-based neural network
期刊
IF:
5.6
论文数:
2.8K
被引数:
1.1W
机构
引用论文
Polysialylated Neural Cell Adhesion Molecule Is Involved in Induction of Long-Term Potentiation and Memory Acquisition and Consolidation in a Fear-Conditioning Paradigm聚唾液酸化的神经细胞粘附分子在恐惧调节范式中参与诱导长期增强和记忆获取和巩固

