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
期刊:
影响因子:
--
通讯作者:
Yoshiki Higo;S. Kusumoto
中科院分区:
文献类型:
--
作者:
Yoshiki Higo;S. Kusumoto
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.