MELT: Mining Effective Lightweight Transformations from Pull Requests

08/28/2023
by   Daniel Ramos, et al.
0

Software developers often struggle to update APIs, leading to manual, time-consuming, and error-prone processes. We introduce MELT, a new approach that generates lightweight API migration rules directly from pull requests in popular library repositories. Our key insight is that pull requests merged into open-source libraries are a rich source of information sufficient to mine API migration rules. By leveraging code examples mined from the library source and automatically generated code examples based on the pull requests, we infer transformation rules in , a language for structural code search and replace. Since inferred rules from single code examples may be too specific, we propose a generalization procedure to make the rules more applicable to client projects. MELT rules are syntax-driven, interpretable, and easily adaptable. Moreover, unlike previous work, our approach enables rule inference to seamlessly integrate into the library workflow, removing the need to wait for client code migrations. We evaluated MELT on pull requests from four popular libraries, successfully mining 461 migration rules from code examples in pull requests and 114 rules from auto-generated code examples. Our generalization procedure increases the number of matches for mined rules by 9x. We applied these rules to client projects and ran their tests, which led to an overall decrease in the number of warnings and fixing some test cases demonstrating MELT's effectiveness in real-world scenarios.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
05/06/2021

Migrating Client Code without Change Examples

API developers evolve software libraries to fix bugs, add new features, ...
research
07/03/2022

PyMigBench and PyMigTax: A Benchmark and Taxonomy for Python Library Migration

Developers heavily rely on Application Programming Interfaces (APIs) fro...
research
06/02/2019

On the Use of Information Retrieval to Automate the Detection of Third-Party Java Library Migration at the Method Level

The migration process between different third-party libraries is hard, c...
research
02/12/2021

SOAR: A Synthesis Approach for Data Science API Refactoring

With the growth of the open-source data science community, both the numb...
research
08/22/2023

Recommending Analogical APIs via Knowledge Graph Embedding

Library migration, which re-implements the same software behavior by usi...
research
01/20/2022

Providing Upgrade Plans for Third-party Libraries: A Recommender System using Migration Graphs

During the development of a software project, developers often need to u...
research
05/18/2023

Participatory Budgeting: Data, Tools, and Analysis

We provide a library of participatory budgeting data (Pabulib) and open ...

Please sign up or login with your details

Forgot password? Click here to reset