Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
article

Refactoring support for class library migration

Published: 12 October 2005 Publication History

Abstract

As object-oriented class libraries evolve, classes are occasionally deprecated in favor of others with roughly the same functionality. In Java's standard libraries, for example, class Hashtable has been superseded by HashMap, and Iterator is now preferred over Enumeration. Migrating client applications to use the new idioms is often desirable, but making the required changes to declarations and allocation sites can be quite labor-intensive. Moreover, migration becomes complicated---and sometimes impossible---if an application interacts with external components, if a legacy class is not completely equivalent to its replacement, or if multiple interdependent classes must be migrated simultaneously. We present an approach in which mappings between legacy classes and their replacements are specified by the programmer. Then, an analysis based on type constraints determines where declarations and allocation sites can be updated. The method was implemented in Eclipse, and evaluated on a number of Java applications. On average, our tool could migrate more than 90% of the references to legacy classes.

References

[1]
Aldrich, J., Chambers, C., Sirer, E. G., and Eggers, S. J. Static analyses for eliminating unnecessary synchronization from Java programs. In Static Analysis Symposium (1999), pp. 19--38.]]
[2]
Bäumer, D., Gamma, E., and Kieżun, A. Integrating refactoring support into a Java development tool. In OOPSLA'01 Companion (October 2001).]]
[3]
Beck, K. Extreme Programming Explained: Embrace Change. Addison-Wesley, 1999.]]
[4]
Bracha, G., Cohen, N., Kemper, C., Odersky, M., Stoutamire, D., Thorup, K., and Wadler, P. Adding generics to the Java programming language: Public draft specification, version 2.0. Tech. rep., Java Community Process JSR-000014, June 23 2003.]]
[5]
Chan, P., Lee, R., and Kramer, D. The Java Class Libraries Second Edition, Volume 1. Addison-Wesley, 1998.]]
[6]
Choi, J.-D., Gupta, M., Serrano, M., Sreedhar, V. C., and Midkiff, S. Escape analysis for Java. In Proc. OOPSLA'99 (1999), ACM Press, pp. 1--19.]]
[7]
Dean, J., Grove, D., and Chambers, C. Optimization of object-oriented programs using static class hierarchy analysis. In Proc. ECOOP'95 (Aarhus, Denmark, Aug. 1995), W. Olthoff, Ed., Springer-Verlag, pp. 77--101.]]
[8]
Dig, D., and Johnson, R. The role of refactorings in API evolution. Tech. Rep. UIUCDCS-R-2005-2555, University of Illinois at Urbana-Champaign, 2005.]]
[9]
Dmitriev, M. The first experience of class evolution support in PJama. In Proceedings of the 8th International Workshop on Persistent Object Systems (POS8) (Tiburon, CA, 1998), pp. 279--296.]]
[10]
Dmitriev, M. Language-specific make technology for the Java programming language. In Proc. of OOPSLA'02 (Seattle, WA, 2002), pp. 373--385.]]
[11]
Donovan, A., Kieżun, A., Tschantz, M. S., and Ernst, M. D. Converting Java programs to use generic libraries. In Proc. OOPSLA'04 (Vancouver, BC, Canada, October 26--28, 2004), pp. 15--34.]]
[12]
Eidorff, P. H., Henglein, F., Mossin, C., Niss, H., Sorensen, M. H., and Tofte, M. AnnoDomini: From type theory to year 2000 conversion tool. In Proc. POPL'99 (Austin, TX, 1999), pp. 1--14.]]
[13]
Fowler, M. Refactoring. Improving the Design of Existing Code. Addison-Wesley, 1999.]]
[14]
Fuhrer, R., Tip, F., Kiezun, A., Dolby, J., and Keller, M. Efficiently refactoring Java applications to use generic libraries. In Proc. ECOOP'05 (Glasgow, Scotland, 2005). To appear.]]
[15]
Gamma, E., Helm, R., Johnson, R., and Vlissides, J. Design Patterns. Elements of Reusable Object-Oriented Software. Addison-Wesley, 1994.]]
[16]
Griswold, W. G. Program Restructuring as an Aid to Software Maintenance. PhD thesis, University of Washington, 1991. Technical Report 91-08-04.]]
[17]
Griswold, W. G., and Notkin, D. Automated assistance for program restructuring. ACM Trans. Softw. Eng. Methodol. 2, 3 (1993), 228--269.]]
[18]
Henkel, J., and Diwan, A. CatchUp! Capturing and replaying refactorings to support API evolution. In Proceedings of the 27th International Conference on Software Engineering (ICSE'05) (St. Louis, MO, May 2005).]]
[19]
Hind, M., and Pioli, A. Evaluating the effectiveness of pointer alias analyses. Science of Comp. Programming 39, 1 (2001), 31--55.]]
[20]
Kerievsky, J. Refactoring to Patterns. Addison-Wesley, 2004.]]
[21]
Kontogiannis, K., Martin, J., Wong, K., Gregory, R., Müller, H., and Mylopoulos, J. Code migration through transformations: an experience report. In Proc. CASCON'98 (1998), IBM Press, pp. 1--12.]]
[22]
Mens, T., and Tourwé, T. A survey of software refactoring. IEEE Trans. on Software Engineering 30, 2 (February 2004), 126--139.]]
[23]
Opdyke, W. F. Refactoring Object-Oriented Frameworks. PhD thesis, University Of Illinois at Urbana-Champaign, 1992.]]
[24]
Opdyke, W. F., and Johnson, R. E. Creating abstract superclasses by refactoring. In The ACM 1993 Computer Science Conf. (CSC'93) (February 1993), pp. 66--73.]]
[25]
Palsberg, J., and Schwartzbach, M. Object-Oriented Type Systems. John Wiley & Sons, 1993.]]
[26]
Roberts, D., Brant, J., and Johnson, R. E. A refactoring tool for Smalltalk. Theory and Practice of Object Systems 3, 4 (1997), 253--263.]]
[27]
Ruf, E. Effective synchronization removal for Java. In Proc. PLDI 2000 (2000), ACM Press, pp. 208--218.]]
[28]
Ryder, B. G. Dimensions of precision in reference analysis of object-oriented programming languages. In Proc. CC 2003 (Warsaw, Poland, April 2003), pp. 126--137.]]
[29]
Shivers, O. Control-Flow Analysis of Higher-Order Languages. PhD thesis, CMU, May 1991. CMU--CS--91--145.]]
[30]
Sutter, B. D., Tip, F., and Dolby, J. Customization of Java library classes using type constraints and profile information. In Proc. ECOOP'04 (Oslo, Norway, June 2004), pp. 585--609.]]
[31]
Tip, F., Kieżun, A., and Bäumer, D. Refactoring for generalization using type constraints. In Proc. OOPSLA'03 (Anaheim, CA, October 2003), pp. 13--26.]]
[32]
Tip, F., Sweeney, P. F., Laffra, C., Eisma, A., and Streeter, D. Practical extraction techniques for Java. ACM Trans. on Programming Languages and Systems 24, 6 (2002), 625--666.]]
[33]
von Dincklage, D., and Diwan, A. Converting Java classes to use generics. In Proc. of OOPSLA'04 (Vancouver, BC, Canada, 2004), pp. 1--14.]]

Cited By

View all
  • (2024)Characterizing Python Library MigrationsProceedings of the ACM on Software Engineering10.1145/36437311:FSE(92-114)Online publication date: 12-Jul-2024
  • (2023)PyMigBench: A Benchmark for Python Library Migration2023 IEEE/ACM 20th International Conference on Mining Software Repositories (MSR)10.1109/MSR59073.2023.00075(511-515)Online publication date: May-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 SIGPLAN Notices
ACM SIGPLAN Notices  Volume 40, Issue 10
Proceedings of the 20th annual ACM SIGPLAN conference on Object oriented programming systems languages and applications
October 2005
531 pages
ISSN:0362-1340
EISSN:1558-1160
DOI:10.1145/1103845
Issue’s Table of Contents
  • cover image ACM Conferences
    OOPSLA '05: Proceedings of the 20th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications
    October 2005
    562 pages
    ISBN:1595930310
    DOI:10.1145/1094811
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: 12 October 2005
Published in SIGPLAN Volume 40, Issue 10

Check for updates

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)20
  • Downloads (Last 6 weeks)4
Reflects downloads up to 09 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Characterizing Python Library MigrationsProceedings of the ACM on Software Engineering10.1145/36437311:FSE(92-114)Online publication date: 12-Jul-2024
  • (2023)PyMigBench: A Benchmark for Python Library Migration2023 IEEE/ACM 20th International Conference on Mining Software Repositories (MSR)10.1109/MSR59073.2023.00075(511-515)Online publication date: May-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)Analyzing model changes with LoupeProceedings of the 25th International Conference on Model Driven Engineering Languages and Systems: Companion Proceedings10.1145/3550356.3561564(519-528)Online publication date: 23-Oct-2022
  • (2022)IntelliTCProceedings of the ACM/IEEE 44th International Conference on Software Engineering: Companion Proceedings10.1145/3510454.3516851(115-119)Online publication date: 21-May-2022
  • (2022)IntelliTC: Automating Type Changes in IntelliJ IDEA2022 IEEE/ACM 44th International Conference on Software Engineering: Companion Proceedings (ICSE-Companion)10.1109/ICSE-Companion55297.2022.9793766(115-119)Online publication date: May-2022
  • (2022)Characterizing usages, updates and risks of third-party libraries in Java projectsEmpirical Software Engineering10.1007/s10664-022-10131-827:4Online publication date: 1-Jul-2022
  • (2021)DepOwlProceedings of the 43rd International Conference on Software Engineering10.1109/ICSE43902.2021.00021(86-98)Online publication date: 22-May-2021
  • (2018)An empirical study on the impact of refactoring activities on evolving client-used APIsInformation and Software Technology10.1016/j.infsof.2017.09.00793:C(186-199)Online publication date: 1-Jan-2018
  • (2017)Semantic versioning and impact of breaking changes in the Maven repositoryJournal of Systems and Software10.1016/j.jss.2016.04.008129:C(140-158)Online publication date: 1-Jul-2017
  • Show More Cited By

View Options

Get Access

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