ABSTRACT
Reusing APIs of existing libraries is a common practice during software development, but searching suitable APIs and their usages can be time-consuming [6]. In this paper, we study a new and more practical approach to help users find usages of APIs given only simple text phrases, when users have limited knowledge about an API library. We model API invocations as an API graph and aim to find an optimum connected subgraph that meets users' search needs.
The problem is challenging since the search space in an API graph is very huge. We start with a greedy subgraph search algorithm which returns a connected subgraph containing nodes with high textual similarity to the query phrases. Two refinement techniques are proposed to improve the quality of the returned subgraph. Furthermore, as the greedy subgraph search algorithm relies on online query of shortest path between two graph nodes, we propose a space-efficient compressed shortest path indexing scheme that can efficiently recover the exact shortest path. We conduct extensive experiments to show that the proposed subgraph search approach for API recommendation is very effective in that it boosts the average F1-measure of the state-of-the-art approach, Portfolio [15], on two groups of real-life queries by 64% and 36% respectively.
- S. K. Bajracharya, T. C. Ngo, E. Linstead, Y. Dou, P. Rigor, P. Baldi, and C. V. Lopes. Sourcerer: a search engine for open source code supporting structure-based search. In OOPSLA Companion, pages 681--682, 2006. Google ScholarDigital Library
- S. Brin and L. Page. The anatomy of a large-scale hypertextual web search engine. Computer Networks, 30(1--7):107--117, 1998. Google ScholarDigital Library
- S.-J. Chen and L. Lin. Modeling team member characteristics for the formation of a multifunctional team in concurrent engineering. IEEE Transactions on Engineering Management, 51(2):111--124, 2004.Google ScholarCross Ref
- F. Crestani. Application of spreading activation techniques in information retrieval. Artif. Intell. Rev., 11(6):453--482, 1997. Google ScholarDigital Library
- K. Grant and D. Mould. Combining heuristic and landmark search for path planning. In Future Play, pages 9--16, 2008. Google ScholarDigital Library
- R. Hoffmann, J. Fogarty, and D. S. Weld. Assieme: finding and leveraging implicit references in a web search interface for programmers. In UIST, pages 13--22, 2007. Google ScholarDigital Library
- F. K. Hwang, D. S. Richards, and P. Winter. The Steiner Tree Problem. North-Holland, Amsterdam, Netherlands, 1992.Google ScholarCross Ref
- K. Kamel, N. Tubaiz, O. AlKoky, and Z. AlAghbari. Toward forming an effective team using social network. In IIT, pages 308--312, 2011.Google ScholarCross Ref
- M. Kargar and A. An. Keyword search in graphs: Finding r-cliques. PVLDB, 4(10):681--692, 2011. Google ScholarDigital Library
- A. J. Ko, B. A. Myers, and H. H. Aung. Six learning barriers in end-user programming systems. In VL/HCC, pages 199--206, 2004. Google ScholarDigital Library
- T. Lappas, K. Liu, and E. Terzi. Finding a team of experts in social networks. In KDD, pages 467--476, 2009. Google ScholarDigital Library
- C.-T. Li and M.-K. Shan. Team formation for generalized tasks in expertise social networks. In SocialCom/PASSAT, pages 9--16, 2010. Google ScholarDigital Library
- F. Long, X. Wang, and Y. Cai. Api hyperlinking via structural overlap. In ESEC/SIGSOFT FSE, pages 203--212, 2009. Google ScholarDigital Library
- D. Mandelin, L. Xu, R. Bodík, and D. Kimelman. Jungloid mining: helping to navigate the api jungle. In PLDI, pages 48--61, 2005. Google ScholarDigital Library
- C. McMillan, M. Grechanik, D. Poshyvanyk, Q. Xie, and C. Fu. Portfolio: finding relevant functions and their usage. In ICSE, pages 111--120, 2011. Google ScholarDigital Library
- C. McMillan, D. Poshyvanyk, and M. Grechanik. Recommending source code examples via api call usages and documentation. In Proceedings of the 2nd International Workshop on Recommendation Systems for Software Engineering, pages 21--25, 2010. Google ScholarDigital Library
- M. F. Porter. Readings in information retrieval. chapter An algorithm for suffix stripping, pages 313--316. Morgan Kaufmann Publishers Inc., San Francisco, CA, USA, 1997. Google ScholarDigital Library
- D. Puppin and F. Silvestri. The social network of java classes. In SAC, pages 1409--1413, 2006. Google ScholarDigital Library
- M. Qiao, H. Cheng, and J. X. Yu. Querying shortest path distance with bounded errors in large graphs. In SSDBM, pages 255--273, 2011. Google ScholarDigital Library
- C. Scaffidi. Why are apis difficult to learn and use? ACM Crossroads, 12(4):4, 2006. Google ScholarDigital Library
- H. Wi, S. Oh, J. Mun, and M. Jung. A team formation model based on knowledge and collaboration. Expert Syst. Appl., 36(5):9121--9134, 2009. Google ScholarDigital Library
- J. X. Yu, L. Qin, and L. Chang. Keyword search in relational databases: A survey. IEEE Data Eng. Bull., 33(1):67--78, 2010.Google Scholar
- Q. Zhang, W. Zheng, and M. R. Lyu. Flow-augmented call graph: A new foundation for taming api complexity. In FASE, pages 386--400, 2011. Google ScholarDigital Library
- W. Zheng, Q. Zhang, and M. R. Lyu. Cross-library api recommendation using web search engines. In SIGSOFT FSE, pages 480--483, 2011. Google ScholarDigital Library
- H. Zhong, T. Xie, L. Zhang, J. Pei, and H. Mei. Mapo: Mining and recommending api usage patterns. In ECOOP, pages 318--343, 2009. Google ScholarDigital Library
- A. Zzkarian and A. Kusiak. Forming teams: an analytical approach. IIE Transactions, 31:85--97, 1999.Google ScholarCross Ref
Index Terms
- Searching connected API subgraph via text phrases
Recommendations
API method recommendation without worrying about the task-API knowledge gap
ASE '18: Proceedings of the 33rd ACM/IEEE International Conference on Automated Software EngineeringDevelopers often need to search for appropriate APIs for their programming tasks. Although most libraries have API reference documentation, it is not easy to find appropriate APIs due to the lexical gap and knowledge gap between the natural language ...
Graph Embedding Based API Graph Search and Recommendation
AbstractSearching application programming interfaces (APIs) is very important for developers to reuse software projects. Existing natural language based API search mainly faces the following challenges. 1) More accurate results are required as software ...
The balanced connected subgraph problem
AbstractThe problem of computing induced subgraphs that satisfy some specified restrictions arises in various applications of graph algorithms and has been well studied. In this paper, we consider the following ▪ ( ▪ ) problem. The input is a ...
Comments