MELT: Mining Effective Lightweight Transformations from Pull Requests
Daniel Ramos, Hailie Mitchell, Inês Lynce, Vasco Manquinho, Ruben Martins, Claire Le Goues
Abstract
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 Comby, 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 9×. 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.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
4 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Automatically Fixing Dependency Breaking Changes cites APIfix: output-oriented program synthesis for combating breaking changes in libraries
- PYEVOLVE: Automating Frequent Code Changes in Python ML Systems cites Inferring and Applying Type Changes
- PYEVOLVE: Automating Frequent Code Changes in Python ML Systems cites APIfix: output-oriented program synthesis for combating breaking changes in libraries
- A Lightweight Polyglot Code Transformation Language cites Inferring and Applying Type Changes
- A Lightweight Polyglot Code Transformation Language cites SOAR: A Synthesis Approach for Data Science API Refactoring
- Unprecedented Code Change Automation: The Fusion of LLMs and Transformation by Example cites PYEVOLVE: Automating Frequent Code Changes in Python ML Systems
- Unprecedented Code Change Automation: The Fusion of LLMs and Transformation by Example cites Inferring and Applying Type Changes
- Unprecedented Code Change Automation: The Fusion of LLMs and Transformation by Example cites APIfix: output-oriented program synthesis for combating breaking changes in libraries
Cited by top-tier papers4
- Unprecedented Code Change Automation: The Fusion of LLMs and Transformation by ExampleMalinda Dilhara, Abhiram Bellur, Timofey Bryksin, Danny DigFSE 2024 · 18 citations
- Towards Diverse Program Transformations for Program SimplificationHaibo Wang, Zezhong Xing, Chengnian Sun, Zheng Wang et al.FSE 2025 · 1 citation
- A Lightweight Polyglot Code Transformation LanguageAmeya Ketkar, Daniel Ramos, Lazaro Clapp, Raj Barik et al.PLDI 2024 · 1 citation
- Automatically Fixing Dependency Breaking ChangesLukas Fruntke, Jens KrinkeFSE 2025
Builds on6
- NEZHA: Efficient Domain-Independent Differential TestingTheofilos Petsios, Adrian Tang, Salvatore J. Stolfo, Angelos D. Keromytis et al.S&P 2017 · 132 citations
- PYEVOLVE: Automating Frequent Code Changes in Python ML SystemsMalinda Dilhara, Danny Dig, Ameya KetkarICSE 2023 · 46 citations
- SOAR: A Synthesis Approach for Data Science API RefactoringAnsong Ni, Daniel Ramos, Aidan Z. H. Yang, Inês Lynce et al.ICSE 2021 · 27 citations
- Inferring and Applying Type ChangesAmeya Ketkar, Oleg Smirnov, Nikolaos Tsantalis, Danny Dig et al.ICSE 2022 · 17 citations
- APIfix: output-oriented program synthesis for combating breaking changes in librariesXiang Gao, Arjun Radhakrishna, Gustavo Soares, Ridwan Shariffdeen et al.OOPSLA 2021 · 17 citations
Related papers
- M3: Semantic API MigrationsBruce Collie, Philip Ginsbach, Jackson Woodruff, Ajitha Rajan et al.ASE 2020 · 14 citations
- Compiler-directed Migrating API Callsite of Client CodeHao Zhong, Na MengICSE 2024 · 5 citations
- The Fix Is Right at Hand: Fixing Incompatibility Errors Guided by Library Knowledge for Automatic Library UpgradeZhuotong Zhou, Susheng Wu, Junpeng Zhao, Bihuan Chen et al.ISSTA 2026
- Syntax Is All You Need: A Universal-Language Approach to Mutant GenerationSourav Deb, Kush Jain, Rijnard van Tonder, Claire Le Goues et al.FSE 2024 · 7 citations
- An empirical study on API parameter rulesHao Zhong, Na Meng, Zexuan Li, Li JiaICSE 2020 · 16 citations
