Font Size: a A A

Identification Of Statement Splitting Change Patterns

Posted on:2021-05-30Degree:MasterType:Thesis
Country:ChinaCandidate:W H DuanFull Text:PDF
GTID:2428330602497074Subject:Computer application technology
Abstract/Summary:PDF Full Text Request
The development and maintenance of modern software are mostly based on version control system,which greatly improves the working efficiency of cooperative software development among multiple developers.However,to achieve the best cooperation effect,every developer is required to understand the code changes between different versions of the software well.However,it is very difficult to understand these code changes because of the interaction of multiple code change patterns.In order to solve this problem,researchers began to study common code change patterns,For example,the research on typical code change patterns,such as restructuring and defect fixing,has formed a mature theoretical system,and applying these research results on the automatic identification of code change patterns,the positioning and separation of these change patterns have been realized,thereby helping developers effectively read and understand code changes.Statement splitting change pattern is a common code change mode that splits a code statement into multiple statements.This patterns generally assigns a more complex expression in the original code statement to a new variable,and then replaces the expression in the original sentence with this variable.This pattern is similar to the replacement algorithm in the code reconstruction mode,the difference is that the replacement algorithm is a reconstruction method at the function body level,and the statement split change mode is a code change mode that is more widely used at the code statement level.In addition,in the process of splitting and changing,new content will often be added to different parts,which makes the sentence splitting and changing mode take many different forms,the functions of the original statements is likely to change.Therefore,it is impossible to simply classify the sentence split change mode as a code refactoring pattern or other known code change patterns,and different presentation forms may correspond to different change purposes.Therefore,it is necessary to study the statement splitting change pattern separately to help developers understand the code changes involving this pattern.In this thesis,we do the following research on the statement splitting change pattern: first,we manually select the set of code change blocks that contain the pattern in the change history information of four open source projects,summarizethe common text features of these code change blocks,and determine that the statement splitting change patterns contains two basic forms,namely splitting form and replacement form,and give two basic forms respectively Then,according to the change characteristics of the nodes in the abstract syntax tree segment corresponding to these code change blocks,we design a statement splitting change pattern recognition algorithm.The algorithm experiments on the manually selected data set,and the recognition accuracy fluctuates between 81%and 89%.Then we apply the algorithm to four open source projects for experiments,and the recognition accuracy after manual detection It fluctuates from 71% to 80%.Secondly,based on the data set obtained from the above experiments,and through the further analysis of the example of adding new content to the data set,this paper proposes a classification framework of statement splitting change pattern,which classifies the pattern from three dimensions: the type of splitting statement,the behavior of statement changing and the type of new statement.In addition,a classification algorithm based on the framework is designed,which is verified by experiments It has high classification accuracy.Finally,the research work of recognition and classification is summarized and empirical analysis is carried out,and some conclusions that can help to understand statement splitting change patterns are obtained by comparing with other code change patterns.
Keywords/Search Tags:Software evolution, Pattern recognition, Pattern classification, Hunk, AST
PDF Full Text Request
Related items