[go: up one dir, main page]
More Web Proxy on the site http://driver.im/ skip to main content
10.1145/1449764.1449788acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
research-article

Annotation refactoring: inferring upgrade transformations for legacy applications

Published: 19 October 2008 Publication History

Abstract

Since annotations were added to the Java language, many frameworks have moved to using annotated Plain Old Java Objects (POJOs) in their newest releases. Legacy applications are thus forced to undergo extensive restructuring in order to migrate from old framework versions to new versions based on annotations (Version Lock-in). Additionally, because annotations are embedded in the application code, changing between framework vendors may also entail largescale manual changes (Vendor Lock-in).
This paper presents a novel refactoring approach that effectively solves these two problems. Our approach infers a concise set of semantics-preserving transformation rules from two versions of a single class. Unlike prior approaches that detect only simple structural refactorings, our algorithm can infer general composite refactorings and is more than 97% accurate on average. We demonstrate the effectiveness of our approach by automatically upgrading more than 80K lines of the unit testing code of four open-source Java applications to use the latest version of the popular JUnit testing framework.

References

[1]
T. Apiwattanapong, A. Orso, and M. J. Harrold. A differencing algorithm for object-oriented programs. In Automated Software Engineering, 2004. Proceedings. 19th International Conference on, pages 2--13, 2004.
[2]
I. D. Baxter, C. Pidgeon, and M. Mehlich. DMS: Program transformations for practical scalable software evolution. In ICSE '04: Proceeding of the 26th International Conference on Software Engineering, pages 625--634, Los Alamitos, CA, USA, 2004. IEEE Computer Society.
[3]
K. Beck and E. Gamma. Test Infected: Programmers love writing tests. Java Report, 3(7):37--50, 1998.
[4]
C. Beust and H. Suleiman. Next Generation Java Testing: TestNG and Advanced Concepts. Addison-Wesley Professional, 2007.
[5]
M. Boshernitsan, S. L. Graham, and M. A. Hearst. Aligning development tools with the way programmers think about code changes. In CHI '07: Proceedings of the SIGCHI Conference on Human Factors in Computing Systems, pages 567--576, New York, NY, USA, 2007. ACM.
[6]
W. Brown, R. Malveau, H. McCormick III, and T. Mowbray. AntiPatterns: refactoring software, architectures, and projects in crisis. John Wiley & Sons, Inc. New York, NY, USA, 1998.
[7]
F. Castor and P. Borba. A language for specifying Java transformations. In V Brazilian Symposium on Programming Languages, pages 236--251, 2001.
[8]
S. S. Chawathe, A. Rajaraman, H. Garcia-Molina, and J. Widom. Change detection in hierarchically structured information. In SIGMOD '96: Proceedings of the 1996 ACM SIGMOD international conference on Management of data, pages 493--504, New York, NY, USA, 1996. ACM.
[9]
K. Chow and D. Notkin. Semi-automatic update of applications in response to library changes. In ICSM'96: Proceedings of the 1996 International Conference on Software Maintenance, page 359, Washington, DC, USA, 1996. IEEE Computer Society.
[10]
J. Cordy. The TXL source transformation language. Science of Computer Programming, 61(3):190--210, August 2006.
[11]
M. Cortés, M. Fontoura, and C. Lucena. Using refactoring and unification rules to assist framework evolution. SIGSOFT Softw. Eng. Notes, 28(6):1--5, 2003.
[12]
M. Cortés, M. Fontoura, and C. Lucena. A Rule-based Approach to Framework Evolution. Journal of Object Technology (JOT), 5(1), jan-feb 2006.
[13]
R. Cottrell, J. J. C. Chang, R. J. Walker, and J. Denzinger. Determining detailed structural correspondence for generalization tasks. In ESEC-FSE '07: Proceedings of the the 6th ACM SIGSOFT Symposium on the Foundations of Software Engineering, pages 165--174, New York, NY, USA, 2007. ACM.
[14]
I. Şavga and M. Rudolf. Refactoring-based support for binary compatibility in evolving frameworks. In GPCE '07: Proceedings of the 6th International Conference on Generative Programming and Component Engineering, pages 175--184, New York, NY, USA, 2007. ACM.
[15]
L. DeMichiel and M. Keith. JSR 220: Enterprise JavaBeans 3.0, 2008. http://jcp.org/aboutJava/communityprocess/final/jsr220/index.html.
[16]
D. Dig, C. Comertoglu, D. Marinov, and R. Johnson. Automated detection of refactorings in evolving components. In ECOOP, pages 404--428, 2006.
[17]
D. Dig, K. Manzoor, R. Johnson, and T. N. Nguyen. Refactoring-aware configuration management for object-oriented programs. In ICSE '07: Proceedings of the 29th International Conference on Software Engineering, pages 427--436, Washington, DC, USA, 2007. IEEE Computer Society.
[18]
D. Dig, S. Negara, V. Mohindra, and R. Johnson. ReBA: refactoring-aware binary adaptation of evolving libraries. In ICSE '08: Proceedings of the 30th international conference on Software engineering, pages 441--450, New York, NY, USA, 2008. ACM.
[19]
M. Dmitriev. Language-specific make technology for the Java programming language. SIGPLAN Not., 37(11):373--385, 2002.
[20]
Eclipse Foundation. Eclipse Java development tools, March 2008. http://www.eclipse.org/jdt.
[21]
B. Fluri, M.Wuersch, M. Pinzger, and H. Gall. Change distilling: Tree differencing for fine-grained source code change extraction. IEEE Trans. Softw. Eng., 33(11):725--743, 2007.
[22]
T. Genssler and V. Kuttruff. Source-to-source transformation in the large. In Modular Programming Languages, pages 254--265. Springer-Verlag, 2003.
[23]
J. Henkel and A. Diwan. CatchUp!: capturing and replaying refactorings to support API evolution. In ICSE'05: Proceedings of the 27th International Conference on Software Engineering, pages 274--283, New York, NY, USA, 2005. ACM.
[24]
M. Kim, D. Notkin, and D. Grossman. Automatic inference of structural changes for matching across program versions. In The 29th International Conference on Software Engineering (ICSE'07), pages 333--343, 2007.
[25]
H. Lieberman. Your Wish is My Command: Programming By Example. Morgan Kaufmann, 2001.
[26]
Y. Lin, J. Gray, and F. Jouault. DSMDiff: A differentiation tool for domain-specific models. European Journal of Information Systems, 16:349--361, 2007.
[27]
D. Panda, D. Clarke, and M. Schincariol. EJB 3.0 migration. Technical report, Oracle, October 2005.
[28]
R. Pawlak, C. Noguera, and N. Petitprez. Spoon: Program analysis and transformation in Java. Technical report, INRIA Research Report, 2006.
[29]
J. H. Perkins. Automatically generating refactorings to support API evolution. In PASTE '05: Proceedings of the 6th ACM SIGPLAN-SIGSOFT Workshop on Program Analysis for Software Tools and Engineering, pages 111--114, New York, NY, USA, 2005. ACM.
[30]
M. Proctor, M. Neale, P. Lin, and M. Frandsen. Drools Documentation. Technical report, JBoss Inc., 2006.
[31]
C. Richardson. Untangling enterprise Java. Queue, 4(5):36--44, 2006.
[32]
D. Roberts and J. Brant. Tools for making impossible changes - experiences with a tool for transforming large Smalltalk programs. Software, IEE Proceedings-, 151(2):49--56, 2004. 1462--5970.
[33]
S. Roock and A. Havenstein. Refactoring tags for automatic refactoring of framework dependent applications. In Proc. Int'l Conf. eXtreme Programming and Flexible Processes in Software Engineering (XP), 2002.
[34]
C. Russell. Java Data Objects 2.1, June 2007. http://db.apache.org/jdo/specifications.html.
[35]
M. Shonle, W. G. Griswold, and S. Lerner. Beyond refactoring: a framework for modular maintenance of crosscutting design idioms. In ESEC-FSE '07: Proceedings of the the 6th ACM SIGSOFT Symposium on the Foundations of Software Engineering, pages 175--184, 2007.
[36]
R. Stuckert. JUnit reloaded, December 2006. http://today.java.net/pub/a/today/2006/12/07/junit-reloaded.html.
[37]
K. Taneja, D. Dig, and T. Xie. Automated detection of API refactorings in libraries. In ASE '07: Proceedings of the 22nd IEEE/ACM International Conference on Automated Software Engineering. IEEE Computer Society, 2007.
[38]
W. Tansey and E. Tilevich. Refactoring object-oriented applications for metadata-based frameworks. Technical report, Virginia Tech, January 2008.
[39]
T. Tourwé and T. Mens. Automated support for framework-based software evolution. In ICSM '03: Proceedings of the International Conference on Software Maintenance, page 148, Washington, DC, USA, 2003. IEEE Computer Society.
[40]
D. Vines and K. Sutter. Migrating legacy Hibernate applications to OpenJPA and EJB 3.0, August 2007. http://www.ibm.com/developerworks/websphere/techjournal/0708_vines/0708_vines.html.
[41]
E. Visser. A survey of strategies in program transformation systems. Electronic Notes in Theoretical Computer Science, 57, 2001.
[42]
E. Visser. Program transformation with Stratego/XT: Rules, strategies, tools, and systems in StrategoXT-0.9. In Domain-Specific Program Generation, volume 3016 of Lecture Notes in Computer Science, pages 216--238. Spinger-Verlag, June 2004.
[43]
Z. Xing and E. Stroulia. UMLDiff: an algorithm for object-oriented design differencing. In ASE '05: Proceedings of the 20th IEEE/ACM International Conference on Automated Software Engineering, pages 54--65, 2005.
[44]
Z. Xing and E. Stroulia. API-evolution support with Diff-CatchUp. IEEE Trans. Softw. Eng., 33(12):818--836, 2007.
[45]
Z. Xing and E. Stroulia. Differencing logical UML models. Automated Software Engineering, 14(2):215--259, 2007.

Cited By

View all
  • (2024)Multilingual Program Code Classification Using $n$-Layered Bi-LSTM Model With Optimized HyperparametersIEEE Transactions on Emerging Topics in Computational Intelligence10.1109/TETCI.2023.33369208:2(1452-1468)Online publication date: Apr-2024
  • (2023)On the Applicability of Annotation-Based Source Code Modification in Kotlin (Work in Progress)Proceedings of the 20th ACM SIGPLAN International Conference on Managed Programming Languages and Runtimes10.1145/3617651.3622983(2-11)Online publication date: 19-Oct-2023
  • (2023)Dynamically Relative Position Encoding-Based Transformer for Automatic Code EditIEEE Transactions on Reliability10.1109/TR.2022.319437072:3(1147-1160)Online publication date: Sep-2023
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
OOPSLA '08: Proceedings of the 23rd ACM SIGPLAN conference on Object-oriented programming systems languages and applications
October 2008
654 pages
ISBN:9781605582153
DOI:10.1145/1449764
  • cover image ACM SIGPLAN Notices
    ACM SIGPLAN Notices  Volume 43, Issue 10
    September 2008
    613 pages
    ISSN:0362-1340
    EISSN:1558-1160
    DOI:10.1145/1449955
    Issue’s Table of Contents
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: 19 October 2008

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. JUnit
  2. annotations
  3. eclipse
  4. frameworks
  5. java
  6. metadata
  7. refactoring
  8. upgrading

Qualifiers

  • Research-article

Conference

OOPSLA08
Sponsor:

Acceptance Rates

Overall Acceptance Rate 268 of 1,244 submissions, 22%

Upcoming Conference

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)15
  • Downloads (Last 6 weeks)2
Reflects downloads up to 12 Dec 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Multilingual Program Code Classification Using $n$-Layered Bi-LSTM Model With Optimized HyperparametersIEEE Transactions on Emerging Topics in Computational Intelligence10.1109/TETCI.2023.33369208:2(1452-1468)Online publication date: Apr-2024
  • (2023)On the Applicability of Annotation-Based Source Code Modification in Kotlin (Work in Progress)Proceedings of the 20th ACM SIGPLAN International Conference on Managed Programming Languages and Runtimes10.1145/3617651.3622983(2-11)Online publication date: 19-Oct-2023
  • (2023)Dynamically Relative Position Encoding-Based Transformer for Automatic Code EditIEEE Transactions on Reliability10.1109/TR.2022.319437072:3(1147-1160)Online publication date: Sep-2023
  • (2022)Migrating gradual typesJournal of Functional Programming10.1017/S095679682200008932Online publication date: 6-Oct-2022
  • (2021)On Multi-Modal Learning of Editing Source Code2021 36th IEEE/ACM International Conference on Automated Software Engineering (ASE)10.1109/ASE51524.2021.9678559(443-455)Online publication date: Nov-2021
  • (2017)Migrating gradual typesProceedings of the ACM on Programming Languages10.1145/31581032:POPL(1-29)Online publication date: 27-Dec-2017
  • (2017)Learning syntactic program transformations from examplesProceedings of the 39th International Conference on Software Engineering10.1109/ICSE.2017.44(404-415)Online publication date: 20-May-2017
  • (2016)Automating repetitive code changes using examplesProceedings of the 2016 24th ACM SIGSOFT International Symposium on Foundations of Software Engineering10.1145/2950290.2983944(1063-1065)Online publication date: 1-Nov-2016
  • (2016)Towards improving interface modularity in legacy Java software through automated refactoringCompanion Proceedings of the 15th International Conference on Modularity10.1145/2892664.2892681(104-106)Online publication date: 14-Mar-2016
  • (2015)Divide-and-conquer approach for multi-phase statistical migration for source codeProceedings of the 30th IEEE/ACM International Conference on Automated Software Engineering10.1109/ASE.2015.74(585-596)Online publication date: 9-Nov-2015
  • 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

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media