Adaptoring: Adapter Generation to Provide an Alternative API for a Library
Third-party libraries are a cornerstone of fast application development. To enable efficient use, libraries must provide a well-designed API. An obscure API instead slows down the learning process and can lead to erroneous use.
The usual approach to improve the API of a library is to edit its code directly, either keeping the old API but deprecating it (temporarily increasing the API size) or dropping it (introducing breaking changes). If maintainers are unwilling to make such changes, others need to create a hard fork, which they can refactor. But then it is difficult to incorporate changes to the original library, such as bug fixes or performance improvements.
In this paper, we instead explore the use of the adapter pattern to provide a new API as a new library that calls the original library internally. This allows the new library to leverage all implementation changes to the original library, at no additional cost. We call this approach adaptoring. To make the approach practical, we identify API transformations for which adapter code can be generated automatically, and investigate which transformations can be inferred automatically, based on the documentation and usage patterns of the original library. For cases where automated inference is not possible, we present a tool that lets developers manually specify API transformations. Finally, we consider the issue of migrating the generated adapters if the original library introduces breaking changes. We implemented our approach for Python, demonstrating its effectiveness to quickly provide an alternative API even for large libraries.
Wed 13 MarDisplayed time zone: Athens change
14:00 - 15:30 | API and Dependency AnalysisResearch Papers / Reproducibility Studies and Negative Results (RENE) Track at LAPPI Chair(s): Martin Monperrus KTH Royal Institute of Technology | ||
14:00 15mTalk | The Limits of the Identifiable: Challenges in Python Version Identification with Deep Learning Reproducibility Studies and Negative Results (RENE) Track Marcus Gerhold University of Twente, The Netherlands, Lola Solovyeva University of Twente, Vadim Zaytsev University of Twente, Netherlands Pre-print | ||
14:15 15mTalk | Exploring Dependencies Among Inconsistencies to Enhance the Consistency Maintenance of Models Research Papers Luciano Marchezan Johannes Kepler Universität Linz, Wesley Assunção North Carolina State University, Edvin Herac , Saad Shafiq University of Southern California, Alexander Egyed Johannes Kepler University Linz | ||
14:30 15mTalk | BUMP: A Benchmark of Reproducible Breaking Dependency Updates Research Papers Frank Reyes Garcia KTH Royal Institute of Technology, Yogya Gamage KTH Royal Institute of Technology, Gabriel Skoglund KTH Royal Institute of Technology, Benoit Baudry KTH, Martin Monperrus KTH Royal Institute of Technology | ||
14:45 15mTalk | APIGen: Generative API Method Recommendation Research Papers Yujia Chen Harbin Institute of Technology, Shenzhen, Cuiyun Gao Harbin Institute of Technology, Muyijie Zhu Harbin Institute of Technology, Shenzhen, Qing Liao Harbin Institute of Technology, Yong Wang Anhui Polytechnic University, Guoai Xu Harbin Institute of Technology, Shenzhen | ||
15:00 15mTalk | A Multi-Metric Ranking with Label Correlations Approach for Library Migration Recommendations Research Papers Jiancheng Zhang SouthWest Petroleum University, Peng Wu Sichuan Tourism University, Qin Luo Southwest Petroleum University | ||
15:15 15mTalk | Adaptoring: Adapter Generation to Provide an Alternative API for a Library Research Papers Pre-print |