Applying test-driven code search to the reuse of auxiliary functionality

  • Authors:
  • Otávio Augusto Lazzarini Lemos;Sushil Bajracharya;Joel Ossher;Paulo Cesar Masiero;Cristina Lopes

  • Affiliations:
  • ICMC/USP - Sao Carlos - Caixa Postal, Sao Carlos-SP-Brasil;University of California, Irvine;University of California, Irvine;ICMC/USP - Sao Carlos - Caixa Postal, Sao Carlos-SP-Brasil;University of California, Irvine

  • Venue:
  • Proceedings of the 2009 ACM symposium on Applied Computing
  • Year:
  • 2009

Quantified Score

Hi-index 0.01

Visualization

Abstract

Software developers spend considerable effort implementing auxiliary functionality used by the main features of a system (e.g. compressing/decompressing files, encryption/decription of data, scaling/rotating images). With the increasing amount of open source code available on the Internet, time and effort can be saved by reusing these utilities through informal practices of code search and reuse. However, when this type of reuse is performed in an ad hoc manner, it can be tedious and error-prone: code results have to be manually inspected and extracted into the workspace. In this paper we introduce the use of test cases as an interface for automating code search and reuse and evaluate its applicability and performance in the reuse of auxiliary functionality. We call our approach Test-Driven Code Search (TDCS). Test cases serve two purposes: (1) they define the behavior of the desired functionality to be searched; and (2) they test the matching results for suitability in the local context. We present CodeGenie, an Eclipse plugin that performs TDCS using a code search engine called Sourcerer. Our evaluation presents evidence of the applicability and good performance of TDCS in the reuse of auxiliary functionality.