arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2103.16846cs.SEcs.AI
收藏

在JavaScript中使用Source Code嵌入来探索合理的补丁

Exploring Plausible Patches Using Source Code Embeddings in JavaScript

MTA-SZTE Research Group on Artificial Intelligence(MTA-SZTE人工智能研究组);University of Szeged(塞格德大学)

Viktor Csuvik, Dániel Horváth, Márk Lajkó, László Vidács

摘要:

尽管自动程序修复(APR)领域非常受欢迎,但补丁验证的问题仍然是开放的。目前的大多数方法都遵循所谓的生成和验证方法,首先生成候选解决方案,然后根据Oracle进行验证。然而,后者可能不会给出可靠的结果,因为这样的预言机中存在缺陷;其中之一通常是测试套件。尽管(重新)运行测试套件是在人们的眼皮底下,但在现实生活中的应用程序中,过度拟合和欠拟合的问题经常发生,导致补丁不足。解决这个问题的努力包括补丁过滤,测试套件扩展,仔细的补丁制作等等。迄今为止,大多数方法使用后过滤依赖于测试执行跟踪或利用一些相似性的概念上产生的补丁测量。我们的目标是调查这些基于相似性的方法的性质。为此,我们在一个开源JavaScript项目上训练了一个Doc 2 Vec模型,并为其中的10个bug生成了465个补丁。然后,根据与原始程序的相似性,将这些看似合理的补丁与开发人员修复一起进行排名。我们分析了这些相似性列表,发现普通的文档嵌入可能会导致错误分类-它无法捕获细微差别的代码语义。然而,在某些情况下,它也提供了有用的信息,从而有助于更好地理解自动程序修复领域。

英文摘要:

Despite the immense popularity of the Automated Program Repair (APR) field, the question of patch validation is still open. Most of the present-day approaches follow the so-called Generate-and-Validate approach, where first a candidate solution is being generated and after validated against an oracle. The latter, however, might not give a reliable result, because of the imperfections in such oracles; one of which is usually the test suite. Although (re-) running the test suite is right under one's nose, in real life applications the problem of over- and underfitting often occurs, resulting in inadequate patches. Efforts that have been made to tackle with this problem include patch filtering, test suite expansion, careful patch producing and many more. Most approaches to date use post-filtering relying either on test execution traces or make use of some similarity concept measured on the generated patches. Our goal is to investigate the nature of these similarity-based approaches. To do so, we trained a Doc2Vec model on an open-source JavaScript project and generated 465 patches for 10 bugs in it. These plausible patches alongside with the developer fix are then ranked based on their similarity to the original program. We analyzed these similarity lists and found that plain document embeddings may lead to misclassification - it fails to capture nuanced code semantics. Nevertheless, in some cases it also provided useful information, thus helping to better understand the area of Automated Program Repair.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑