An Approach to Comparing Java Programs through the Graph Edit Distance with Similar Instruction Matching of Control Flow Graphs
Hyun-il Lim · Asia-pacific Journal of Convergent Research Interchange · 2023
As software is essentially used in a wide range of technologies, various analysis techniques are employed to understand the characteristics of software and optimize it.Software similarity analysis is utilized in various fields, including duplicate code detection, plagiarism detection, code optimization, and malicious code detection.Control flow graphs are static data structures that express operational and structural characteristics of software.So, they are widely used for representing and understanding software's features.This paper proposes a method for analyzing similarities between Java programs by applying the edit distance of control flow graphs.To enhance the flexibility of matching instructions within control flow graphs, we have designed a method for classifying similar instructions and matching them based on these classes.This method can improve the reliability of similarity analysis results for programs that have similar control flow structures and instructions.We conducted experiments using Java benchmark programs and evaluated the accuracy and reliability of the proposed method.The results indicated that the method achieved a high accuracy rate of 98% in comparison experiments between similar Java programs.It is expected that the proposed method will be useful for analyzing software similarity and understanding the operational characteristics of software by matching similar instructions in programs.