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语义化版本洞察工具)来检测破坏性变更,并通过解析客户端程序中的标识符并与破坏性变更的类型进行比对,分析其影响。此外,我们收集了首个包含依赖关系图的大规模Go数据集,涵盖124K个第三方库和532K个客户端程序。基于该数据集的研究结果表明:86.3%的库升级遵循语义化版本规范,28.6%的非主版本升级引入了破坏性变更;同时,语义化版本合规性随时间呈现改善趋势,从2018年9月的63.7%提升至2023年3月的92.2%。最后,我们发现33.3%的下游客户端程序可能受到破坏性变更的影响。这些发现为第三方库的开发者和使用者提供了宝贵的见解,有助于其做出与语义化版本控制相关的决策。