Deep_FGDL:A Fine-grained Defect Localization Method Based on Deep Neural Network
Traditional static defect localization techniques can only achieve coarse-grained localization at the function or statement level and excessively rely on annotated information such as defect reports, thereby limiting their effectiveness in practical applications. To address these issues, this paper proposes a defect localization method called Deep_FGDL, which leverages Deep Neural Networks ( DNN ) to explore fine-grained feature information from the Abstract Syntax Tree ( AST) of the code. The method uses correct code fragments to construct a template library,breaking the limitations of labeled data. Firstly, the method performs preliminary localization by matching the correct template using a code semantic similarity analysis method. Secondly, a suspicion formula is introduced to weigh the results using a code defect detection model, obtaining the most probable defect localization. Finally, to enhance the effectiveness of the model, a defect pattern-based defect localization method is introduced for cases where a suitable template cannot be matched. The evaluation of the proposed method involves conducting experiments using the SARD dataset and comparing it with various other static defect localization methods. The experimental results reveal noteworthy enhancements in the metric of localization accuracy, with a significant increase of 15. 0% in the Top-5 rank and a 18. 2% improvement in precision.