Font Size: a A A

Code Clone Detection Based On Sequence Alignment And Byte Code

Posted on:2018-11-02Degree:MasterType:Thesis
Country:ChinaCandidate:J WangFull Text:PDF
GTID:2348330515962857Subject:Computer Science and Technology
Abstract/Summary:PDF Full Text Request
During the development of software system,developers often reuse code segments through copy-paste operation,with or without modification,which makes the software system a large number of code clones.Although code clones can bring some convenience to developers,they bring about difficulties to the understanding and maintenance of software at the same time.Through the detection of code clones existing in the software system,developers can understand the distribution of the code clone in the software system quickly,which leads to the easily maintaining and refactoring of the cloned code.In order to detect code clone in large scale software effectively,a new code clone detection method based on sequence alignment is proposed.The method improves the original Smith-Waterman algorithm through the static acceleration strategy which solves the mosaic problem caused by the Smith-Waterman when the detected code fragments are long.Meanwhile,the method improves the trace back process through the construction of the closed trace back path,thus improving the efficiency of code clone detection.In addition,another multi-granularity code clone detection method based on Java bytecode is presented.The method can detect both method level and block level code clone according to the analysis of bytecode control transfer instructions.On the basis of the similarity of instruction,the similarity of method call sequence is also considered in the process of similarity calculation,which makes the result of the code clone detection more accurate.Since the Java bytecode can well reflect the semantic information of the source code,the method has good ability to detect semantic code clone.Finally,two experiments were carried out to verify the effectiveness of the proposed code clone detection methods,and the proposed methods were compared with some existing code clone detection methods,such as Nicad,CDSW and Decard et al.The results show that the F-measure of our method based on sequence alignment has a great improvement on all the tested software systems.Meanwhile,compared with the state-of-the-art alternatives,the method based on Java byte code has some improvements in the average value of precision,recall and F-measure for all the test systems.
Keywords/Search Tags:Code Clone, Code Clone Detection, Sequence Alignment, Smith-Waterman, Java Byte Code, Byte Code Instruction
PDF Full Text Request
Related items