Font Size: a A A

Research On API Usage Patterns And Parameters Recommendation Based On Context Information

Posted on:2021-12-16Degree:MasterType:Thesis
Country:ChinaCandidate:Y F ZhangFull Text:PDF
GTID:2518306479960819Subject:Software engineering
Abstract/Summary:PDF Full Text Request
Developers are often faced with unfamiliar problems and difficulties during making programming tasks.Application programming interfaces(APIs)do good help to solve these difficulties.However,it is how to select APIs and use their parameters correctly that is still a huge challenge for developers.Therefore,it is realistic and meaningful to recommend API usage patterns and parameters precisely and validly in order to solve the problems that developers meet.In this thesis,we propose SSAPIR which is a semantic similarity based API usage patterns recommendation approach.Given a natural language query as input,SSAPIR can recommend precise API usage patterns by leveraging context information on programming scenes.Firstly,SSAPIR analyses high-quality java open source projects,aiming to leverage abstract syntax tree parsing technology to extract context information of java methods as metadata structure which includes the sequence of API invocations,descriptive information and method signature.Secondly,SSAPIR makes cluster analysis for the metadata structure by a hierarchical clustering algorithm.Then,SSAPIR extracts the semantic information of the natural language queries that developers input.Ultimately,SSAPIR leverages semantic similarity algorithm to recommend the API usage patterns with highest similarity by matching the semantic information and the descriptive information.Developers will still have the difficulty of selecting API parameters,even if they have been recommended precise API usage patterns.Thus,in this thesis,we propose an approach of API parameters recommendation based on the context information.Our approach can obtain context information on programming scenes and then recommends API parameters for developers.First,the approach analyses the source codes of the third-party API libraries and invocations in java methods by leveraging abstract syntax tree parsing so as to find invocation nodes,SEEDs,which holds parameters.Then,the approach makes forward slicing to extract context information of the SEEDs by code slicing technology.Finally,the approach makes data preprocessing to build a training set and takes the training set as the input of a encode-decoder model based on recurrent neural network.By leveraging the trained model and the context information on programming scenes,the approach can realize the recommendation of API parameters.
Keywords/Search Tags:API usage patterns, abstract syntax tree parsing, hierarchical clustering, semantic similarity, API parameters recommendation, program slicing, recurrent neural network
PDF Full Text Request
Related items