Font Size: a A A

Code Recommendation Of Student Program Based On Data Driver

Posted on:2020-07-14Degree:MasterType:Thesis
Country:ChinaCandidate:C Z TengFull Text:PDF
GTID:2428330590973209Subject:Computer technology
Abstract/Summary:PDF Full Text Request
This thesis studies the method of code recommendation,aiming at the programming practice of C language course in colleges and universities,and provides different granularity code recommendation schemes in the process of students writing programs.Students will suddenly stop because of lack of programming experience,unfamiliar grammar and other reasons,and because they can not get the help of teachers and students in time,do not know the next step of programming ideas,which will cause great difficulties to students' programming learning.Some integrated development environments(IDE)contain code recommendation function,but IDE is usually based on the static type system of programming language to recommend properties,methods and parameter lists.The proposed code scheme is often independent of the current programming context,and these recommended results are arranged alphabetically,without considering the relevance of the recommended results to the current environment context.In this thesis,using artificial intelligence technology and a large number of reference code provided by online programming course,the code recommendation method and its application in student programming guidance are studied.Using a large number of correct student programs,through artificial intelligence algorithm,from three different granularity of words,sentences,and code blocks to learn the internal structure logic and programming patterns,so as to provide programming help to students with programming difficulties according to the current context of the program.In view of the above problems,this thesis has completed the following work:Recommendation of token word based on cyclic neural network.This method recommends the next token word based on the token sequence of the current program context.Lexical analysis is used to tokenize the program and standardize token to reduce the impact of code diversity.Using the function of cyclic neural network to learn nonlinear sequences,the pattern between token words is captured in token granularity.Code statement recommendation based on sequence2 sequence model.This method recommends the next line of code statement based on the current context code.First of all,standardize the source code,reduce code diversity.The model is divided into two processes: coding and decoding.The input of the coding stage is the current program context token sequence.The coding will output the intermediate vector.After processing the intermediate vector by using the attention mechanism,the decoding network will output a predicted token sequence,that is,the next programming statement recommended by the model according to the toke sequence of the program context.Code fragment recommendation that integrates similarity.This method selects the code fragment most similar to the current program from the code warehouse for recommendation.Firstly,the function segmentation of the program is carried out to reduce the granularity of similarity calculation,and then the token standardizati on is used to reduce the influence of variable name on the code similarity calculation.Then the attribute counting method and token sequence method are integrated to measure the similarity between the programs,and the code fragments with the highest similarity are given.
Keywords/Search Tags:code recommendation, student program, deep learning, program analysis
PDF Full Text Request
Related items