The Fix Is Right at Hand: Fixing Incompatibility Errors Guided by Library Knowledge for Automatic Library Upgrade
Zhuotong Zhou, Susheng Wu, Junpeng Zhao, Bihuan Chen, YenQin Hoo, Yiheng Huang, Yiheng Cao, Xin Peng
Key points
From the paper's conclusion- Our evaluation has also indicated the practical usefulness of Librarian in fixing incompatibility errors in 32 real-world projects.
Abstract
Third-party libraries (TPLs) play critical roles in modern software development. Upgrading them is crucial for enhanced security and functionality, but often introduces incompatibility errors, caused by breaking changes in library APIs, in client code. Existing approaches rely on predefined migration patterns or API recommendation heuristics, which suffer from limited pattern coverage and ignore the usage context of broken API, leading to incorrect or incomplete fixes. To address these limitations, we propose Librarian, a novel LLM-based approach to automatically fix incompatibility errors when upgrading a dependent library in a client project. The core idea of Librarian is to extract context-aware fix hints from the library codebase, serving as semantic few-shot examples, enabling LLM to generate fixes without relying on predefined patterns. Since LLM may generate an incorrect or incomplete fix, Librarian performs fix refinement based on compilation feedback from the client project. Our evaluation has demonstrated that Librarian achieves a fixing success rate of 84.2%, outperforming the state-of-the-arts by at least 45.3%. Our evaluation has also indicated the practical usefulness of Librarian in fixing incompatibility errors in 32 real-world projects.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- Byam: Fixing Breaking Dependency Updates with Large Language ModelsEmpirical Software Engineering · 2026
- Spell : Synthesis of Programmatic Edits Using LLMsACM Transactions on Software Engineering and Methodology · 2026
- Who Broke Me? Execution-Guided Repair of Behavioral Dependency BreaksarXiv · 2026
- PatchPorter: LLM-Driven Security Patch Porting via Version Tracing and Context Selection for NPMProceedings of the ACM on Software Engineering · 2026
- HELO-APR: Enhancing Low-Resource Program Repair through Cross-Lingual Knowledge TransferProceedings of the ACM on software engineering. · 2026
- LLM-Assisted Software Migration: from Module-Level Transformation to Repository-Level IntegrationarXiv · 2026