Font Size: a A A

Research And Application Of C Language Code Defect Localization Method Based On Deep Learning

Posted on:2022-05-30Degree:MasterType:Thesis
Country:ChinaCandidate:J ZhouFull Text:PDF
GTID:2518306512976459Subject:Computer technology
Abstract/Summary:PDF Full Text Request
As the representative of structured programming language,C language has been determined by many universities as a required course of all majors in science and engineering.Improving programming practice ability is one of the important teaching goals of this course.In order to better to improve the programming ability of learners,judge online system(OJ)or experimental support system has become an urgent teaching support platform.The function of this kind of teaching platform is to automatically evaluate the program code submitted by students through black box testing,and give the evaluation results,so as to promote the practical teaching effect of the course.However,most of the current platforms can only provide evaluation results,but cannot locate code defects,so as to help learners find problems of the code as soon as possible.In this thesis,the research work is carried out on the code defect location method,the main research contents include:First of all.this thesis proposes a C language code defect location method based on deep learning.This method is different from the previous code defect location methods that use defect reports or use defect codes to form a training library.A detection template is formed based on a large number of correct codes in the system,that is,a large number of correct codes are used as training data and deep learning technology is used to train and construct a code template.The library locates the defect code by finding the template code most similar to the submitted code.Specifically,this method expresses the C language code in the form of an syntax tree(AST),splits the AST into subtrees,uses Word2vec word embedding technology to encode the code,enters the neural network model for feature extraction,and builds a code template Library.In the detection stage,the defect code is calculated with the code in the code template library to find the most similar template code,and the defect sentence is found through sentence-by-sentence lexical analysis,so as to realize the defect location of the C language code.The validity of the method is verified by the construction of two data sets and corresponding test sets.The results show that the method of this thesis has a better defect location effect.Secondly,this thesis explores the application of this method of the C language course teaching experiment system.By adding the " error prompt " function of the experiment code submission page,the logic defects of the code are detected and fed back to the students,helping students find the code more quickly possible defective sentences.Finally,this thesis presents the usability test,performance test,and security test results for this function to prove the effectiveness of the method in the actual system.
Keywords/Search Tags:Defect location, Abstract syntax tree, Recurrent neural network, Similarity calculation
PDF Full Text Request
Related items