arXiv:2608.30497cs.SEAug 2026

Manuscript Offprint

arXiv:2608.30497

Bridge: Automatically Mining Ecosystem-Scale API Update Mappings and Client Update Instances

Kai Gao, Yu Sun, Chang-ai Sun

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

KAI GAO, University of Science and Technology Beijing, China

YU SUN, University of Science and Technology Beijing, China

CHANG-AI SUN, University of Science and Technology Beijing, China

Library updates are essential for incorporating bug fixes, security patches, and new features, but they often require adapting client code to API changes. API update mappings that identify relations between legacy and replacement APIs, version transitions that these mappings apply, and client update instances that capture concrete API call changes are essential for developing and evaluating automated library update techniques. Existing library evolution datasets capture different subsets of this information, but none simultaneously provides all three. Moreover, these datasets typically cover a small number of third-party libraries, limiting the diversity of API updates they capture. Constructing a dataset that provides all three types of information at ecosystem scale is challenging because it requires reliably connecting API update mappings, version transitions, and client update instances across large numbers of library releases and client projects.

To address this challenge, we present BRIDGE, a client-driven framework that starts from observed client dependency updates, which naturally connect library version transitions with client code changes. Built on the World of Code (WoC) infrastructure, BRIDGE mines candidate update instances from client dependency update commits at scale, validates them using library-side evidence, and then derives API update mappings from validated instances. This design grounds each retained mapping in at least one client update instance. On a manually annotated ground truth dataset, BRIDGE achieves 91.6% precision and 88.7% recall for Java and 90.1% precision and 64.0% recall for Python. Applied to WoC V3, BRIDGE mines 381,661 Java and 277,259 Python client update instances, representing 18,900 and 4,456 API update mappings across 2,557 and 999 libraries, respectively. The mined mappings exhibit a pronounced long-tail distribution, with most appearing in only a few client update instances. As one application of the dataset, we evaluate four large language models on replacement API recommendation, a key step in library updates. The best recommendation accuracy reaches only 37.1% for Java and 44.4% for Python, and all evaluated models perform substantially better on frequently observed mappings than on mappings observed in only a few client update instances, highlighting the difficulty current LLMs face in recommending replacements for mappings in the long tail. Overall, BRIDGE provides an automated approach to constructing ecosystem-scale library update datasets that connect what APIs are replaced, between which versions, and how clients perform the updates.

CCS Concepts: • Software and its engineering → Software evolution; Software libraries and repositories.

Additional Key Words and Phrases: Library Update, Mining Software Repositories, API analysis, Library Ecosystems, Large Language Models

Authors' Contact Information: Kai Gao, University of Science and Technology Beijing, Beijing, China, kai.gao@ustb.edu.cn; Yu Sun, University of Science and Technology Beijing, Beijing, China, yusun@xs.ustb.edu.cn; Chang-ai Sun, University of Science and Technology Beijing, Beijing, China, casun@ustb.edu.cn.

Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from permissions@acm.org.

© 2018 Copyright held by the owner/author(s). Publication rights licensed to ACM.

ACM 1557-735X/2018/8-ART111

https://doi.org/XXXXXXX.XXXXXXX

111:2

Kai Gao, Yu Sun, and Chang-ai Sun

ACM Reference Format:

Kai Gao, Yu Sun, and Chang-ai Sun. 2018. BRIDGE: Automatically Mining Ecosystem-Scale API Update Mappings and Client Update Instances. J. ACM 37, 4, Article 111 (August 2018), 34 pages. https://doi.org/XXXXXXX.XXXXXXX

1 Introduction

Modern software systems depend extensively on third-party libraries for reusable functionality. New library versions provide security patches, bug fixes, and new features, making timely library updates an important dependency management practice for software security and quality [17, 58, 70]. However, new releases may deprecate or remove APIs [65, 75], breaking client code [4, 5] and imposing substantial maintenance effort on developers [3, 43]. Consequently, developers often adopt the conservative practice of “if it ain’t broke, don’t fix it” and forgo library updates [10, 43, 64].

Automating library updates requires information about what APIs should be replaced and how client code should be adapted. Specifically, API update mappings identify relations between legacy and replacement APIs, their applicable version transitions specify when these replacements occur, and client update instances capture concrete API call changes performed during library updates. Such information underpins rule-based techniques that derive and apply code transformation rules [12,16,25,27,44,51,54,84][12, 16, 25, 27, 44, 51, 54, 84]. Recent LLM-based techniques similarly incorporate API mappings, update examples, or natural-language instructions into prompts to adapt client code [2,47,67,71][2, 47, 67, 71]. These three forms of information therefore provide useful data for developing and evaluating automated library update techniques.

Existing library evolution datasets [7, 36, 42, 74, 81] capture different subsets of this information, but none simultaneously provides all three. They also typically cover a small number of third-party libraries, limiting the diversity of API updates they capture. As shown in Figure 1, their construction generally follows a library-driven workflow: they begin with a predefined collection of libraries, identify API changes or mappings within them, and then prepare corresponding code examples from sources such as documentation [42, 81], client projects [74], manual construction [36], or LLM generation [7]. Scaling this workflow is challenging because API update mappings identified from library artifacts must be connected to the version transitions and client code changes in which they are actually observed, which requires analysis across large numbers of library releases and client projects. Moreover, client projects typically exercise only a small subset of the APIs exposed by their dependencies [35, 74], so even a known mapping may have few or no observable client update instances. Consequently, ecosystem-scale library update datasets that connect API update mappings, version transitions, and client update instances remain scarce.

To address this challenge, we present BRIDGE, a client-driven framework for automatically constructing library update datasets from observed client dependency updates. As illustrated in Figure 1, instead of first identifying API update mappings and subsequently obtaining code examples, BRIDGE starts from dependency update commits in client projects. Such commits directly provide the updated library and its old and new versions, while associated source code changes provide candidate adaptations for that version transition. BRIDGE therefore first mines candidate update instances from client-side API call changes, validates the candidates using library-side evidence, and then derives API update mappings from validated instances. Its key design principle is that client code provides plausible replacement candidates, while library artifacts provide evidence for validating them. Consequently, the resulting library update dataset connects API update mappings, version transitions, and client update instances, with each retained mapping associated with a version transition and grounded in at least one client update instance.

Built on the World of Code (WoC) infrastructure [45, 46], BRIDGE realizes this client-driven workflow in four phases. It first identifies commits that update dependency versions and also

111:3

Figure

Fig. 1. Comparison of library-driven and BRIDGE's client-driven workflows to constructing library update datasets.

modify source files, which naturally links version transitions and client code changes. It then extracts API call metadata from the old and new source blobs. Next, BRIDGE identifies changed calls associated with the updated library and applies similarity-based matching to generate candidate update instances. Finally, it validates the candidates against the involved library versions by verifying API existence and the removal or depreciation of the legacy API, and then derives API update mappings from the validated instances.

We implement BRIDGE for two popular and substantially different ecosystems, Java and Python, and evaluate it from four perspectives. First, we evaluate its accuracy in mining client update instances against a manually annotated ground truth dataset containing 344 and 242 genuine update instances in 638 Java and 609 Python API call change records, respectively. BRIDGE achieves 91.6% precision, 88.7% recall, and a 90.1% F1 score for Java, and 90.1% precision, 64.0% recall, and a 74.9% F1 score for Python. Second, we analyze the similarity parameters used for client-side candidate generation and the contribution of library-side validation. Similarity weights have limited impact on the F1 score, while the matching threshold controls the precision–recall tradeoff. More importantly, library-side validation improves precision by 40.3 percentage points for Java and 43.3 points for Python, empirically supporting the design of combining client-side candidate generation with library-side validation. Third, we apply BRIDGE to WoC V3 and construct a dataset containing 381,661 client update instances and 18,900 API update mappings across 2,557 Java libraries, together with 277,259 instances and 4,456 mappings across 999 Python libraries. The mined mappings exhibit a pronounced long-tail distribution: the median mapping appears in only two client update instances, while a small number recur in thousands or tens of thousands of instances. Finally, we demonstrate one application of the dataset by evaluating four large language models on replacement API recommendation, a key step in library updates. The best recommendation accuracy reaches only 37.1% for Java and 44.4% for Python, and all evaluated models perform substantially worse on mappings observed in only a few client update instances. By connecting API update mappings with their occurrences in client updates, the dataset enables such frequency-aware analyses and highlights the challenge current LLMs face in recommending replacements for mappings in the long tail.

In summary, this paper makes the following contributions:

• We propose BRIDGE, a client-driven framework for automatically constructing library update datasets that connect API update mappings, version transitions, and client update instances.

• We implement BRIDGE for Java and Python and systematically evaluate its effectiveness and key design choices, demonstrating its effectiveness for high-precision library update dataset construction.

• We construct an ecosystem-scale dataset spanning thousands of Java and Python libraries and hundreds of thousands of client update instances, with a pronounced long-tail distribution of API replacements.

111:4

Kai Gao, Yu Sun, and Chang-ai Sun

  • We demonstrate the utility of the dataset through a replacement API recommendation study, revealing that LLMs have substantially greater difficulty in recommending replacements for mappings in the long tail.

The remainder of this paper is organized as follows. Section 2 introduces the background and related work, Section 3 presents the BRIDGE framework, Section 4 reports the evaluation, and Section 5 discusses the implications and threats to validity. Section 6 concludes the paper. The implementation of BRIDGE and the mined dataset are publicly available at https://github.com/ROCKSE/Bridge.

References (30)