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

Cookbook: in situ code completion using edit recipes learned from examples

Published: 31 May 2014 Publication History

Abstract

Existing code completion engines leverage only pre-defined templates or match a set of user-defined APIs to complete the rest of changes. We propose a new code completion technique, called Cookbook, where developers can define custom edit recipes—a reusable template of complex edit operations—by specifying change examples. It generates an abstract edit recipe that describes the most specific generalization of the demonstrated example program transformations. Given a library of edit recipes, it matches a developer’s edit stream to recommend a suitable recipe that is capable of filling out the rest of change customized to the target. We evaluate Cookbook using 68 systematic changed methods drawn from the version history of Eclipse SWT. Cookbook is able to narrow down to the most suitable recipe in 75% of the cases. It takes 120 milliseconds to find the correct suitable recipe on average, and the edits produced by the selected recipe are on average 82% similar to developer’s hand edit. This shows Cookbook’s potential to speed up manual editing and to minimize developer’s errors. Our demo video is available at https://www.youtube.com/watch?v=y4BNc8FT4RU.

References

[1]
M. Bruch, M. Monperrus, and M. Mezini. Learning from examples to improve code completion systems. In ESEC/FSE ’09, 2009.
[2]
B. Fluri, M. Würsch, M. Pinzger, and H. C. Gall. Change distilling—tree differencing for fine-grained source code change extraction. TSE ’07, 2007.
[3]
S. R. Foster, W. G. Griswold, and S. Lerner. Witchdoctor: Ide support for real-time auto-completion of refactorings. In ICSE ’12, 2012.
[4]
X. Ge, Q. L. DuBose, and E. Murphy-Hill. Reconciling manual and automatic refactoring. In ICSE ’12, 2012.
[5]
Y. Y. Lee, S. Harwell, S. Khurshid, and D. Marinov. Temporal code completion and navigation. In ICSE ’13, 2013.
[6]
N. Meng, M. Kim, and K. McKinley. Lase: Locating and applying systematic edits. In ICSE ’13, 2013.
[7]
A. T. Nguyen, T. T. Nguyen, H. A. Nguyen, A. Tamrawi, H. V. Nguyen, J. Al-Kofahi, and T. N. Nguyen. Graph-based pattern-oriented, context-sensitive source code completion. In ICSE ’12, 2012.
[8]
C. Omar, Y. Yoon, T. D. LaToza, and B. A. Myers. Active code completion. In ICSE ’12, 2012.
[9]
R. Robbes and M. Lanza. How program history can improve code completion. In ASE ’08, 2008.

Cited By

View all
  • (2023)A Naive Approach for Automatic Line-level Code Completion2023 IEEE 9th International Women in Engineering (WIE) Conference on Electrical and Computer Engineering (WIECON-ECE)10.1109/WIECON-ECE60392.2023.10456476(137-142)Online publication date: 25-Nov-2023
  • (2021)Sequential coding patternsInformation and Software Technology10.1016/j.infsof.2021.106690140:COnline publication date: 1-Dec-2021
  • (2016)Automatic clustering of code changesProceedings of the 13th International Conference on Mining Software Repositories10.1145/2901739.2901749(61-72)Online publication date: 14-May-2016
  • Show More Cited By

Index Terms

  1. Cookbook: in situ code completion using edit recipes learned from examples

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    ICSE Companion 2014: Companion Proceedings of the 36th International Conference on Software Engineering
    May 2014
    741 pages
    ISBN:9781450327688
    DOI:10.1145/2591062
    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]

    Sponsors

    In-Cooperation

    • TCSE: IEEE Computer Society's Tech. Council on Software Engin.

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 31 May 2014

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. code completion
    2. edit recipe

    Qualifiers

    • Article

    Conference

    ICSE '14
    Sponsor:

    Acceptance Rates

    Overall Acceptance Rate 276 of 1,856 submissions, 15%

    Upcoming Conference

    ICSE 2025

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)6
    • Downloads (Last 6 weeks)2
    Reflects downloads up to 20 Jan 2025

    Other Metrics

    Citations

    Cited By

    View all
    • (2023)A Naive Approach for Automatic Line-level Code Completion2023 IEEE 9th International Women in Engineering (WIE) Conference on Electrical and Computer Engineering (WIECON-ECE)10.1109/WIECON-ECE60392.2023.10456476(137-142)Online publication date: 25-Nov-2023
    • (2021)Sequential coding patternsInformation and Software Technology10.1016/j.infsof.2021.106690140:COnline publication date: 1-Dec-2021
    • (2016)Automatic clustering of code changesProceedings of the 13th International Conference on Mining Software Repositories10.1145/2901739.2901749(61-72)Online publication date: 14-May-2016
    • (2016)A Simple, Efficient, Context-sensitive Approach for Code CompletionJournal of Software: Evolution and Process10.1002/smr.179128:7(512-541)Online publication date: 1-Jul-2016

    View Options

    Login options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media