Automatic Library Migration Using Large Language Models: First Results
Aylton Almeida, Laerte Xavier, Marco Tulio Valente

TL;DR
This paper explores using ChatGPT to automate API migration tasks in Python, specifically upgrading code to newer SQLAlchemy versions, demonstrating promising initial results with different prompt strategies.
Contribution
It presents the first study applying ChatGPT to automate API migration in software engineering, focusing on SQLAlchemy version upgrades.
Findings
One-Shot prompts achieved the best migration success.
ChatGPT successfully migrated all columns and enabled new functionalities.
Preserved original code behavior during migration.
Abstract
Despite being introduced only a few years ago, Large Language Models (LLMs) are already widely used by developers for code generation. However, their application in automating other Software Engineering activities remains largely unexplored. Thus, in this paper, we report the first results of a study in which we are exploring the use of ChatGPT to support API migration tasks, an important problem that demands manual effort and attention from developers. Specifically, in the paper, we share our initial results involving the use of ChatGPT to migrate a client application to use a newer version of SQLAlchemy, an ORM (Object Relational Mapping) library widely used in Python. We evaluate the use of three types of prompts (Zero-Shot, One-Shot, and Chain Of Thoughts) and show that the best results are achieved by the One-Shot prompt, followed by the Chain Of Thoughts. Particularly, with the…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
