WANG Shang-Wen
College of Computer Science and Technology, National University of Defense Technology, Changsha 410073, ChinaLIU Kui
College of Computer Science and Technology, Nanjing University of Aeronautics and Astronautics, Nanjing 211106, ChinaLIN Bo
College of Computer Science and Technology, National University of Defense Technology, Changsha 410073, ChinaLI Li
Monash University, Clayton VIC 3800, AustraliaJacques KLEIN
University of Luxembourg, Luxembourg L-1359, LuxembourgTegawendé François BISSYANDÉ
University of Luxembourg, Luxembourg L-1359, LuxembourgMAO Xiao-Guang
College of Computer Science and Technology, National University of Defense Technology, Changsha 410073, ChinaSoftware defect localization refers to the activity of finding program elements that are related to software failure. The existing defect localization techniques, however, can only produce localization results at the function or statement level. These coarse-grained localization results can affect the efficiency and effectiveness of manual debugging and automatic software defect repair. This study focuses on the fine-grained identification of specific code tokens that lead to software defects. The study establishes abstract syntax tree paths for code tokens and proposes a fine-grained defect localization model based on a pointer neural network to predict specific code tokens of defects and specific operation behaviors of repairing the tokens. A large number of defect patch data sets in open-source projects contain a large amount of trainable data, and the paths constructed based on abstract syntax trees can effectively capture the program’s structural information. Experimental results show that the model trained in this study can accurately predict defect code tokens and is significantly better than the baseline methods based on statistics and machine learning. In addition, in order to verify that fine-grained defect localization results can contribute to automatic defect repair, two kinds of program repair processes are designed based on the fine-grained defect localization results. The processes are implemented by using code completion tools to predict the correct token or by following heuristic rules to find appropriate code repair elements. The results show that both methods can effectively solve the overfitting problem in automatic software defect repair.
王尚文,刘逵,林博,黎立,Jacques KLEIN, Tegawend&#; Fran&#;ois BISSYAND&#;,毛晓光.基于指针神经网络的细粒度缺陷定位.软件学报,2024,35(4):1841-1860
Copy