Third-party libraries (TPLs) have become an essential component of software, accelerating development and reducing maintenance costs. However, breaking changes often occur during the upgrades of TPLs and prevent client programs from moving forward. Semantic versioning (SemVer) has been applied to standardize the versions of releases according to compatibility, but not all releases follow SemVer compliance. Lots of work focuses on SemVer compliance in ecosystems such as Java and JavaScript beyond Golang (Go for short). Due to the lack of tools to detect breaking changes and dataset for Go, developers of TPLs do not know if breaking changes occur and affect client programs, and developers of client programs may hesitate to upgrade dependencies in terms of breaking changes. To bridge this gap, we conduct the first large-scale empirical study in the Go ecosystem to study SemVer compliance in terms of breaking changes and their impact. In detail, we purpose GoSVI (Go Semantic Versioning Insight) to detect breaking changes and analyze their impact by resolving identifiers in client programs and comparing their types with breaking changes. Moreover, we collect the first large-scale Go dataset with a dependency graph from GitHub, including 124K TPLs and 532K client programs. Based on the dataset, our results show that 86.3% of library upgrades follow SemVer compliance and 28.6% of no-major upgrades introduce breaking changes. Furthermore, the tendency to comply with SemVer has improved over time from 63.7% in 2018/09 to 92.2% in 2023/03. Finally, we find 33.3% of downstream client programs may be affected by breaking changes. These findings provide developers and users of TPLs with valuable insights to help make decisions related to SemVer.
翻译:第三方库已成为软件开发的重要组成部分,能够加速开发并降低维护成本。然而,在第三方库升级过程中常出现破坏性变更,阻碍客户端程序的版本演进。语义化版本管理旨在根据兼容性标准化版本发布规范,但并非所有版本发布都遵循这一规范。现有研究主要关注Java和JavaScript(而非Go语言)生态系统的语义化版本合规性。由于缺乏针对Go语言的破坏性变更检测工具及数据集,第三方库开发者难以确认破坏性变更是否发生及其对客户端程序的影响,而客户端程序开发者也可能因破坏性变更而对依赖升级犹豫不决。为弥补这一研究空白,我们首次在Go生态系统中开展大规模实证研究,从破坏性变更及其影响角度分析语义化版本合规性。具体而言,我们设计了GoSVI(Go语义化版本洞察工具),通过解析客户端程序中的标识符并与破坏性变更类型比对,检测破坏性变更并分析其影响。同时,我们基于GitHub构建了首个包含依赖关系图的大规模Go数据集,涵盖124K个第三方库和532K个客户端程序。基于该数据集的研究结果表明:86.3%的库升级遵循语义化版本规范,28.6%的非主版本升级引入破坏性变更;语义化版本合规性随时间显著提升(从2018年9月的63.7%升至2023年3月的92.2%);33.3%的下游客户端程序可能受破坏性变更影响。这些发现为第三方库的开发者与使用者提供了重要参考,有助于其做出与语义化版本管理相关的决策。