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 about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext e0ab7729-76a2-4c7a-b3e5-3a76557b6b79Cited 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
- An empirical study on API parameter rulesHao Zhong, Na Meng, Zexuan Li, Li JiaICSE 2020 · 16 citations
- REPFINDER: Finding Replacements for Missing APIs in Library UpdateKaifeng Huang, Bihuan Chen, Linghao Pan, Shuai Wu et al.ASE 2021 · 14 citations
