Software Defect Detection Method Based on Graph Structure and Deep Neural Network
Tianrun Qu, Wei Liu, Weining Zheng, Wenxin Tao · 2022
For software source code defect detection, in order to achieve higher generalization ability and higher detection accuracy, this paper proposes a defect detection method based on graph structure and deep neural network. Use the code representation methods of abstract syntax tree, program dependency graph and code property graph to generate the dependency relationship of code data, extract the defect candidate key nodes of source code, and slice the program. Word2vec and one hot coding methods combined with attention mechanism are used to extract the semantic feature information and sentence type information of the program statements. In the deep neural network part, the BiGRU network model with attention mechanism is selected for deep learning to extract context information, forward and backward sequence information. Compared with the existing defect detection tools by data on SARD and CVE dataset, the generalization ability and detection effect are significantly improved. When applied to software testing, this method can achieve more efficient testing capability.