Identify the Candidate Hunks Containing Statement Encapsulation Patterns

Yongsheng Yu, Chunhua Yang · 2020 IEEE 4th Information Technology, Networking, Electronic and Automation Control Conference (ITNEC) · 2020

Software version changes will result in the submission of a large number of change codes, and multiple change patterns are embedded in the change code. Identifying these change patterns helps to understand the details of the software changes. This paper examines the identification of candidate hunks for this change pattern in a common statement or sequence of statements moving to one or more different grammatical entities. For the existing code cloning tool Simian, the recognition rate of candidate hunk is not high for this statement encapsulation pattern. This paper proposes a candidate hunk recognition algorithm based on the longest common subsequence algorithm. The algorithm uses a text-based differential analysis tool to get the code change block hunk of the version before and after the code change. The candidate hunk is identified by combining the features of the statement encapsulation pattern candidate hunk. The algorithm was experimentally verified on four open source projects. Experimental results show that the algorithm has higher accuracy than Simian tools.

Read the paper · More papers on PaperTik