Assessing the Capability of LLMs for Deprecated API Usage Updating from Natural Language Descriptions

As third-party libraries evolve, some API usages become deprecated, requiring corresponding updates in client code. Although library maintainers often provide natural language (NL) descriptions through changelogs or warnings to assist migration, updating deprecated API usage remains labor-intensive and error-prone. In this paper, we present the first empirical study that investigates whether LLMs can effectively update deprecated API usages based on NL descriptions. To this end, we construct a comprehensive benchmark of real-world API deprecation updates. Specifically, we convert NL descriptions into static rules, and identify matching updates from candidate code modifications retrieved via keyword search. The benchmark covers diverse deprecation granularities and varying levels of updating difficulty. Based on this benchmark, we evaluate 12 representative LLMs from four model families with different types and sizes. Our findings reveal that models from different families exhibit varying effectiveness in updating deprecated API usages, and both model size and code-specific tuning influence performance. By examining results across different levels of difficulty, we find that LLMs perform well on simple cases that only require element replacement, whereas complex cases involving additional code adaptation remain challenging. According to our manual analysis, non-trivial parameter changes and required data transformations account for the majority of cases that all LLMs fail to handle effectively. We further assess whether providing additional information such as surrounding code context and API documentation can help improve the effectiveness. Overall, our study highlights that automatically updating deprecated API usages from NL descriptions remains a challenging problem, and provides practical implications for future improvements in LLM-based updating. Additionally, our automatic data collection process has the additional benefit of detecting inconsistencies between deprecation documentation and code. In this process, we identified six documentation bugs, all of which have been confirmed and fixed.

Authors

Institutions

Publication Details

Journal
ACM Transactions on Software Engineering and Methodology
Published
2026-04-15
DOI
https://doi.org/10.1145/3808230
Primary Topic
Software Engineering Research
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Assessing the Capability of LLMs for Deprecated API Usage Updating from Natural Language Descriptions

S J Liu, Y C Li, Tingwei Zhu, Tian Zhang et al.
ACM Transactions on Software Engineering and Methodology
Software Engineering Research
article

Assessing the Capability of LLMs for Deprecated API Usage Updating from Natural Language Descriptions

S J Liu, Y C Li, Tingwei Zhu, Tian Zhang, Zhongzhen Wen, Xin Xia
article en

Abstract

As third-party libraries evolve, some API usages become deprecated, requiring corresponding updates in client code. Although library maintainers often provide natural language (NL) descriptions through changelogs or warnings to assist migration, updating deprecated API usage remains labor-intensive and error-prone. In this paper, we present the first empirical study that investigates whether LLMs can effectively update deprecated API usages based on NL descriptions. To this end, we construct a comprehensive benchmark of real-world API deprecation updates. Specifically, we convert NL descriptions into static rules, and identify matching updates from candidate code modifications retrieved via keyword search. The benchmark covers diverse deprecation granularities and varying levels of updating difficulty. Based on this benchmark, we evaluate 12 representative LLMs from four model families with different types and sizes. Our findings reveal that models from different families exhibit varying effectiveness in updating deprecated API usages, and both model size and code-specific tuning influence performance. By examining results across different levels of difficulty, we find that LLMs perform well on simple cases that only require element replacement, whereas complex cases involving additional code adaptation remain challenging. According to our manual analysis, non-trivial parameter changes and required data transformations account for the majority of cases that all LLMs fail to handle effectively. We further assess whether providing additional information such as surrounding code context and API documentation can help improve the effectiveness. Overall, our study highlights that automatically updating deprecated API usages from NL descriptions remains a challenging problem, and provides practical implications for future improvements in LLM-based updating. Additionally, our automatic data collection process has the additional benefit of detecting inconsistencies between deprecation documentation and code. In this process, we identified six documentation bugs, all of which have been confirmed and fixed.

ACM Transactions on Software Engineering and Methodology
Nanyang Technological University (SG), Zhejiang University (CN), Nanjing University (CN)
Reduced inequalities
Openalex Percentile: Top 12%
Software Engineering Research
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.