[go: up one dir, main page]
More Web Proxy on the site http://driver.im/ skip to main content
10.5555/2337223.2337321acmconferencesArticle/Chapter ViewAbstractPublication PagesicseConference Proceedingsconference-collections
Article

Automatic parameter recommendation for practical API usage

Published: 02 June 2012 Publication History

Abstract

Programmers extensively use application programming interfaces (APIs) to leverage existing libraries and frameworks. However, correctly and efficiently choosing and using APIs from unfamiliar libraries and frameworks is still a non-trivial task. Programmers often need to ruminate on API documentations (that are often incomplete) or inspect code examples (that are often absent) to learn API usage patterns. Recently, various techniques have been proposed to alleviate this problem by creating API summarizations, mining code examples, or showing common API call sequences. However, few techniques focus on recommending API parameters.
In this paper, we propose an automated technique, called Precise, to address this problem. Differing from common code completion systems, Precise mines existing code bases, uses an abstract usage instance representation for each API usage example, and then builds a parameter usage database. Upon a request, Precise queries the database for abstract usage instances in similar contexts and generates parameter candidates by concretizing the instances adaptively.
The experimental results show that our technique is more general and applicable than existing code completion systems, specially, 64% of the parameter recommendations are useful and 53% of the recommendations are exactly the same as the actual parameters needed. We have also performed a user study to show our technique is useful in practice.

References

[1]
Apache Tomcat. http://tomcat.apache.org/.
[2]
Eclipse Code Recommenders. http://www.eclipse.org/recommenders/.
[3]
Eclipse JDT API Specification, Eclipse documentation. http://help.eclipse.org/helios/index.jsp.
[4]
Eclipse Project. http://www.eclipse.org/.
[5]
JBoss Application Server. http://www.jboss.org/jbossas/.
[6]
SWT: The Standard Widget Toolkit. http://www.eclipse.org/swt/.
[7]
The Java Language Specification, Third Edition. http://docs.oracle.com/javase/specs/jls/se5.0/html/j3TOC.html.
[8]
Sushil Bajracharya, Joel Ossher, and Cristina Lopes. Sourcerer: An internet-scale software repository. In Proceedings of the 2009 ICSE Workshop on Search-Driven Development-Users, Infrastructure, Tools and Evaluation, SUITE '09, pages 1-4, Washington, DC, USA, 2009. IEEE Computer Society.
[9]
Marcel Bruch, Martin Monperrus, and Mira Mezini. Learning from examples to improve code completion systems. In Proceedings of the the 7th joint meeting of the European Software Engineering Conference and the ACM SIGSOFT symposium on The Foundations of Software Engineering, ESEC/FSE '09, pages 213-222, New York, NY, USA, 2009. ACM.
[10]
Shaunak Chatterjee, Sudeep Juvekar, and Koushik Sen. Sniff: A search engine for Java using free-form queries. In Proceedings of the 12th International Conference on Fundamental Approaches to Software Engineering: Held as Part of the Joint European Conferences on Theory and Practice of Software, ETAPS 2009, FASE '09, pages 385-400, Berlin, Heidelberg, 2009. Springer-Verlag.
[11]
Barthélémy Dagenais and Martin P. Robillard. Recommending adaptive changes for framework evolution. In Proceedings of the 30th International Conference on Software Engineering, ICSE '08, pages 481-490, New York, NY, USA, 2008. ACM.
[12]
Sumit Gulwani. Dimensions in program synthesis. In Proceedings of the 12th international ACM SIGPLAN symposium on Principles and Practice of Declarative Programming, PPDP '10, pages 13-24, New York, NY, USA, 2010. ACM.
[13]
Mark Hall, Eibe Frank, Geoffrey Holmes, Bernhard Pfahringer, Peter Reutemann, and Ian H. Witten. The WEKA data mining software: an update. SIGKDD Explor. Newsl., 11:10-18, November 2009.
[14]
Daqing Hou and David M. Pletcher. Towards a better code completion system by API grouping, filtering, and popularitybased ranking. In Proceedings of the 2nd International Workshop on Recommendation Systems for Software Engineering, RSSE '10, pages 26-30, New York, NY, USA, 2010. ACM.
[15]
David Kawrykow and Martin P. Robillard. Improving API usage through automatic detection of redundant code. In Proceedings of the 2009 IEEE/ACM International Conference on Automated Software Engineering, ASE '09, pages 111- 122, Washington, DC, USA, 2009. IEEE Computer Society.
[16]
David Mandelin, Lin Xu, Rastislav Bodík, and Doug Kimelman. Jungloid mining: helping to navigate the API jungle. In Proceedings of the 2005 ACM SIGPLAN conference on Programming Language Design and Implementation, PLDI '05, pages 48-61, New York, NY, USA, 2005. ACM.
[17]
Hoan Anh Nguyen, Tung Thanh Nguyen, Gary Wilson, Jr., Anh Tuan Nguyen, Miryung Kim, and Tien N. Nguyen. A graph-based approach to API usage adaptation. In Proceedings of the ACM international conference on Object Oriented Programming Systems Languages and Applications, OOPSLA '10, pages 302-321, New York, NY, USA, 2010. ACM.
[18]
Michael Pradel and Thomas R. Gross. Detecting anomalies in the order of equally-typed method arguments. In Proceedings of the 20th International Symposium on Software Testing and Analysis, ISSTA '11, pages 232-242, 2011.
[19]
Romain Robbes and Michele Lanza. Improving code completion with program history. Automated Software Eng., 17:181- 212, June 2010.
[20]
Martin P. Robillard. What makes APIs hard to learn? answers from developers. IEEE Softw., 26:27-34, November 2009.
[21]
Jeffrey Stylos, Brad A. Myers, and Zizhuang Yang. Jadeite: improving API documentation using usage information. In Proceedings of the 27th international conference Extended Abstracts on human factors in computing systems, CHI EA '09, pages 4429-4434, New York, NY, USA, 2009. ACM.
[22]
Suresh Thummalapenta and Tao Xie. Parseweb: a programmer assistant for reusing open source code on the web. In Proceedings of the twenty-second IEEE/ACM international conference on Automated Software Engineering, ASE '07, pages 204-213, New York, NY, USA, 2007. ACM.
[23]
Ian H. Witten and Eibe Frank. Data Mining: Practical Machine Learning Tools and Techniques, Second Edition. Morgan Kaufmann, 2005.

Cited By

View all

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
ICSE '12: Proceedings of the 34th International Conference on Software Engineering
June 2012
1657 pages
ISBN:9781467310673

Sponsors

Publisher

IEEE Press

Publication History

Published: 02 June 2012

Check for updates

Qualifiers

  • Article

Conference

ICSE '12
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)1
  • Downloads (Last 6 weeks)0
Reflects downloads up to 01 Jan 2025

Other Metrics

Citations

Cited By

View all
  • (2023)Animation2API: API Recommendation for the Implementation of Android UI AnimationsIEEE Transactions on Software Engineering10.1109/TSE.2023.329497149:9(4411-4428)Online publication date: 11-Aug-2023
  • (2021)Understanding Software-2.0ACM Transactions on Software Engineering and Methodology10.1145/345347830:4(1-42)Online publication date: 23-Jul-2021
  • (2021)A Theory of Robust API KnowledgeACM Transactions on Computing Education10.1145/344494521:1(1-32)Online publication date: 28-Jan-2021
  • (2021)Practical heuristics to improve precision for erroneous function argument swapping detection in C and C++Journal of Systems and Software10.1016/j.jss.2021.111048181:COnline publication date: 1-Nov-2021
  • (2019)A vision for helping developers use APIs by leveraging temporal patternsProceedings of the 7th International Workshop on Formal Methods in Software Engineering10.1109/FormaliSE.2019.00019(95-98)Online publication date: 27-May-2019
  • (2019)Combining program analysis and statistical language model for code statement completionProceedings of the 34th IEEE/ACM International Conference on Automated Software Engineering10.1109/ASE.2019.00072(710-721)Online publication date: 10-Nov-2019
  • (2018)Exploring the use of automated API migrating techniques in practiceProceedings of the 15th International Conference on Mining Software Repositories10.1145/3196398.3196420(503-514)Online publication date: 28-May-2018
  • (2017)More accurate recommendations for method-level changesProceedings of the 2017 11th Joint Meeting on Foundations of Software Engineering10.1145/3106237.3106276(798-808)Online publication date: 21-Aug-2017
  • (2017)Suggesting API Usage to Novice Programmers with the Example GuruProceedings of the 2017 CHI Conference on Human Factors in Computing Systems10.1145/3025453.3025827(1105-1117)Online publication date: 2-May-2017
  • (2016)An exploratory study on change suggestions for methods using clone detectionProceedings of the 26th Annual International Conference on Computer Science and Software Engineering10.5555/3049877.3049886(85-95)Online publication date: 31-Oct-2016
  • Show More Cited By

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