Font Size: a A A

Research On API Recommendation Using Hierarchical Context

Posted on:2021-02-18Degree:MasterType:Thesis
Country:ChinaCandidate:R S XieFull Text:PDF
GTID:2518306476453344Subject:Computer technology
Abstract/Summary:PDF Full Text Request
Application programming interface(API)technology provides convenience for program development and expands reuse for mature solutions to complex problems.It is considered to be a practical and effective way to solve software crises and improve software development quality and efficiency.When applying APIs for development,the cost of sorting out available APIs is relatively high,and API recommendation techniques are usually needed to assist.Context-aware API recommendation technology is one of the most widely used approaches.It uses historical project codes and code context matching to recommend target API methods to improve recommendation accuracy,and software development efficiency and quality.The traditional context-based API recommendation technology ignores the use of the project's own API.This way of restricting the use of the project's own methods will result in the lack of contextual information and affect the validity of API recommendation results.In order to make full use of the contextual information implicit in the project's own methods,this thesis proposes an API recommendation technology based on hierarchical context,which includes:(1)A code context model based on call graph,that is,hierarchical context,which can obtain multi-level structure information in the code context by analyzing methods call graphs.(2)An approach used to express and model API methods,especially the project's own methods,as the hierarchical context model,mining the multi-level structural relationship between APIs,and enhancing the ability to express context.(3)a hierarchical inference model based on the hierarchical context model of the API methods,which uses the hierarchical context of history projects as training set,and fully considers the characteristics of different types of APIs in the context,and distinguish the contributions of different API types to the target objects' candidate API methods.The API recommendation technology based on hierarchical context can accurately analyze the project's own methods,more effectively use the implicit association between APIs in the context,and improve the accuracy of API recommendations.Meanwhile,this thesis implements the API recommendation tool Hi Rec.Through the use of hierarchical context approach,this tool can support the recommendation of third-party APIs and projectspecific methods in different programming scenarios.This thesis selects 108 open source projects to build experiments,using Top-N measures to evaluate the recommendation accuracy,analyzing the recommendation time cost,and comparing the recommendation efficiency with other existing technology.The results show that the API recommendation technology based on hierarchical context can get more accurate recommendation results than other technologies on Top-5 and Top-10 accuracy.And in terms of Top-1 accuracy,it is very close to the performance of similar technologies;in most cases,the average running time of the recommendation is less than 1 second,which meets the efficiency requirements of the IDE for the recommendation tool interaction.In addition,compared with other technologies,the recommendation effect of this technology will not be affected by the recommendation position.And the accuracy of the recommendation results increases with the size of training data set and the length of hierarchical context.
Keywords/Search Tags:API recommendation, Hierarchical context, Inference model, Statistic learning
PDF Full Text Request
Related items