arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2304.00394cs.SE
收藏

NPM中语义版本控制的大规模分析

A Large Scale Analysis of Semantic Versioning in NPM

Donald Pinckney, Federico Cassano, Arjun Guha, Jonathan Bell

AI总结:

本文构建大规模数据集和时间旅行依赖解析器分析NPM中语义版本控制的使用,发现正确使用时90.09%的关键更新能快速流向下游,但不完美使用会导致更新延迟。

摘要:

NPM包仓库包含超过两百万个包,每周提供数百亿次下载。几乎每一个JavaScript应用程序都使用NPM包管理器从NPM仓库安装包。NPM依赖“语义版本控制”('semver')方案来维持健康的生态系统,其中错误修复尽快可靠地传递给下游包,而破坏性更改需要下游包维护者手动干预。为了理解开发者如何使用semver,我们构建了一个包含NPM上每个包的每个版本的数据集,并分析了整个生态系统中的更新流。我们为NPM构建了一个时间旅行依赖解析器,使我们能够精确确定在不同时间点每个依赖的哪些版本会被解析。我们对分析进行了分段,以便直接分析安全相关更新(那些引入或修补漏洞的更新)与生态系统其余部分的比较。我们发现,当开发者正确使用semver时,关键更新(如安全补丁)在大多数情况下(90.09%)可以相当迅速地流向下游依赖,但由于开发者对semver版本约束和semver版本号增量的不完美使用,这并不总是发生。我们的发现对开发者和研究人员都有启示。我们在开源许可下公开发布了我们的基础设施和数据集。

英文摘要:

The NPM package repository contains over two million packages and serves tens of billions of downloads per-week. Nearly every single JavaScript application uses the NPM package manager to install packages from the NPM repository. NPM relies on a "semantic versioning" ('semver') scheme to maintain a healthy ecosystem, where bug-fixes are reliably delivered to downstream packages as quickly as possible, while breaking changes require manual intervention by downstream package maintainers. In order to understand how developers use semver, we build a dataset containing every version of every package on NPM and analyze the flow of updates throughout the ecosystem. We build a time-travelling dependency resolver for NPM, which allows us to determine precisely which versions of each dependency would have been resolved at different times. We segment our analysis to allow for a direct analysis of security-relevant updates (those that introduce or patch vulnerabilities) in comparison to the rest of the ecosystem. We find that when developers use semver correctly, critical updates such as security patches can flow quite rapidly to downstream dependencies in the majority of cases (90.09%), but this does not always occur, due to developers' imperfect use of both semver version constraints and semver version number increments. Our findings have implications for developers and researchers alike. We make our infrastructure and dataset publicly available under an open source license.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑