Searching Connected API Subgraph via Text Phrases
Conference Proceeding Article
Reusing APIs of existing libraries is a common practice during software development, but searching suitable APIs and their usages can be time-consuming . 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 , on two groups of real-life queries by 64% and 36% respectively.
Software and Cyber-Physical Systems
FSE '12: Proceedings of the ACM SIGSOFT 20th International Symposium on the Foundations of Software Engineering (FSE-20), Cary, North Carolina, 11-16 November 2012
City or Country
CHAN, Wing-Kwan; CHENG, Hong; and LO, David.
Searching Connected API Subgraph via Text Phrases. (2012). FSE '12: Proceedings of the ACM SIGSOFT 20th International Symposium on the Foundations of Software Engineering (FSE-20), Cary, North Carolina, 11-16 November 2012. Research Collection School Of Information Systems.
Available at: http://ink.library.smu.edu.sg/sis_research/1580