skip to main content
10.1145/1062455.1062491acmconferencesArticle/Chapter ViewAbstractPublication PagesicseConference Proceedingsconference-collections
Article

Using structural context to recommend source code examples

Published:15 May 2005Publication History

ABSTRACT

When coding to a framework, developers often become stuck, unsure of which class to subclass, which objects to instantiate and which methods to call. Example code that demonstrates the use of the framework can help developers make progress on their task. In this paper, we describe an approach for locating relevant code in an example repository that is based on heuristically matching the structure of the code under development to the example code. Our tool improves on existing approaches in two ways. First, 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. Second, the repository can be generated easily from existing applications. We demonstrate the utility of this approach by reporting on a case study involving two subjects completing four programming tasks within the Eclipse integrated development environment framework.

References

  1. I. D. Baxter, A. Yahin, L. M. D. Moura, M. Sant'Anna, and L. Bier. Clone detection using abstract syntax trees. In Proc. of Int'l Conf. on Soft. Maintenance, pages 368--377, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. D. Cubranic and G. C. Murphy. Hipikat: Recommending pertinent software development artifacts. In Proc. of the 25th Int'l Conf. on Software Engineering, pages 408--418, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. S. Henninger. Retrieving software objects in an example-based programming environment. In Proc. of the 14th Int'l ACM SIGIR Conf. on Research and Development in Information Retrieval, pages 251--260, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. R. Hill and J. Rideout. Automatic method completion. In Proc. of the 19th IEEE Int'l Conf. on Automated Software Engineering, pages 228--235, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. R. Holmes. Using structural context to recommend source code examples. Master's thesis, University of British Columbia, 2004.Google ScholarGoogle Scholar
  6. K. Inoue, R. Yokomori, H. Fujiwara, T. Yamamoto, M. Matsushita, and S. Kusumoto. Component rank: Relative significance rank for software component search. In Proc. of the 25th Int'l Conf. on Software Engineering, pages 14--24, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. R. E. Johnson. Documenting frameworks using patterns. In Proc. of the Conf. on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA), pages 63--72, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. A. Michail. Data mining library reuse patterns using generalized association rules. In Proc. of the 22nd Int'l Conf. on Software Engineering, pages 167--176, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. A. Michail. Code web: Data mining library reuse patterns. In Proc. of the 23rd Int'l Conf. on Software Engineering, pages 827--828. IEEE Computer Society, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. L. R. Neal. A system for example-based programming. In Proc. of the SIGCHI Conf. on Human Factors in Computing Systems, pages 63--68. ACM Press, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. E. Rissland. Examples and learning systems. In Adaptive Control of Ill-Defined Systems. Plenum, 1983.Google ScholarGoogle Scholar
  12. M. B. Rosson and J. M. Carroll. The reuse of uses in Smalltalk programming. ACM Transactions on Computer-Human Interaction, 3(3):219--253, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Y. Ye and G. Fischer. Supporting reuse by delivering task-relevant and personalized information. In Proc. of the 24th Int'l Conf. on Software Engineering, pages 513--523, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Y. Ye, G. Fischer, and B. Reeves. Integrating active information delivery and reuse repository systems. In Foundations of Software Engineering, pages 60--68, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Using structural context to recommend source code examples

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in
      • Published in

        cover image ACM Conferences
        ICSE '05: Proceedings of the 27th international conference on Software engineering
        May 2005
        754 pages
        ISBN:1581139632
        DOI:10.1145/1062455

        Copyright © 2005 ACM

        Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 15 May 2005

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • Article

        Acceptance Rates

        Overall Acceptance Rate276of1,856submissions,15%

        Upcoming Conference

        ICSE 2025

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader