skip to main content
10.1145/1806799.1806832acmconferencesArticle/Chapter ViewAbstractPublication PagesicseConference Proceedingsconference-collections
research-article

Using twinning to adapt programs to alternative APIs

Published:01 May 2010Publication History

ABSTRACT

We describe twinning and its applications to adapting programs to alternative APIs. Twinning is a simple technique that allows programmers to specify a class of program changes, in the form of a mapping, without modifying the target program directly. Using twinning, programmers can specify changes that transition a program from using one API to using an alternative API.

We describe two related mapping-based source-to-source transformations. The first applies the mapping to a program, producing a copy with the changes applied. The second generates a new API that abstracts the changes specified in the mapping. Using this API, programmers can invoke either the old (replaced) code or the new (replacement) code through a single interface.

Managing program variants usually involves heavyweight tasks that can prevent the program from compiling for extended periods of time, as well as simultaneous maintenance of multiple implementations, which can make it easy to forget to add features or to fix bugs symmetrically. Our main contribution is to show that, at least in some common cases, the heavyweight work can be reduced and symmetric maintenance can be at least encouraged, and often enforced.

References

  1. I. Balaban, F. Tip, and R. Fuhrer. Refactoring support for class library migration. In Proc. OOPSLA, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. J. R. Cordy, C. D. Halpern, and E. Promislow. Txl: A rapid prototyping system for programming language dialects. Computer Languages, 16, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. B. Dagenais and M. P. Robillard. Recommending adaptive changes for framework evolution. In Proc. ICSE, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. D. Dig, C. Comertoglu, D. Marinov, and R. Johnson. Automated detection of refactorings in evolving components. In ECOOP '06: European Conference on Object Oriented Programming, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. E. Duala-Ekoko and M. P. Robillard. Tracking code clones in evolving software. In Proc. ICSE, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. M. Erwig and D. Ren. A rule-based language for programming software updates. SIGPLAN Not., 37(12):88--97, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. R. E. Griswold. The SNOBOL4 programming language. Bell Telephone Laboratories, 1968. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. W. G. Griswold, D. C. Atkinson, and C. McCurdy. Fast, flexible syntactic pattern matching and processing. In WPC '96: International Workshop on Program Comprehension, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. J. Henkel and A. Diwan. Catchup!: capturing and replaying refactorings to support api evolution. In Proc. ICSE, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. P. Jablonski and D. Hou. Cren: a tool for tracking copy-and-paste code clones and renaming identifiers consistently in the ide. In OOPSLA workshop on eclipse technology eXchange, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. G. Kiczales and E. Hilsdale. Aspect-oriented programming. In ESEC/FSE, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. G. Kiczales, E. Hilsdale, J. Hugunin, M. Kersten, J. Palm, and W. G. Griswold. An overview of aspectj. In ECOOP '01: European Conference on Object-Oriented Programming, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. M. Kim and D. Notkin. Discovering and representing systematic code changes. In Proc. ICSE, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. M. Kim, D. Notkin, and D. Grossman. Automatic inference of structural changes for matching across program versions. In Proc. ICSE, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. R. C. Miller and B. A. Myers. Interactive simultaneous editing of multiple text regions. In USENIX Annual Technical Conference, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. I. Neamtiu, M. Hicks, G. Stoyle, and M. Oriol. Practical dynamic software updating for c. SIGPLAN Not., 41(6):72--83, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. M. Nita and D. Grossman. Automatic transformation of bit-level C code to support multiple equivalent data layouts. In International Conference on Compiler Construction, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Y. Padioleau, R. R. Hansen, J. L. Lawall, and G. Muller. Semantic patches for documenting and automating collateral evolutions in linux device drivers. In Proc. PLOS '06, page 10, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Y. Padioleau, J. Lawall, R. R. Hansen, and G. Muller. Documenting and automating collateral evolutions in linux device drivers. SIGOPS Oper. Syst. Rev., 42(4):247--260, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. D. L. Parnas. On the design and development of program families. Software fundamentals: collected papers by David L. Parnas, pages 193--213, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. M. Shonle, W. G. Griswold, and S. Lerner. Beyond refactoring: a framework for modular maintenance of crosscutting design idioms. In ESEC/FSE, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. M. Toomim, A. Begel, and S. L. Graham. Managing duplicated code with linked editing. In IEEE Symposium on Visual Languages - Human Centric Computing, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library

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
    ICSE '10: Proceedings of the 32nd ACM/IEEE International Conference on Software Engineering - Volume 1
    May 2010
    627 pages
    ISBN:9781605587196
    DOI:10.1145/1806799

    Copyright © 2010 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: 1 May 2010

    Permissions

    Request permissions about this article.

    Request Permissions

    Check for updates

    Qualifiers

    • research-article

    Acceptance Rates

    Overall Acceptance Rate276of1,856submissions,15%

    Upcoming Conference

    ICSE 2025

PDF Format

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader