Nothing Special   »   [go: up one dir, main page]

skip to main content
10.1145/3477314.3507153acmconferencesArticle/Chapter ViewAbstractPublication PagessacConference Proceedingsconference-collections
research-article
Open access

Towards automated library migrations with error prone and refaster

Published: 06 May 2022 Publication History

Abstract

Software projects use a significant number of external libraries to speed up development and deliver high-quality software in a cost-effective way. Requirements placed on external libraries can change over time and libraries may cease to be maintained or evolve in incompatible ways. Consequently, a library may no longer be fit for purpose and require replacement. Such a library migration is generally performed manually and may be complex, error-prone, and time-consuming, especially for large codebases. It follows that an automated approach to library migrations is preferred.
We consider the suitability of Error Prone and Refaster, two Google tools capable of refactoring Java programs, for automated library migration. We propose extensions that improve the accuracy with which Refaster templates are matched, as well as the correctness of their replacement operations. We additionally propose a set of Error Prone extensions to facilitate rewriting method return types. Together they enable a new class of rewrite operations especially relevant to library migrations.
For validation we consider a private industrial codebase as well as an actively developed open source codebase. We show that using out-of-the-box Error Prone and Refaster full migration of RxJava 2-referencing files is possible in only 35% and 0% of such files, respectively. Using the proposed extensions, we manage to fully migrate an additional 35% of the RxJava 2-referencing files in the former codebase, and an initial 39% of such files in the latter codebase.

References

[1]
Hussein Ahmed Talib Al-Rubaye. 2020. Towards the Automation of Migration and Safety of Third-Party Libraries. (2020), 191.
[2]
Hussein Alrubaye, Deema Alshoaibi, Eman Alomar, Mohamed Wiem Mkaouer, and Ali Ouni. 2020. How Does Library Migration Impact Software Quality and Comprehension? An Empirical Study. In Reuse in Emerging Software Engineering Practices, Sihem Ben Sassi, Stéphane Ducasse, and Hafedh Mili (Eds.). Vol. 12541. Springer International Publishing, Cham, 245--260.
[3]
Hussein Alrubaye, Mohamed Wiem Mkaouer, Igor Khokhlov, Leon Reznik, Ali Ouni, and Jason Mcgoff. 2020. Learning to Recommend Third-Party Library Migration Opportunities at the API Level. Applied Soft Computing 90 (May 2020), 106140.
[4]
H. Alrubaye, M. W. Mkaouer, and A. Ouni. 2019. MigrationMiner: An Automated Detection Tool of Third-Party Java Library Migration at the Method Level. In 2019 IEEE International Conference on Software Maintenance and Evolution (ICSME). 414--417.
[5]
H. Alrubaye, M. W. Mkaouer, and A. Ouni. 2019. On the Use of Information Retrieval to Automate the Detection of Third-Party Java Library Migration at the Method Level. In 2019 IEEE/ACM 27th International Conference on Program Comprehension (ICPC). 347--357.
[6]
Ittai Balaban, Frank Tip, and Robert Fuhrer. 2005. Refactoring Support for Class Library Migration. In Proceedings of the 20th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA '05). Association for Computing Machinery, New York, NY, USA, 265--279.
[7]
Chunyang Chen. 2020. SimilarAPI: Mining Analogical APIs for Library Migration. In 2020 IEEE/ACM 42nd International Conference on Software Engineering: Companion Proceedings (ICSE-Companion). 37--40.
[8]
Chow and Notkin. 1996. Semi-automatic update of applications in response to library changes. In 1996 Proceedings of International Conference on Software Maintenance. 359--368.
[9]
Danny Dig and Ralph Johnson. 2006. How Do APIs Evolve? A Story of Refactoring. Journal of Software Maintenance and Evolution: Research and Practice 18, 2 (2006), 83--107.
[10]
Google. [n. d.]. Google/Error-Prone. Google. https://github.com/google/error-prone Accessed: 10-23-2021.
[11]
Google. [n. d.]. Refaster Templates. https://errorprone.info/docs/refaster. https://errorprone.info/docs/refaster Accessed: 10-23-2021.
[12]
Gravitee.io. [n. d.]. Open Source API Management Platform - Gravitee. https://www.gravitee.io/ Accessed: 10-29-2021.
[13]
Hao He, Yulin Xu, Yixiao Ma, Yifei Xu, Guangtai Liang, and Minghui Zhou. 2021. A Multi-Metric Ranking Approach for Library Migration Recommendations. In 2021 IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER). 72--83.
[14]
JavaParser. 2019. JavaParser. https://javaparser.org/
[15]
Hong Jin Kang, Ferdian Thung, Julia L. Lawall, Gilles Muller, Lingxiao Jiang, and David Lo. 2019. Automating Program Transformation for Java Using Semantic Patches. https://hal.inria.fr/hal-02023368
[16]
Ameya Ketkar, Nikolaos Tsantalis, and Danny Dig. 2020. Understanding Type Changes in Java. In Proceedings of the 28th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering (ESEC/FSE 2020). Association for Computing Machinery, New York, NY, USA, 629--641.
[17]
Miryung Kim, Matthew Gee, Alex Loh, and Napol Rachatasumrit. 2010. Ref-Finder: A Refactoring Reconstruction Tool Based on Logic Query Templates. In Proceedings of the Eighteenth ACM SIGSOFT International Symposium on Foundations of Software Engineering (FSE '10). Association for Computing Machinery, New York, NY, USA, 371--372.
[18]
Raula Gaikovina Kula, Daniel M German, Ali Ouni, Takashi Ishio, and Katsuro Inoue. 2018. Do developers update their library dependencies? Empirical Software Engineering 23, 1 (2018), 384--417.
[19]
Kui Liu, Anil Koyuncu, Dongsun Kim, and Tegawendé F. Bissyandé. 2019. TBar: Revisiting Template-Based Automated Program Repair. In Proceedings of the 28th ACM SIGSOFT International Symposium on Software Testing and Analysis (ISSTA 2019). Association for Computing Machinery, New York, NY, USA, 31--42.
[20]
OpenRewrite. [n. d.]. Semantic code search and transformation. https://github.com/openrewrite/rewrite Accessed: 10-23-2021.
[21]
Project Reactor. 2021. RxJava2Adapter (reactor-adapter 3.4.4). https://projectreactor.io/docs/adapter/release/api/reactor/adapter/rxjava/RxJava2Adapter.html Accessed: 10-23-2021.
[22]
Smallrye. [n. d.]. Mutiny! https://smallrye.io/smallrye-mutiny Accessed: 23-10-21.
[23]
JDT/Core Team. [n. d.]. JDT Core Component | The Eclipse Foundation. https://www.eclipse.org/jdt/core/
[24]
C. Teyton, J. Falleri, and X. Blanc. 2012. Mining Library Migration Graphs. In 2012 19th Working Conference on Reverse Engineering. 289--298.
[25]
Cédric Teyton, Jean-Rémy Falleri, Marc Palyart, and Xavier Blanc. 2014. A Study of Library Migrations in Java. Journal of Software: Evolution and Process 26, 11 (2014), 1030--1052.
[26]
Louis Wasserman. 2013. Scalable, Example-Based Refactorings with Refaster. In Proceedings of the 2013 ACM Workshop on Workshop on Refactoring Tools - WRT '13. ACM Press, Indianapolis, Indiana, USA, 25--28.
[27]
Victor L Winter and Azamat Mametjanov. 2007. Generative programming techniques for Java library migration. In Proceedings of the 6th international conference on Generative programming and component engineering. 185--196.
[28]
Ling Wu, Qian Wu, Guangtai Liang, Qianxiang Wang, and Zhi Jin. 2015. Transforming Code with Compositional Mappings for API-Library Switching. In 2015 IEEE 39th Annual Computer Software and Applications Conference, Vol. 2. 316--325.
[29]
Wei Wu, Yann-Gaël Guéhéneuc, Giuliano Antoniol, and Miryung Kim. 2010. AURA: a hybrid approach to identify framework evolution. In 2010 ACM/IEEE 32nd International Conference on Software Engineering, Vol. 1. 325--334.

Cited By

View all
  • (2025)DeepMigInformation and Software Technology10.1016/j.infsof.2024.107588177:COnline publication date: 1-Jan-2025
  • (2024)A Novel Refactoring and Semantic Aware Abstract Syntax Tree Differencing Tool and a Benchmark for Evaluating the Accuracy of Diff ToolsACM Transactions on Software Engineering and Methodology10.1145/369600234:2(1-63)Online publication date: 12-Sep-2024
  • (2024)A Lightweight Polyglot Code Transformation LanguageProceedings of the ACM on Programming Languages10.1145/36564298:PLDI(1288-1312)Online publication date: 20-Jun-2024
  • Show More Cited By

Index Terms

  1. Towards automated library migrations with error prone and refaster

    Recommendations

    Comments

    Please enable JavaScript to view thecomments powered by Disqus.

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    SAC '22: Proceedings of the 37th ACM/SIGAPP Symposium on Applied Computing
    April 2022
    2099 pages
    ISBN:9781450387132
    DOI:10.1145/3477314
    Permission to make digital or hard copies of part or all 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 third-party components of this work must be honored. For all other uses, contact the Owner/Author.

    Sponsors

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 06 May 2022

    Check for updates

    Author Tags

    1. automation
    2. error prone
    3. library migration
    4. refactoring
    5. refaster

    Qualifiers

    • Research-article

    Conference

    SAC '22
    Sponsor:

    Acceptance Rates

    Overall Acceptance Rate 1,650 of 6,669 submissions, 25%

    Upcoming Conference

    SAC '25
    The 40th ACM/SIGAPP Symposium on Applied Computing
    March 31 - April 4, 2025
    Catania , Italy

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)177
    • Downloads (Last 6 weeks)25
    Reflects downloads up to 16 Feb 2025

    Other Metrics

    Citations

    Cited By

    View all
    • (2025)DeepMigInformation and Software Technology10.1016/j.infsof.2024.107588177:COnline publication date: 1-Jan-2025
    • (2024)A Novel Refactoring and Semantic Aware Abstract Syntax Tree Differencing Tool and a Benchmark for Evaluating the Accuracy of Diff ToolsACM Transactions on Software Engineering and Methodology10.1145/369600234:2(1-63)Online publication date: 12-Sep-2024
    • (2024)A Lightweight Polyglot Code Transformation LanguageProceedings of the ACM on Programming Languages10.1145/36564298:PLDI(1288-1312)Online publication date: 20-Jun-2024
    • (2024)Compiler-directed Migrating API Callsite of Client CodeProceedings of the IEEE/ACM 46th International Conference on Software Engineering10.1145/3597503.3639084(1-12)Online publication date: 20-May-2024
    • (2024)Custom static analysis to enhance insight into the usage of in-house librariesJournal of Systems and Software10.1016/j.jss.2024.112028212:COnline publication date: 9-Jul-2024
    • (2023)“We Feel Like We’re Winging It:” A Study on Navigating Open-Source Dependency AbandonmentProceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering10.1145/3611643.3616293(1281-1293)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

    View Options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Login options

    Figures

    Tables

    Media

    Share

    Share

    Share this Publication link

    Share on social media