Font Size: a A A

JavaScript Code Recommendation Based On Program Analysis And Machine Learning

Posted on:2015-06-05Degree:MasterType:Thesis
Country:ChinaCandidate:T WuFull Text:PDF
GTID:2298330452464172Subject:Software engineering
Abstract/Summary:PDF Full Text Request
Integrated Development Environment (IDE) is an application to helpdevelopers with program development and it is widely used in the process ofprogram development. Existing mainstream IDEs such as Eclipse and VisualStudio provide functions of compiling code, project management, andintegration testing and so on. They also offer a powerful mechanism ofextendable plug-ins on the basis of these features, which makes the researchon optimization tools of IDEs become increasingly popular.In an actual project development process, code recommendation or codecompletion, as a quite useful auxiliary function, is provided by almost all ofthe Integrated Development Environments. Code recommendation canprovide proposals including methods, properties, and parameters whendevelopers write codes and improve software development efficiency. It canshorten study time of libraries or frameworks which the developers are notfamiliar with, reduce the burden of typing the full method name and avoidspelling errors during writing codes. Because of the convenience brought bycode recommendation for the project development process, there have beenmore and more researches on this area in recent years.As a popular script language, JavaScript is mainly used in browserapplications and has become the most prevalent client-side script language.JavaScript is used in more and more fields, such as Windows8andserver-side applications. And the appearance of efficient JavaScript executionengines such as V8make JavaScript play a greater role in more fields.However, in terms of the code recommendation for JavaScript language,it has the problems of low precise and slow response for the traditional coderecommendation methods which are based on type system established bytype analysis. Especially, JavaScript is a weakly type program language, and has highly dynamic characteristics, making the analysis of JavaScript becomechallenging.Aiming at the above problems, this paper proposed a coderecommendation method based on dynamic analysis and machine learningand implements a code recommendation plug-in for Eclipse based on theresearch on existing JavaScript code recommendation methods. Thisapproach builds model offline for storing the simulated runtime environment,and creates indexes for all objects in the environment. Simulate executinguser code, while applying abstract syntax tree of user code for blocking andupdating undefined variables at runtime.Based on the above methods, this paper designs the coderecommendation method based on program analysis and machine learning indetail. We make the design with good scalability and modifiability byapplying the design thinking of "high cohesion, low coupling" and ultimatelyimplement an Eclipse plug-in for code recommendation.Finally, this paper has conducted several experiments on this JavaScriptcode recommendation tool compared with current code recommendationtools with static analysis, the experiments show that the tool improves boththe precise and response time.
Keywords/Search Tags:code recommendation, dynamic analysis, Eclipse plugin, simulated execution, machine learning
PDF Full Text Request
Related items