JavaScript项目依赖重新分类的纵向研究
A Longitudinal Study of Dependency Reclassifications in JavaScript Projects
AI总结:
本研究探讨JavaScript项目中开发者如何随时间重新分类依赖,发现79.1%的项目存在依赖重新分类,其中97.2%的项目曾移除依赖,38.0%的项目进行角色重新分配,且部分项目后期会再次引入或切换角色。
摘要:
现代软件项目依赖第三方依赖,其声明必须随着项目演进而维护。先前研究集中在依赖版本更新,而关于开发者随时间将依赖分配到不同角色的研究较少。本文研究JavaScript项目中开发者如何重新分类依赖,包括移除和角色重新分配。对33,087个活跃依赖维护的JavaScript项目分析发现,依赖重新分类是普遍的维护活动,发生在79.1%的项目中。其中近97.2%的项目在某个时间点移除依赖,38.0%的项目在Core(运行时)、Dev(开发专用)和Peer(消费者提供)角色间进行角色重新分配。这些变化并非总是最终的,33.1%的项目后来重新引入移除的依赖,11.2%的项目表现出重复的角色切换。重新分类实践往往持续很长时间,中位持续时间为408天。这些发现拓展了依赖维护研究,为依赖工具、包管理器和研究提供了正确依赖角色声明的启示。
英文摘要:
Modern software projects depend on third-party dependencies, whose declarations must be maintained as projects evolve. Prior work has focused on dependency version updates, while much less is known about how developers assign dependencies to different roles over time. In this paper, we investigate how developers of JavaScript projects reclassify their dependencies, including removal and role reassignment. By analyzing commit-level modifications to package.json files, we reconstruct dependency role histories and identify recurring reclassification practices. Our analysis of 33,087 JavaScript projects with active dependency maintenance reveals that dependency reclassification is a prevalent maintenance activity, occurring in 79.1% of the studied projects, and accounting for 19.4% of all dependency-maintenance commits. Of these projects, nearly all (97.2%) remove dependencies at some point, while 38.0% undergo role reassignments across Core (runtime), Dev (development-only), and Peer (consumer-provided) roles. These changes are not always final, as 33.1% of projects later reintroduce removed dependencies and 11.2% exhibit repeated role switching. Reclassification practices also tend to unfold over long periods, with a median duration of 408 days. Illustrative cases further show recurring motivations: batch removals as accumulated cleanup or toolchain retirement; reassignments from Core to Dev, which revise production install scope for auditing or builds; and Peer reassignments that simplify consumer installation or move packages that consumers need not provide into Dev. These findings broaden the study of dependency maintenance beyond version updates, and contribute implications for project maintainers, dependency tools, package managers, and research to support correct dependency role declarations.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。