How often do unintended inconsistencies happen? Deriving modification patterns and detecting overlooked code fragments

How often do unintended inconsistencies happen? Deriving modification patterns and detecting overlooked code fragments
复制标题

DOI:
10.1109/icsm.2012.6405275
复制
发表时间:
2012-09
期刊:
2012 28th IEEE International Conference on Software Maintenance (ICSM)
影响因子:
--
通讯作者:
Yoshiki Higo;S. Kusumoto
Yoshiki Higo;S. Kusumoto
中科院分区:
其他
文献类型:
--
作者:
Yoshiki Higo;S. Kusumoto

文献摘要

被引文献

相似文献

保持一致的源代码很难。除非我们认识到需要在给定的错误修复或功能添加中修改的所有代码片段,否则会发生意外的矛盾。在修改源代码之前,可以使用基于关键字的搜索工具(例如GREP或代码克隆检测工具)来防止代码片段被忽略。但是,一旦源代码中发生不一致,这种工具将无法充分帮助我们。在本文中,我们提出了一种新方法,以自动识别源代码中的意外矛盾。所提出的方法分析了存储库中的源代码修改以得出修改模式。修改模式指示了哪种代码及其修改方式。派生的修改模式是查询,可以从最新版本的源文件中识别意外的不一致之处。我们实施了提出的方法,并将其应用于FreeBSD和Apache HTTPD。结果,我们确定了许多用于错误修复,功能增强和重构的被忽视的代码片段。这两个系统的精度分别为73.4%和88.9%。
It is difficult to keep consistent source code. Unintended inconsistencies occur unless we recognize all the code fragments that need to modify in a given bug fix or functional addition. Before modifying source code, keyword-based search tools like grep or code clone detection tools can be used to prevent code fragments from being overlooked. However, once inconsistencies occur in the source code, such tools cannot help us adequately. In this paper, we propose a new method to identify unintended inconsistencies in source code automatically. The proposed method analyzes source code modifications in a repository to derive modification patterns. A modification pattern indicates what kind of code and how it was modified. The derived modification patterns are queries to identify unintended inconsistencies from the latest version of source files. We implemented the proposed method and applied it to FreeBSD and Apache HTTPD. As a result, we identified many overlooked code fragments for bug fixes, functional enhancements, and refactorings. The precisions were 73.4% and 88.9% for the two systems, respectively.