Font Size: a A A

Research On The Identification Of Statement Encapsulation Change Patterns

Posted on:2021-05-26Degree:MasterType:Thesis
Country:ChinaCandidate:Y S YuFull Text:PDF
GTID:2428330602497178Subject:Computer application technology
Abstract/Summary:PDF Full Text Request
During the software change process,due to changes in software requirements and the need for software maintenance,a large number of software change codes were submitted to the software version management system.The structure of software code has also become more and more complex,making it difficult for software developers to understand the changing code,A large number of code change patterns are mixed in the software changes.Separating these patterns from other changed codes will make it easier to understand the changes.This thesis studies the statement encapsulation pattern that moves a statement or sequence of statements into one or more grammatical entities,The following contributions have been made: First,because there is currently no definition of statement encapsulation patterns,this article classifies statement encapsulation patterns from four dimensions;Secondly,an algorithm for recognizing statement encapsulation patterns is proposed.The algorithm first recognizes the statement or statement sequence that has moved,and then confirms the statement encapsulation change pattern by analyzing the abstract syntax tree;Finally,the proposed recognition algorithm is experimentally verified,and the recognized statement encapsulation patterns are classified and analyzed.The recognition algorithm first uses text-based differential analysis tools to obtain the hunk of the version file before and after the code change,Then,the candidate hunk of the statement encapsulation pattern with similar lines of code is identified,Since the code cloning detection tool Simian is not ideal for recognizing the statement encapsulation pattern candidate hunk,a statement encapsulation pattern candidate hunk recognition algorithm based on LCS is proposed.By analyzing the abstract syntax tree of the version file before and after the code change,a statement encapsulation pattern recognition algorithm based on candidate hunk and abstract syntax tree is proposed.And proposed a statement encapsulation pattern classification algorithm to classify the recognition result set.Experiments were conducted on four open source project data sets.The experimental results show that the statement encapsulation pattern recognition algorithm based on the abstract syntax tree has a high recognition rate for statement encapsulation patterns,And the classification analysis of the recognition results was carried out by using statement encapsulation pattern classification algorithm.The classification results show that the statement encapsulation pattern accounts for 4% of the total number of version submissions.The three grammatical entities that generate the most statement encapsulation patterns are if,try,and for statements,which account for 81%,14%,and 6% of the total number of statement encapsulation pattern submissions,respectively.The statement encapsulation pattern of statement movement and statement modification accounts for 82% and 29% of the total number of statement encapsulation pattern submissions,The forward statement encapsulation pattern and the reverse statement encapsulation pattern account for 72% and 36% of the total statement encapsulation pattern submissions,The nested statement encapsulation pattern of grammatical entities and the non-nested statement encapsulation pattern of grammatical entities account for 14% and 92% of the total number of statement encapsulation pattern submissions,respectively.
Keywords/Search Tags:pattern recognition, statement encapsulation pattern, code change block, abstract syntax tree
PDF Full Text Request
Related items