Utilizing Source Code Embeddings to Identify Correct Patches

Viktor Csuvik, Dániel Horváth, Ferenc Horváth, László Vidács
{"title":"Utilizing Source Code Embeddings to Identify Correct Patches","authors":"Viktor Csuvik, Dániel Horváth, Ferenc Horváth, László Vidács","doi":"10.1109/IBF50092.2020.9034714","DOIUrl":null,"url":null,"abstract":"The so called Generate-and-Validate approach of Automatic Program Repair consists of two main activities, the generate activity, which produces candidate solutions to the problem, and the validate activity, which checks the correctness of the generated solutions. The latter however might not give a reliable result, since most of the techniques establish the correctness of the solutions by (re-)running the available test cases. A program is marked as a possible fix, if it passes all the available test cases. Although tests can be run automatically, in real life applications the problem of over- and underfitting often occurs, resulting in inadequate patches. At this point manual investigation of repair candidates is needed although they passed the tests. Our goal is to investigate ways to predict correct patches. The core idea is to exploit textual and structural similarity between the original (buggy) program and the generated patches. To do so we apply Doc2vec and Bert embedding methods on source code. So far APR tools generate mostly one-line fixes, leaving most of the original source code intact. Our observation was, that patches which bring in new variables, make larger changes in the code are usually the incorrect ones. The proposed approach was evaluated on the QuixBugs dataset consisting of 40 bugs and fixes belonging to them. Our approach successfully filtered out 45% of the incorrect patches.","PeriodicalId":190321,"journal":{"name":"2020 IEEE 2nd International Workshop on Intelligent Bug Fixing (IBF)","volume":"106 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2020-02-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"19","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2020 IEEE 2nd International Workshop on Intelligent Bug Fixing (IBF)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/IBF50092.2020.9034714","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 19

Abstract

The so called Generate-and-Validate approach of Automatic Program Repair consists of two main activities, the generate activity, which produces candidate solutions to the problem, and the validate activity, which checks the correctness of the generated solutions. The latter however might not give a reliable result, since most of the techniques establish the correctness of the solutions by (re-)running the available test cases. A program is marked as a possible fix, if it passes all the available test cases. Although tests can be run automatically, in real life applications the problem of over- and underfitting often occurs, resulting in inadequate patches. At this point manual investigation of repair candidates is needed although they passed the tests. Our goal is to investigate ways to predict correct patches. The core idea is to exploit textual and structural similarity between the original (buggy) program and the generated patches. To do so we apply Doc2vec and Bert embedding methods on source code. So far APR tools generate mostly one-line fixes, leaving most of the original source code intact. Our observation was, that patches which bring in new variables, make larger changes in the code are usually the incorrect ones. The proposed approach was evaluated on the QuixBugs dataset consisting of 40 bugs and fixes belonging to them. Our approach successfully filtered out 45% of the incorrect patches.
利用源代码嵌入来识别正确的补丁
所谓的自动程序修复的生成和验证方法由两个主要活动组成,生成活动,它生成问题的候选解决方案,以及验证活动,它检查生成的解决方案的正确性。然而,后者可能不会给出可靠的结果,因为大多数技术通过(重新)运行可用的测试用例来建立解决方案的正确性。如果一个程序通过了所有可用的测试用例,它就被标记为可能的修复。尽管测试可以自动运行,但在实际应用中经常出现过拟合和欠拟合的问题,从而导致补丁不足。在这一点上,需要对候选修复进行人工调查,尽管它们通过了测试。我们的目标是研究预测正确斑块的方法。其核心思想是利用原始(有bug的)程序和生成的补丁之间的文本和结构相似性。为此,我们在源代码上应用Doc2vec和Bert嵌入方法。到目前为止,APR工具主要生成一行修复,保留了大部分原始源代码。我们的观察是,那些引入新变量、对代码进行较大修改的补丁通常是不正确的。提出的方法在QuixBugs数据集上进行了评估,该数据集包含40个错误和属于它们的修复。我们的方法成功地过滤掉了45%的不正确的补丁。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信