Publication Type
Conference Proceeding Article
Version
acceptedVersion
Publication Date
9-2021
Abstract
Due to the rise of AI applications, machine learning (ML) libraries, often written in Python, have become far more accessible. ML libraries tend to be updated periodically, which may deprecate existing APIs, making it necessary for application developers to update their usages. In this paper, we build a tool to automate deprecated API usage updates. We first present an empirical study to better understand how updates of deprecated ML API usages in Python can be done. The study involves a dataset of 112 deprecated APIs from Scikit-Learn, TensorFlow, and PyTorch. Guided by the findings of our empirical study, we propose MLCatchUp, a tool to automate the updates of Python deprecated API usages, that automatically infers the API migration transformation through comparison of the deprecated and updated API signatures. These transformations are expressed in a Domain Specific Language (DSL). We evaluate MLCatchUp using a dataset containing 267 files with 551 API usages that we collected from public GitHub repositories. In our dataset, MLCatchUp can detect deprecated API usages with perfect accuracy, and update them correctly for 80.6% of the cases. We further improve the accuracy of MLCatchUp in performing updates by adding a feature that allows it to accept an additional user input that specifies the transformation constraints in the DSL for context-dependent API migration. Using this addition, MLCatchUp can make correct updates for 90.7% of the cases
Keywords
Python, Program Transformation, Automatic Update, Deprecated API
Discipline
Artificial Intelligence and Robotics | Software Engineering
Research Areas
Software and Cyber-Physical Systems
Publication
37th IEEE International Conference on Software Maintenance and Evolution (ICSME 2021)
Identifier
10.1109/ICSME52107.2021.00019
Publisher
IEEE
City or Country
Virtual Event, Luxembourg
Citation
AGUS HARYONO, Stefanus; Ferdian, Thung; LO, David; LAWALL, Julia; and JIANG, Lingxiao.
Characterization and automatic updates of deprecated machine-learning API usages. (2021). 37th IEEE International Conference on Software Maintenance and Evolution (ICSME 2021).
Available at: https://ink.library.smu.edu.sg/sis_research/6649
Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-No Derivative Works 4.0 International License.
Additional URL
http://doi.org/10.1109/ICSME52107.2021.00019