This paper presents a comprehensive method for identifying fine-grained change patterns in the source code of large-scale software projects. Source code changes are computed by differencing abstract syntax trees of adjacent versions and transferred to a set of logical statements called a factbase. A factbase contains information for tracking and relating source code entities across versions and can be used to integrate analysis results of other tools such as call graphs and control flows. Users can obtain a list of change pattern instances by querying the factbase.Experiments conducted on the Linux-2.6 kernel, which involve more than 4 billions of facts, are reported to demonstrate capability of the method.
Masatomo Hashimoto, Akira Mori and Tomonori Izumida. A Comprehensive and Scalable Method for Analyzing Fine-Grained Source Code Change Patterns. In Proceedings of the 22nd IEEE International Conference on Software Analysis, Evolution, and Reengineering (SANER’15), pp. 351-360, 2015.
Examples of Identified Change Patterns
- local variable extraction (also known as introduce explaining variable or extract variable) and its inverse, inline temp, and
- move dereference to after a NULL test.
We recommend Chrome or Firefox for browsing the patterns, since we have not tested the viewer (based on CodeMirror) with others yet. The patterns are identified by the latest unstable version of the system, which may yield different results from the ones shown in Sections III-A and III-B.