skip to main content
10.1145/2380116.2380145acmconferencesArticle/Chapter ViewAbstractPublication PagesuistConference Proceedingsconference-collections
research-article

SnipMatch: using source code context to enhance snippet retrieval and parameterization

Published:07 October 2012Publication History

ABSTRACT

Programmers routinely use source code snippets to increase their productivity. However, locating and adapting code snippets to the current context still takes time: for example, variables must be renamed, and dependencies included. We believe that when programmers decide to invest time in creating a new code snippet from scratch, they would also be willing to spend additional effort to make that code snippet configurable and easy to integrate. To explore this insight, we built SnipMatch, a plug-in for the Eclipse IDE. SnipMatch introduces a simple markup that allows snippet authors to specify search patterns and integration instructions. SnipMatch leverages this information, in conjunction with current code context, to improve snippet search and parameterization. For example, when a search query includes local variables, SnipMatch suggests compatible snippets, and automatically adapts them by substituting in these variables. In the lab, we observed that participants integrated snippets faster when using SnipMatch than when using standard Eclipse. Findings from a public deployment to 93 programmers suggest that SnipMatch has become integrated into the work practices of real users.

Skip Supplemental Material Section

Supplemental Material

paper_0322-file3.m4v

m4v

5.6 MB

References

  1. Adar, E., Dontcheva, M., Fogarty, J., and Weld, D. S. Zoetrope: Interacting with the Ephemeral Web. In Proc. UIST. pp. 239--48, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Bajracharya, S., T. Ngo, et al. Sourcerer: A Search Engine for Open Source Code Supporting Structure-Based Search. In Companion to OOPSLA: ACM SIGPLAN. pp. 681--82, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Brandt, J., Dontcheva, M., Weskamp, M., Klemmer, S. R. Example-centric programming: integrating web search into the development environment. In Proc. CHI. pp. 513--522, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Brandt, J., Guo, P. J., Lewenstein, J., Dontcheva, M., Klemmer, S. R. 2009. Opportunistic Programming: Writing Code to Prototype, Ideate, and Discover. IEEE Software, 26 (5), 18--24. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Brandt, J., Guo, P. J., Lewenstein, J., Dontcheva, M., Klemmer, S. R. Two Studies of Opportunistic Programming: Interleaving Web Foraging, Learning, and Writing Code. In Proc. CHI. pp. 1589--1598, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Dontcheva, M., Drucker, S. M., Salesin, D., and Cohen, M. F. Relations, cards, and search templates: user-guided web data integration and layout. In Proc. UIST. pp. 61--70, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Dörner, C., Myers, B. A. EUKLAS, Plug-in for Eclipse IDE. http://www.cs.cmu.edu/~euklas.Google ScholarGoogle Scholar
  8. Eclipse Quick Fix. http://wiki.eclipse.org/FAQ_What_is_a_Quick_Fix%3FGoogle ScholarGoogle Scholar
  9. Eclipse Templates. http://www.ibm.com/developerworks/opensource/tutorials/os-eclipse-code-templates/index.htmlGoogle ScholarGoogle Scholar
  10. Furnas, G. W., Landauer, T. K., Gomez, L. M., and Dumais, S. T. The vocabulary problem in human-system communication. CACM 30, 11 (Nov 1987), 964--971. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Google Code Search. http://www.google.com/codesearchGoogle ScholarGoogle Scholar
  12. Gray, W. D. and D. A. Boehm-Davis. Milliseconds Matter: An Introduction to Microstrategies and to Their Use in Describing and Predicting Interactive Behavior. Journal of Experimental Psychology: Applied 6(4). pp. 322--35, 2000.Google ScholarGoogle ScholarCross RefCross Ref
  13. Hartmann, B., MacDougall, D., Brandt, J., and Klemmer, S. What Would Other Programmers Do? Suggesting Solutions to Error Mes-sages. In Proc. CHI. pp. 1019--1028, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Hearst, M. Search User Interfaces, Cambridge University Press, Cambridge, UK, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Hoffmann, R., Fogarty, J., and Weld, D. S. Assieme: Finding and Leveraging Implicit References in a Web Search Interface for Pro-grammers. In Proc. UIST. pp. 13--22, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Holmes, R., Murphy, G. C. Using structural context to recommend source code examples. In Proc. ICSE. pp. 117--125, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Jones, K. S. A Statistical Interpretation of Term Specificity and Its Application in Retrieval. Journal of Documentation 28: 11, 1972.Google ScholarGoogle ScholarCross RefCross Ref
  18. Little, G. and Miller, R. C. Keyword Programming in Java. In Proc. ASE. pp. 84--93, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Little, G. and Miller, R. C. Translating keyword commands into executable code. In Proc. UIST. pp. 135--144, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Little, G., Lau, T.A., Cypher, A., Lin, J., Haber, E. M., Kandogan, E. Koala: capture, share, automate, personalize business processes on the web. In Proc. CHI. pp. 943--946, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. M. Kim, L. Bergman, T. Lau, and D. Notkin. An ethnographic study of copy and paste programming practices in OOPL. In Proc. ESEM. pp. 83--92 , 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Mamykina, L., Manoim, B., Mittal, M., Hripcsak, G., Hartmann, B. 2011. Design lessons from the fastest q&a site in the west. In Proc. CHI. pp. 2857--2866, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Mandelin, D., Xu, L., Bodík, R., and Kimelman, D. Jungloid Mining: Helping to Navigate the API Jungle. In Proc. PLDI. pp. 48--61, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Medynskiy, Y., Dontcheva M., and Drucker, S. M. Exploring Web-sites through Contextual Facets. In Proc. CHI. pp. 2013--22, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Miller, R. C., Chou, V. H., Bernstein, M., Little, G., Van Kleek, M., Karger, D., and Schraefel, M. Inky: a sloppy command line for the web with rich visual feedback. In Proc. UIST. pp. 131--140, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Morville, P., and Callender, J. Search Patterns: Design for Discovery. O'Reilly Media, Inc., 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Oney, S., Brandt, J. Codelets: Linking Interactive Documentation and Example Code in the Editor. To appear in Proc. CHI. 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Reiss, S. P. Semantics-based code search. ICSE 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Sahavechaphan, N. and Claypool, K. XSnippet: Mining for Sample Code. In Proc. of OOPSLA. pp. 413--30, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Stylos, J. and Myers, B. A. Mica: A Web-Search Tool for Finding API Components and Examples. In Proc. VL/HCC. pp. 195--202, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Teevan, J., Cutrell, E., et al. Visual Snippets: Summarizing Web Pages for Search and Revisitation. In Proc. CHI. pp. 2023--32, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Thummalapenta, S. and Xie, T. PARSEweb: A Programmer Assistant for Reusing Open Source Code on the Web. In Proc. ASE. pp. 204--13, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Xie, T., Pei, J. MAPO: Mining API usages from open source repositories. In Proc. MSR. pp. 54--57, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Yeh, R. B., Paepcke, A., and Klemmer, S.R. Iterative Design and Evaluation of an Event Architecture for Pen-and-Paper Interfaces. In Proc. UIST. pp. 111--120, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. SnipMatch: using source code context to enhance snippet retrieval and parameterization

    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
      UIST '12: Proceedings of the 25th annual ACM symposium on User interface software and technology
      October 2012
      608 pages
      ISBN:9781450315807
      DOI:10.1145/2380116

      Copyright © 2012 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: 7 October 2012

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • research-article

      Acceptance Rates

      Overall Acceptance Rate842of3,967submissions,21%

      Upcoming Conference

      UIST '24

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader