Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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 2010 Publication 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.
[2]
J. R. Cordy, C. D. Halpern, and E. Promislow. Txl: A rapid prototyping system for programming language dialects. Computer Languages, 16, 1991.
[3]
B. Dagenais and M. P. Robillard. Recommending adaptive changes for framework evolution. In Proc. ICSE, 2008.
[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.
[5]
E. Duala-Ekoko and M. P. Robillard. Tracking code clones in evolving software. In Proc. ICSE, 2007.
[6]
M. Erwig and D. Ren. A rule-based language for programming software updates. SIGPLAN Not., 37(12):88--97, 2002.
[7]
R. E. Griswold. The SNOBOL4 programming language. Bell Telephone Laboratories, 1968.
[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.
[9]
J. Henkel and A. Diwan. Catchup!: capturing and replaying refactorings to support api evolution. In Proc. ICSE, 2005.
[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.
[11]
G. Kiczales and E. Hilsdale. Aspect-oriented programming. In ESEC/FSE, 2001.
[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.
[13]
M. Kim and D. Notkin. Discovering and representing systematic code changes. In Proc. ICSE, 2009.
[14]
M. Kim, D. Notkin, and D. Grossman. Automatic inference of structural changes for matching across program versions. In Proc. ICSE, 2007.
[15]
R. C. Miller and B. A. Myers. Interactive simultaneous editing of multiple text regions. In USENIX Annual Technical Conference, 2002.
[16]
I. Neamtiu, M. Hicks, G. Stoyle, and M. Oriol. Practical dynamic software updating for c. SIGPLAN Not., 41(6):72--83, 2006.
[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.
[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.
[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.
[20]
D. L. Parnas. On the design and development of program families. Software fundamentals: collected papers by David L. Parnas, pages 193--213, 2001.
[21]
M. Shonle, W. G. Griswold, and S. Lerner. Beyond refactoring: a framework for modular maintenance of crosscutting design idioms. In ESEC/FSE, 2007.
[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.

Cited By

View all
  • (2024)Mapping APIs in Dynamic-typed Programs by Leveraging Transfer LearningACM Transactions on Software Engineering and Methodology10.1145/364184833:4(1-29)Online publication date: 18-Apr-2024
  • (2023)On the Usage of Continual Learning for Out-of-Distribution Generalization in Pre-trained Language Models of CodeProceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering10.1145/3611643.3616244(1470-1482)Online publication date: 30-Nov-2023
  • (2023)PyEvolve: Automating Frequent Code Changes in Python ML SystemsProceedings of the 45th International Conference on Software Engineering10.1109/ICSE48619.2023.00091(995-1007)Online publication date: 14-May-2023
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

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
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

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 May 2010

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. API mapping
  2. source-to-source translation
  3. twinning

Qualifiers

  • Research-article

Conference

ICSE '10
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)4
  • Downloads (Last 6 weeks)0
Reflects downloads up to 15 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2024)Mapping APIs in Dynamic-typed Programs by Leveraging Transfer LearningACM Transactions on Software Engineering and Methodology10.1145/364184833:4(1-29)Online publication date: 18-Apr-2024
  • (2023)On the Usage of Continual Learning for Out-of-Distribution Generalization in Pre-trained Language Models of CodeProceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering10.1145/3611643.3616244(1470-1482)Online publication date: 30-Nov-2023
  • (2023)PyEvolve: Automating Frequent Code Changes in Python ML SystemsProceedings of the 45th International Conference on Software Engineering10.1109/ICSE48619.2023.00091(995-1007)Online publication date: 14-May-2023
  • (2022)Inferring and applying type changesProceedings of the 44th International Conference on Software Engineering10.1145/3510003.3510115(1206-1218)Online publication date: 21-May-2022
  • (2022)A Transformational Approach to Managing Data Model Evolution of Web ServicesIEEE Transactions on Services Computing10.1109/TSC.2022.3144613(1-1)Online publication date: 2022
  • (2021)A Multi-Metric Ranking Approach for Library Migration Recommendations2021 IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER)10.1109/SANER50967.2021.00016(72-83)Online publication date: Mar-2021
  • (2021)REPFINDER: Finding Replacements for Missing APIs in Library Update2021 36th IEEE/ACM International Conference on Automated Software Engineering (ASE)10.1109/ASE51524.2021.9678905(266-278)Online publication date: Nov-2021
  • (2020)Exploring how deprecated Python library APIs are (not) handledProceedings of the 28th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering10.1145/3368089.3409735(233-244)Online publication date: 8-Nov-2020
  • (2020)Understanding type changes in JavaProceedings of the 28th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering10.1145/3368089.3409725(629-641)Online publication date: 8-Nov-2020
  • (2020)CDA: Characterising Deprecated Android APIsEmpirical Software Engineering10.1007/s10664-019-09764-zOnline publication date: 11-Jan-2020
  • 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

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media