[论文解读] An Empirical Study of Usages, Updates and Risks of Third-Party Libraries in Java Projects
本文对806个Java开源项目中的第三方库使用情况、更新情况及风险进行了大规模实证研究,分析了13,565个库,揭示了广泛存在的库版本过时和更新延迟问题。研究提出了一种基于缺陷的告警系统,通过细粒度的API调用图分析识别出存在风险的过时库版本,表明31.6%的热门库发布版本包含严重缺陷,且开发者往往缺乏可操作的信号来自信地执行更新。
Third-party libraries are a central building block to develop software systems. However, outdated third-party libraries are commonly used, and developers are usually less aware of the potential risks. Therefore, a quantitative and holistic study on usages, updates and risks of third-party libraries can provide practical insights to improve the ecosystem sustainably. In this paper, we conduct such a study in the Java ecosystem. Specifically, we conduct a library usage analysis (e.g., usage intensity and outdatedness) and a library update analysis (e.g., update intensity and delay) using 806 open-source projects. The two analyses aim to quantify usage and update practices holistically from the perspective of both open-source projects and third-party libraries. Then, we conduct a library risk analysis (e.g., potential risk and developer response) in terms of bugs with 15 popularly-used third-party libraries. This analysis aims to quantify the potential risk of using outdated libraries and the developer response to the risk. Our findings from the three analyses provide practical insights to developers and researchers on problems and potential solutions in maintaining third-party libraries (e.g., smart alerting and automated updating of outdated libraries). To demonstrate the usefulness of our findings, we propose a bug-driven alerting system for assisting developers to make confident decisions in updating third-party library versions. We have released our dataset to foster valuable applications and improve the ecosystem.
研究动机与目标
- 理解Java开源项目中第三方库在现实世界中的使用和更新模式。
- 量化与过时库版本相关的风险,特别是可能影响系统稳定性的非安全缺陷。
- 解决缺乏可操作的、细粒度的告警信号的问题,以帮助开发者判断何时以及是否应更新库。
- 为改善库维护和生态系统可持续性提供实证证据和实用洞见。
- 开发并展示一个原型告警系统,基于实际代码影响优先考虑风险意识的更新。
提出的方法
- 对806个开源Java项目和13,565个第三方库中的库使用和更新实践进行了定量分析。
- 构建了一个版本化、生态系统级别的调用图,以追踪API使用情况,并识别出项目中是否实际调用了存在缺陷或已更改的方法。
- 采用混合方法进行风险分析:对15个热门库的发布历史和缺陷报告进行定量分析,并辅以开发者响应的人工研究。
- 设计了一个原型告警系统,基于库中实际在项目中使用的严重非安全缺陷,来标记过时的库版本。
- 使用静态和动态分析技术,评估库版本变更(如缺陷修复、API变更)在语义上是否与项目代码相关。
- 将研究发现整合到一个实用系统中,为开发者提供令人信服的、细粒度的信号,以指导更新决策。
实验结果
研究问题
- RQ1RQ1: Java项目中第三方库的使用强度和过时程度如何?
- RQ2RQ2: 各项目中第三方库的更新强度和更新延迟如何?
- RQ3RQ3: 使用过时的第三方库存在何种潜在风险?开发者如何应对这些风险?
- RQ4RQ4: 如何构建一个实用的告警系统,以帮助开发者就更新存在缺陷的库版本做出明智决策?
主要发现
- 77.4%的第三方库仅在一个开源项目中被使用,表明存在高度碎片化和低复用性。
- 60.0%的库在其所有项目中仅调用了最多2%的API,表明大多数库功能未被使用。
- 38.0%的项目使用了比最新版本落后超过10个版本的库,表明过时现象普遍存在。
- 54.9%的项目有超过一半的库依赖项未被更新,凸显了维护不善的问题。
- 50.5%的项目平均更新延迟超过60天,揭示了在采用更新、可能更安全的版本方面存在显著延迟。
- 在15个热门库的版本发布中,31.6%包含严重缺陷,且其中许多缺陷在真实项目中已被触发,凸显了使用过时版本的风险。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。