SOAR: A Synthesis Approach for Data Science API Refactoring

02/12/2021
by   Ansong Ni, et al.
0

With the growth of the open-source data science community, both the number of data science libraries and the number of versions for the same library are increasing rapidly. To match the evolving APIs from those libraries, open-source organizations often have to exert manual effort to refactor the APIs used in the code base. Moreover, due to the abundance of similar open-source libraries, data scientists working on a certain application may have an abundance of libraries to choose, maintain and migrate between. The manual refactoring between APIs is a tedious and error-prone task. Although recent research efforts were made on performing automatic API refactoring between different languages, previous work relies on statistical learning with collected pairwise training data for the API matching and migration. Using large statistical data for refactoring is not ideal because such training data will not be available for a new library or a new version of the same library. We introduce Synthesis for Open-Source API Refactoring (SOAR), a novel technique that requires no training data to achieve API migration and refactoring. SOAR relies only on the documentation that is readily available at the release of the library to learn API representations and mapping between libraries. Using program synthesis, SOAR automatically computes the correct configuration of arguments to the APIs and any glue code required to invoke those APIs. SOAR also uses the interpreter's error messages when running refactored code to generate logical constraints that can be used to prune the search space. Our empirical evaluation shows that SOAR can successfully refactor 80 44 layers with an average run time of 97.23 seconds, and 90 wrangling benchmarks with an average run time of 17.31 seconds.

READ FULL TEXT
research
07/18/2019

How Does API Migration Impact Software Quality and Comprehension? An Empirical Study

The migration process between different third-party software libraries i...
research
12/23/2022

Neural Transition-based Parsing of Library Deprecations

This paper tackles the challenging problem of automating code updates to...
research
07/26/2021

SeismographAPI: Visualising Temporal-Spatial Crisis Data

Effective decision-making for crisis mitigation increasingly relies on v...
research
01/11/2022

Predictive Synthesis of API-Centric Code

Today's programmers, especially data science practitioners, make heavy u...
research
10/12/2021

UCX Programming Interface for Remote Function Injection and Invocation

Network library APIs have historically been developed with the emphasis ...
research
08/28/2023

MELT: Mining Effective Lightweight Transformations from Pull Requests

Software developers often struggle to update APIs, leading to manual, ti...
research
08/27/2020

M3: Semantic API Migrations

Library migration is a challenging problem, where most existing approach...

Please sign up or login with your details

Forgot password? Click here to reset