| With the rapid development of computer technology,the development requirements and difficulty of various types of software and application programs are increasing.The research and application of API(Application Programming Interface)recommendation technology has great research potential and research value.The efficiency of current software development and the quality of software development largely depends on the recommended results of API methods.It can quickly provide developers with accurate API methods to deliver feature-rich software,and to a certain extent guarantees the method practicality greatly saves the developer’s time and improves the efficiency of project and software development.Existing methods mainly focus on obtaining information from the context of the program during the recommendation process,recommend relevant results based on the characteristics of code language repeatability and predictability,and do not consider the inheritance relationship of the class to which the method belongs.All the methods in the same inheritance relationship system may be necessary to solve a certain problem.These methods should be regarded as important candidate results in the recommendation process.In fact,in practical application scenarios,methods belonging to different classes are intended to be used together to form a rich API method network for solving large-scale software problems with complex functions.However,traditional API recommendation methods do not consider other methods in the inheritance system of the class to which the method belongs,resulting in insufficient accuracy in the final recommendation result.In response to the above problems,this article proposes an API recommendation method based on class inheritance analysis,namely InhRec.InhRec divides the class and the methods belonging to the class into a hierarchical structure according to the declaration order of class inheritance.The class to which the recommended object belongs is called a low-level class.In the inheritance declaration order,the class from superclass of the class to the Object are called high-level classes.By classifying the methods according to the hierarchical relationship between the classes to which they belong,extracting the dependency information between the methods belonging to different levels,and analyzing the dependency information between the methods to determine the relationship between the methods belonging to different levels.For methods that belong to high-level classes,the dependence of low-level methods on them,the historical use frequency of their own methods,according to the hierarchy of the class to which they belong,reasonably increase the recommended priority of such methods to eliminate traditional API recommended methods for the impact of insufficient recommendation of high-level class methods,the API recommendation candidate pool is expanded,so that the accuracy of the recommendation results is higher.In this paper,106 projects were selected to build evaluation experiments,and compared with four existing API recommendation technologies,such as APIREC and GraLan,to evaluate the effectiveness and efficiency of this technology.The experimental results show that for the projects with strong logical relationships between different levels of methods,the accuracy of the top-5 and top-10 indicators in this paper is about 7 percent higher than the existing API recommendation technology.At the same time,the API of this article recommends that the average execution time should be controlled below 1s to meet the actual development needs. |