Saved in:
Bibliographic Details
Main Authors: Ramos, Daniel, Gamboa, Catarina, Lynce, Inês, Manquinho, Vasco, Martins, Ruben, Goues, Claire Le
Format: Preprint
Published: 2026
Subjects:
Online Access:https://arxiv.org/abs/2602.01107
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866914299208794112
author Ramos, Daniel
Gamboa, Catarina
Lynce, Inês
Manquinho, Vasco
Martins, Ruben
Goues, Claire Le
author_facet Ramos, Daniel
Gamboa, Catarina
Lynce, Inês
Manquinho, Vasco
Martins, Ruben
Goues, Claire Le
contents Library migration is a common but error-prone task in software development. Developers may need to replace one library with another due to reasons like changing requirements or licensing changes. Migration typically entails updating and rewriting source code manually. While automated migration tools exist, most rely on mining examples from real-world projects that have already undergone similar migrations. However, these data are scarce, and collecting them for arbitrary pairs of libraries is difficult. Moreover, these migration tools often miss out on leveraging modern code transformation infrastructure. In this paper, we present a new approach to automated API migration that sidesteps the limitations described above. Instead of relying on existing migration data or using LLMs directly for transformation, we use LLMs to extract migration examples. Next, we use an Agent to generalize those examples to reusable transformation scripts in PolyglotPiranha, a modern code transformation tool. Our method distills latent migration knowledge from LLMs into structured, testable, and repeatable migration logic, without requiring preexisting corpora or manual engineering effort. Experimental results across Python libraries show that our system can generate diverse migration examples and synthesize transformation scripts that generalize to real-world codebases.
format Preprint
id arxiv_https___arxiv_org_abs_2602_01107
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle SPELL: Synthesis of Programmatic Edits using LLMs
Ramos, Daniel
Gamboa, Catarina
Lynce, Inês
Manquinho, Vasco
Martins, Ruben
Goues, Claire Le
Software Engineering
Artificial Intelligence
Machine Learning
Library migration is a common but error-prone task in software development. Developers may need to replace one library with another due to reasons like changing requirements or licensing changes. Migration typically entails updating and rewriting source code manually. While automated migration tools exist, most rely on mining examples from real-world projects that have already undergone similar migrations. However, these data are scarce, and collecting them for arbitrary pairs of libraries is difficult. Moreover, these migration tools often miss out on leveraging modern code transformation infrastructure. In this paper, we present a new approach to automated API migration that sidesteps the limitations described above. Instead of relying on existing migration data or using LLMs directly for transformation, we use LLMs to extract migration examples. Next, we use an Agent to generalize those examples to reusable transformation scripts in PolyglotPiranha, a modern code transformation tool. Our method distills latent migration knowledge from LLMs into structured, testable, and repeatable migration logic, without requiring preexisting corpora or manual engineering effort. Experimental results across Python libraries show that our system can generate diverse migration examples and synthesize transformation scripts that generalize to real-world codebases.
title SPELL: Synthesis of Programmatic Edits using LLMs
topic Software Engineering
Artificial Intelligence
Machine Learning
url https://arxiv.org/abs/2602.01107