GUARD: A GNN-Based Tool for Automated Unit Test Case Generation and Code Defect Prediction
Ziyuan Li, Zhi Wang · 2025
Software unit testing is one of the important methods to ensure software quality. Traditional test case generation technology has limitations in accurately understanding code structure and identifying defects. This paper proposes a unit test case generation method based on graph neural network (GNN): GUARD. By modeling the source code as a program dependency graph (PDG), GNN is used to extract program structure and semantic features to achieve accurate prediction and identification of potential defect areas. Experimental results show that compared with traditional methods, this method has greatly improved coverage and defect detection capabilities, providing an effective technical means for automated unit testing.