Font Size: a A A

The Design And Implementation Of Intelligent Code Recommendation System Based On Structure Embedding Analysis

Posted on:2021-01-20Degree:MasterType:Thesis
Country:ChinaCandidate:Q HanFull Text:PDF
GTID:2428330647450837Subject:Engineering
Abstract/Summary:PDF Full Text Request
As developers,especially beginners in programming,often need to complete some unfamiliar programming tasks in daily software development.At this time,they may help to complete this unfamiliar programming task by searching for existing code fragments or reusing the previous code.In recent years,there have been many external code search tools in the industry to help developers.However,using these tools will increase the time for developers to search and filter,and reduce the coding efficiency,so it is urgent to develop a code recommendation system that integrates with programming.This thesis relies on the Mooctest Web IDE system to update and optimize,and implements an intelligent code recommendation system based on structure embedding analysis.When users perform programming exercises or exams,they access the system through a browser and use an intelligent editor for online programming.The system will monitor the user's programming behavior and grab code information for analysis.Recommend code fragments to users based on the analysis results.Code recommendation relies on a large amount of source code data,so it is first necessary to build a corpus based on a large amount of source code and preprocess it.The code in the corpus needs to perform lexical and grammatical analysis first,construct a parse tree,and obtain a token sequence to represent the structure characteristics of the code.Secondly,use local sensitive hash to classify all token sequence sets in the corpus to reduce the number of comparisons and improve efficiency.Then,the candidate code fragments with high similarity are trained by word embedding,and then sentence embedding is performed to obtain a vector representation.Finally,the similarity analysis algorithm compares the sentence vectors and recommends to the user a similarity value above the threshold and different first few source code fragments to help the user obtain valuable recommendations based on the existing source code,thereby improving productivity and helping Reduce development time.According to the main functions and characteristics,the system is divided into five modules,including editor module,language service agreement module,code search module,feature extraction module,and feature sequence analysis module.The system uses Monaco Editor as the main editor base,and follows the language service agreement to implement real-time code completion,floating prompts,jump definitions,reference search,code diagnosis and other intelligent functions in Java,Python and other programming languages.To ensure data reliability and high availability,the system uses a search engine for data collection,processing and storage.At present,the system has replaced the original Mooctest Web IDE system for online use.Experiments show that the system improves the programming experience of82.72% users on average.The intelligent code recommendation system effectively recommends code fragments to help users reuse or correct existing codes when they are developed.The system reduces user search time,shortens development time,and improves user coding efficiency.And its simple and easy-to-use interface and interactive style,in line with most user habits,improve and improve the user programming experience.
Keywords/Search Tags:Web IDE, Code Recommendation, Locality Sensitive Hashing, Structure Embedding, Similarity Analysis
PDF Full Text Request
Related items