skip to main content
10.1145/1453101.1453130acmconferencesArticle/Chapter ViewAbstractPublication PagesfseConference Proceedingsconference-collections
research-article

Semi-automating small-scale source code reuse via structural correspondence

Published:09 November 2008Publication History

ABSTRACT

Developers perform small-scale reuse tasks to save time and to increase the quality of their code, but due to their small scale, the costs of such tasks can quickly outweigh their benefits. Existing approaches focus on locating source code for reuse but do not support the integration of the located code within the developer's system, thereby leaving the developer with the burden of performing integration manually. This paper presents an approach that uses the developer's context to help integrate the reused source code into the developer's own source code. The approach approximates a theoretical framework (higher-order anti-unification modulo theories), known to be undecidable in general, to determine candidate correspondences between the source code to be reused and the developer's current (incomplete) system. This approach has been implemented in a prototype tool, called Jigsaw, that identifies and evaluates candidate correspondences greedily with respect to the highest similarity. Situations involving multiple candidate correspondences with similarities above a defined threshold are presented to the developer for resolution. Two empirical evaluations were conducted: an experiment comparing the quality of Jigsaw's results against suspected cases of small-scale reuse in an industrial system; and case studies with two industrial developers to consider its practical usefulness and usability issues.

References

  1. T. Apiwattanapong, A. Orso, and M. J. Harrold. A differencing algorithm for object-oriented programs. In Proc. Int'l Conf. Automated Softw. Eng., pp. 2--13, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. V. R. Basili, G. Caldiera, and G. Cantone. A reference architecture for the component factory. ACM Trans. Softw. Eng. Methodol., 1(1):53--80, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. T. J. Biggerstaff. The library scaling problem and the limits of concrete component reuse. In Proc. Int'l Conf. Softw. Reuse, pp. 102--109, 1994.Google ScholarGoogle ScholarCross RefCross Ref
  4. J. Burghardt. E-generalization using grammars. Artif. Intell. J., 165(1):1--35, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. R. Cottrell, J. J. C. Chang, R. J. Walker, and J. Denzinger. Determining detailed structural correspondence for generalization tasks. In Proc. Joint Europ. Softw. Eng. Conf. and ACM SIGSOFT Int'l Symp. Foundations Softw. Eng., pp. 165--174, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. E. Duala-Ekoko and M. P. Robillard. Tracking code clones in evolving software. In Proc. Int'l Conf. Softw. Eng., pp. 158--167, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. W. B. Frakes and K. Kang. Software reuse research: Status and future. IEEE Trans. Software Eng., 31(7):529--536, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. M. G. Gouda and T. Herman. Adaptive programming. IEEE Trans. Softw. Eng., 17(9):911--921, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. R. Holmes and R. J. Walker. Supporting the investigation and planning of pragmatic reuse tasks. In Proc. Int'l Conf. Softw. Eng., pp. 447--457, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. R. Holmes and R. J. Walker. Lightweight, semi-automated enactment of pragmatic-reuse plans. In Proc. Int'l Conf. Softw. Reuse, pp. 330--342, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. R. Holmes, R. J. Walker, and G. C. Murphy. Approximate structural context matching: An approach to recommend relevant examples. IEEE Trans. Softw. Eng., 32(12):952--970, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. P. Jablonski and D. Hou. CReN: A tool for tracking copy-and-paste code clones and renaming identifiers consistently in the IDE. In Proc. Eclipse Technology Exchange, pp. 16--20, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. D. Jackson and D. A. Ladd. Semantic diff: A tool for summarizing the effects of modifications. In Proc. Int'l Conf. Softw. Maintenance, pp. 243--252, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. T. Kamiya, S. Kusumoto, and K. Inoue. CCFinder: A multilinguistic token-based code clone detection system for large scale source code. IEEE Trans. Softw. Eng., 28(7):654--670, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. C. Kapser and M. W. Godfrey. 'Cloning considered harmful' considered harmful. In Proc. Working Conf. Reverse Eng., pp. 81--90, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. M. Kim, V. Sazawal, D. Notkin, and G. Murphy. An empirical study of code clone genealogies. In Proc. Joint Europ. Conf. Softw. Eng. and ACM SIGSOFT Int'l Symp. Foundations Softw. Eng., pp. 187--196, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. C. W. Krueger. Software reuse. ACM Comput. Surv., 24(2):131--183, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. A. Michail. Code web: Data mining library reuse patterns. In Proc. Int'l Conf. Softw. Eng., pp. 827--828, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. G. D. Plotkin. A note on inductive generalization. Machine Intelligence, 5:153--163, 1970.Google ScholarGoogle Scholar
  20. M. B. Rosson and J. M. Carroll. The reuse of uses in Smalltalk programming. ACM Trans. Computer--Human Interaction, 3(3):219--253, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. F. Van Rysselberghe and S. Demeyer. Reconstruction of Successful Software Evolution Using Clone Detection. Proc. Int'l Wkshp. Principles of Softw. Evolution, pp. 126--130, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. R. W. Selby. Enabling reuse-based software development of large-scale systems. IEEE Trans. Softw. Eng., 31(6):495--510, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. F. Tip, A. Kiezun, and D. Bäumer. Refactoring for generalization using type constraints. In Proc. ACM SIGPLAN Conf. Object-Oriented Progr. Syst. Lang. Appl., pp. 13--26, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. T. Xie and J. Pei. MAPO: Mining API usages from open source repositories. In Proc. Int'l Wkshp. Mining Softw. Repositories, pp. 54--57, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. D. M. Yellin and R. E. Strom. Protocol specifications and component adaptors. ACM Trans. Program. Lang. Syst., 19(2):292--333, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Semi-automating small-scale source code reuse via structural correspondence

        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
          SIGSOFT '08/FSE-16: Proceedings of the 16th ACM SIGSOFT International Symposium on Foundations of software engineering
          November 2008
          369 pages
          ISBN:9781595939951
          DOI:10.1145/1453101

          Copyright © 2008 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: 9 November 2008

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • research-article

          Acceptance Rates

          Overall Acceptance Rate17of128submissions,13%

          Upcoming Conference

          FSE '24

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader