Font Size: a A A

Research On Static Detection Of C++ Code Based On Deep Learning

Posted on:2021-12-15Degree:MasterType:Thesis
Country:ChinaCandidate:M K XuFull Text:PDF
GTID:2518306107950129Subject:Computer technology
Abstract/Summary:PDF Full Text Request
With the development of computer technology and the expansion of software scale,the static detection technology of the code in the software also presents greater challenges.Code static detection is to check for hidden errors in the code ahead of time,such as memory release errors,variable definition related errors,and so on.Some existing detection tools still have shortcomings such as missed detection and high false positives.In order to complete the static detection of code more efficiently and accurately,a code detection model based on deep learning is proposed by taking C++ as detection object.Instead of the traditional representation granularity,the intermediate representation of C++ code uses the path in the abstract syntax tree(AST)as the basic granularity.This allows the learning model to learn about the structural nature of the source code rather than seeing it as a set of flat sequences.The code analysis model adopts the question and answer model in the reading comprehension task,aiming at a piece of C++ code to be tested,the test results can be given according to the input of different test problems.In the design of model structure,the full convolution architecture is used to replace the cyclic architecture frequently used in the reading comprehension model,and dilation convolution and gated linear units are added to the convolution layer to improve the ability of the convolutional network to process the sequence input information.Because the convolution structure allows more efficient parallelization of input sequences,the model greatly reduces the response delay.Experimental results show that the full convolution model performs well in the static detection task of code,has low response delay in prediction,and reduces the rate of missed detection and false positives compared with the existing C++ code detection tools.AST path-based representation can also be better used for code static detection tasks,which can improve the results without changing the learning model.
Keywords/Search Tags:Static detection, Abstract syntax tree, Question and answer model, Dilation convolution, Gated linear units
PDF Full Text Request
Related items