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

Mining unit tests for code recommendation

Published: 02 June 2014 Publication History

Abstract

Developers spend a significant portion of their time understanding and learning the correct usage of the APIs of libraries they want to integrate in their projects. However, learning how to effectively use APIs is complex and time consuming. Code recommendation systems play a crucial role facilitating developers in this task by providing to them relevant examples while they code. This paper proposes a novel approach to code recommendation in which code examples are automatically obtained by mining and manipulating unit tests. In this paper we discuss the theoretical and practical implications that underpin this idea. The discussion leads to a series of fascinating research challenges that we organized in a research agenda.

References

[1]
M. Bruch, M. Monperrus, and M. Mezini. Learning from examples to improve code completion systems. ESEC/FSE ’09, pages 213–222. ACM, 2009.
[2]
R. P. L. Buse and W. Weimer. Synthesizing api usage examples. ICSE ’12, pages 782–792, 2012.
[3]
E. G. Cartaxo, P. D. L. Machado, and F. G. O. Neto. On the use of a similarity function for test case selection in the context of model-based testing. Software Testing, Verification and Reliability, 21(2):75–100, 2011.
[4]
J. Kim, S. Lee, S.-w. Hwang, and S. Kim. Adding examples into java documents. ASE ’09, pages 540–544, 2009.
[5]
B. Korel and J. Laski. Dynamic program slicing. Inf. Process. Lett., 29(3):155–163, Oct. 1988.
[6]
L. W. Mar, Y.-C. Wu, and H. Jiau. Recommending proper api code examples for documentation purpose. APSEC ’11, pages 331–338, 2011.
[7]
G. Meszaros. XUnit test patterns: refactoring test code. Addison-Wesley, Upper Saddle River, NJ, 2007.
[8]
M. Mooty, A. Faulring, J. Stylos, and B. Myers. Calcite: Completing code completion for constructors using crowds. VL/HCC ’10, pages 15–22, 2010.
[9]
S. Nasehi and F. Maurer. Unit tests as api usage examples. ICSM ’10, pages 1–10, 2010.
[10]
A. T. Nguyen and et al. Graph-based pattern-oriented, context-sensitive source code completion. ICSE ’12, pages 69–79, 2012.
[11]
A. Qusef, G. Bavota, R. Oliveto, A. D. Lucia, and D. Binkley. Recovering test-to-code traceability using slicing and textual analysis. Journal of Systems and Software, Oct. 2013.
[12]
S. P. Reiss. Semantics-based code search. ICSE ’09, pages 243–253, 2009.
[13]
R. Robbes and M. Lanza. Improving code completion with program history. Automated Software Engg., 17(2):181–212, June 2010.
[14]
M. Robillard, R. Walker, and T. Zimmermann. Recommendation systems for software engineering. IEEE Softw., 27(4):80–86, July 2010.
[15]
M. P. Robillard. What makes apis hard to learn? answers from developers. IEEE Software, 26(6):27–34, 2009.
[16]
B. V. Rompaey and S. Demeyer. Establishing traceability links between unit test cases and units under test. CSMR ’09, pages 209–218, 2009.
[17]
N. Sawadsky and G. C. Murphy. Fishtail: from task context to source code examples. TOPI ’11, pages 48–51. ACM, 2011.
[18]
J. Sillito, F. Maurer, S. M. Nasehi, and C. Burns. What makes a good code example?: A study of programming q&a in stackoverflow. ICSM ’’12, pages 25–34, 2012.
[19]
S. Thummalapenta and T. Xie. Parseweb: a programmer assistant for reusing open source code on the web. ASE ’07, pages 204–213. ACM, 2007.
[20]
A. Zaidman, B. Van Rompaey, S. Demeyer, and A. Van Deursen. Mining software repositories to study co-evolution of production & test code. ICST ’’08, pages 220–229, 2008.

Cited By

View all
  • (2023)An empirical study on API usages from code search engine and local libraryEmpirical Software Engineering10.1007/s10664-023-10304-z28:3Online publication date: 13-Apr-2023
  • (2017)Mining unit test cases to synthesize API usage examplesJournal of Software: Evolution and Process10.1002/smr.184129:12Online publication date: 20-Jan-2017
  • (2016)Mining Software Repositories for Automatic Interface RecommendationScientific Programming10.1155/2016/54759642016(5)Online publication date: 1-Jun-2016
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
ICPC 2014: Proceedings of the 22nd International Conference on Program Comprehension
June 2014
325 pages
ISBN:9781450328791
DOI:10.1145/2597008
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: 02 June 2014

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Code recommendation
  2. unit tests
  3. usage examples

Qualifiers

  • Article

Conference

ICSE '14
Sponsor:

Upcoming Conference

ICSE 2025

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

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

Other Metrics

Citations

Cited By

View all
  • (2023)An empirical study on API usages from code search engine and local libraryEmpirical Software Engineering10.1007/s10664-023-10304-z28:3Online publication date: 13-Apr-2023
  • (2017)Mining unit test cases to synthesize API usage examplesJournal of Software: Evolution and Process10.1002/smr.184129:12Online publication date: 20-Jan-2017
  • (2016)Mining Software Repositories for Automatic Interface RecommendationScientific Programming10.1155/2016/54759642016(5)Online publication date: 1-Jun-2016
  • (2016)The Object RepositoryProceedings of the 11th edition of the International Workshop on Smalltalk Technologies10.1145/2991041.2991048(1-10)Online publication date: 23-Aug-2016
  • (2016)Improving the quality of code snippets in stack overflowProceedings of the 31st Annual ACM Symposium on Applied Computing10.1145/2851613.2851789(1492-1497)Online publication date: 4-Apr-2016
  • (2015)Automatically identifying focal methods under test in unit test cases2015 IEEE 15th International Working Conference on Source Code Analysis and Manipulation (SCAM)10.1109/SCAM.2015.7335402(61-70)Online publication date: Sep-2015
  • (2015)Using Feature-Interface Graph for Automatic Interface Recommendation: A Case Study2015 Third International Conference on Advanced Cloud and Big Data10.1109/CBD.2015.55(296-303)Online publication date: Oct-2015
  • (2014)Extracting Code Examples from Unit Test CasesProceedings of the 2014 IEEE International Conference on Software Maintenance and Evolution10.1109/ICSME.2014.122Online publication date: 29-Sep-2014

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