Font Size: a A A

Design And Implementation Of API Recommendation Based On Information Retrieval

Posted on:2017-12-22Degree:MasterType:Thesis
Country:ChinaCandidate:W H SongFull Text:PDF
GTID:2428330590488893Subject:Software engineering
Abstract/Summary:PDF Full Text Request
How to improve the efficiency of software development has long been a central issue in the field of software engineering.Recent years,with the development of Internet industry and advances in computer science,development tasks are becoming more and more complex which causes the emergence of more complex program libraries aimed at helping developers simplify the development process.When developers look for APIs that can complete a specific task,they usually review and select by means of a search engine or API documentation.It is especially the case when working on unfamiliar development areas or function module.However,due to search results of traditional search engine spreading across multiple pages,the fragmentation of information make it very time consuming to find the key information.Searching directly in the API documentation is also very complicated and inconvenient.Although there are a lot work related to API understanding and code search in industry and academia,work and tools that can recommend API methods to users based on their description of API's functionality is still very limited.To solve these problems,we propose a search based algorithm on API method recommendation.The algorithm can recommend relevant API methods to users based on their input.Unlike keyword based search algorithm,the algorithm of this paper allows the user to enter a free text description of API's function,and in the description the user can also mix in type information which improves the user experience.For user input,the algorithm will first extract key semantic information and type information contained therein by natural language processing techniques and type recognition algorithm.Semantic information and type information will then match against API methods in the program library repositories.This algorithm combined semantic relevance,type relevance and the extent of degree API method is used to sort these API methods and put those that are highly relevant and widely used in top positions,so that the user can quickly get the information needed.Finally,the algorithm present relevant API methods to the user in the form of a list.When showing the results of the algorithm,code examples in real projects will be provided with API methods to help users learn and understand.This paper implemented an API method recommending tool called APIBook for the Java programming language based on the described algorithm.APIBook selected the Java Standard Library as well as 100 popular open source libraries as API Recommending material.Users can input via APIBook's Web interface,and view the results and sample code on screen.In order to verify the effectiveness of the algorithms and the tool,this paper selected 70 most popular API-related questions from the Java section in StackOverflow programming forum and use questions' titles as the API function description to make a query on APIBook,and then compare the effectiveness and efficiency of APIBook and traditional retrieval model in API method recommendation.Experiments show that the algorithm of APIBook is more effective than traditional retrieval model.And it took an average of 0.7 seconds in the query which meets the daily query requirements.
Keywords/Search Tags:API, Information Retrieval, Code Recommendation, Program Analysis
PDF Full Text Request
Related items