Jisuanji kexue (Mar 2023)

Method of Java Redundant Code Detection Based on Static Analysis and Knowledge Graph

  • LIU Xinwei, TAO Chuanqi

DOI
https://doi.org/10.11896/jsjkx.220700240
Journal volume & issue
Vol. 50, no. 3
pp. 65 – 71

Abstract

Read online

Redundant code is common in commercial and open source software,and its presence can increase memory footprint,affect code maintainability,and increase maintenance costs.Rapid type analysis algorithm is a common static analysis method in Java redundant code detection,but it still has some shortcomings in virtual method analysis.XTA is a call graph construction algorithm with high precision and efficiency in handling virtual method calls.A method based on XTA call graph construction algorithm is proposed to detect redundant code in Java code.This method is implemented in a prototype tool called redundant code Detection(RCD),and the knowledge graph is constructed to assist manual review to improve the efficiency of manual review and the reliability of redundant code detection.RCD is compared with three other redundant code detection tools by experiments on four open source Java applications.Experimental results show that RCD improves the accuracy of detecting redundant codes by 1%~30% compared with other tools,and improves the integrity of detecting redundant virtual methods by about 4%.

Keywords