Issue No. 12 - December (2006 vol. 32)
DOI Bookmark: http://doi.ieeecomputersociety.org/10.1109/TSE.2006.117
Gail C. Murphy , IEEE Computer Society
Robert J. Walker , IEEE
When coding to an application programming interface (API), developers often encounter difficulties, unsure of which class to subclass, which objects to instantiate, and which methods to call. Example source code that demonstrates the use of the API can help developers make progress on their task. This paper describes an approach to provide such examples in which the structure of the source code that the developer is writing is matched heuristically to a repository of source code that uses the API. The structural context needed to query the repository is extracted automatically from the code, freeing the developer from learning a query language or from writing their code in a particular style. The repository is generated automatically from existing applications, avoiding the need for handcrafted examples. We demonstrate that the approach is effective, efficient, and more reliable than traditional alternatives through four empirical studies.
API usage, structural context, heuristic search, Strathcona, example recommendation.
Gail C. Murphy, Robert J. Walker, Reid Holmes, "Approximate Structural Context Matching: An Approach to Recommend Relevant Examples", IEEE Transactions on Software Engineering, vol. 32, no. , pp. 952-970, December 2006, doi:10.1109/TSE.2006.117