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.
- I. Balaban, F. Tip, and R. Fuhrer. Refactoring support for class library migration. In Proc. OOPSLA, 2005. Google ScholarDigital Library
- J. R. Cordy, C. D. Halpern, and E. Promislow. Txl: A rapid prototyping system for programming language dialects. Computer Languages, 16, 1991. Google ScholarDigital Library
- B. Dagenais and M. P. Robillard. Recommending adaptive changes for framework evolution. In Proc. ICSE, 2008. Google ScholarDigital Library
- 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 ScholarDigital Library
- E. Duala-Ekoko and M. P. Robillard. Tracking code clones in evolving software. In Proc. ICSE, 2007. Google ScholarDigital Library
- M. Erwig and D. Ren. A rule-based language for programming software updates. SIGPLAN Not., 37(12):88--97, 2002. Google ScholarDigital Library
- R. E. Griswold. The SNOBOL4 programming language. Bell Telephone Laboratories, 1968. Google ScholarDigital Library
- 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 ScholarDigital Library
- J. Henkel and A. Diwan. Catchup!: capturing and replaying refactorings to support api evolution. In Proc. ICSE, 2005. Google ScholarDigital Library
- 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 ScholarDigital Library
- G. Kiczales and E. Hilsdale. Aspect-oriented programming. In ESEC/FSE, 2001. Google ScholarDigital Library
- 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 ScholarDigital Library
- M. Kim and D. Notkin. Discovering and representing systematic code changes. In Proc. ICSE, 2009. Google ScholarDigital Library
- M. Kim, D. Notkin, and D. Grossman. Automatic inference of structural changes for matching across program versions. In Proc. ICSE, 2007. Google ScholarDigital Library
- R. C. Miller and B. A. Myers. Interactive simultaneous editing of multiple text regions. In USENIX Annual Technical Conference, 2002. Google ScholarDigital Library
- I. Neamtiu, M. Hicks, G. Stoyle, and M. Oriol. Practical dynamic software updating for c. SIGPLAN Not., 41(6):72--83, 2006. Google ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- D. L. Parnas. On the design and development of program families. Software fundamentals: collected papers by David L. Parnas, pages 193--213, 2001. Google ScholarDigital Library
- M. Shonle, W. G. Griswold, and S. Lerner. Beyond refactoring: a framework for modular maintenance of crosscutting design idioms. In ESEC/FSE, 2007. Google ScholarDigital Library
- 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 ScholarDigital Library
Recommendations
Mining API mapping for language migration
ICSE '10: Proceedings of the 32nd ACM/IEEE International Conference on Software Engineering - Volume 1To address business requirements and to survive in competing markets, companies or open source organizations often have to release different versions of their projects in different languages. Manually migrating projects from one language to another (...
A Systematic Review of API Evolution Literature
Recent software advances have led to an expansion of the development and usage of application programming interfaces (APIs). From millions of Android packages (APKs) available on Google Store to millions of open-source packages available in Maven, PyPI, ...
Mapping API elements for code migration with vector representations
ICSE '16: Proceedings of the 38th International Conference on Software Engineering CompanionProblem. Code migration between languages is challenging partly because different languages require developers to use different software libraries and frameworks. For example, in Java, Java Development Kit library (JDK) is a popular toolkit while .NET ...
Comments