Page 142 - 《软件学报》2025年第7期
P. 142
孙伟杰 等: Java 依赖异味的实证研究与统一检测技术 3063
Gao 等人 [86] 提出了 PyRadar 框架, 通过结合元数据和源代码分发, 显著提高了源代码仓库信息的检索和验证准确
性. Hu 等人 [87] 研究了 Golang 生态系统中的漏洞生命周期, 发现 66.10% 的模块受漏洞影响, 漏洞修复传播过程中
存在两种滞后现象, 通过及时发布和索引补丁版本, 可以显著提升生态系统的安全性. Guo 等人 [88] 分析了 PyPI 生
态系统中的恶意代码生命周期, 收集了 4 669 个恶意包文件, 发现超过 50% 的恶意代码具有多重恶意行为, 74.81%
的恶意包通过源码安装成功进入终端用户项目, 且 72% 以上的恶意包在发现后仍长期存在于 PyPI 镜像服务器中.
前述研究着重关注于检测项目源代码和所使用依赖库中存在的漏洞以及探究这些漏洞对整个生态系统的影响. 然
而即便项目中不存在漏洞, 依赖管理中的潜藏问题仍然可能对项目和生态造成严重危害, 本文通过检测这些潜藏
问题以确保 Java 生态系统的持续健康发展.
6 总结和展望
本文聚焦于 Java 项目在使用 Maven 和 Gradle 进行依赖管理时出现的依赖异味问题. 我们通过开展大规模实
证研究, 综合分析了开源社区、官方文档以及学术论文中关于依赖管理的各类问题, 最终发现了 13 类特征各异的
依赖异味, 并探究了它们的触发根源和潜在危害. 基于实证研究成果, 我们提出了统一的依赖异味检测算法, 并开
发了适用于 Maven 和 Gradle 的依赖异味检测工具 JDepAna. 经过实验评估, JDepAna 在已知依赖异味的检测中达
到了 95.9% 的召回率; 在流行的 Java 项目中, 其准确率达到了 96.1%. 我们从新检出的依赖异味中进一步汇报了
48 个实例给开发者, 其中 42 个已被确认, 21 个已被修复, 充分证明了我们 Java 依赖异味检测算法和工具的效果
和实用性. 未来, 我们计划扩展 JDepAna 的检测功能, 使其适用于使用 Gradle 进行依赖管理的 Android 项目. 此外,
我们希望设计并实现一套自动化技术, 在 JDepAna 报告信息的基础上为 Java 项目提供依赖异味自动修复功能. 也
值得说明的是, Java 项目中的依赖管理机制也类似存在于其他编程语言中, 因此本文提出的依赖异味可以通过扩
展和适配应用于其他语言的依赖管理. 我们希望未来能够进一步拓展 JDepAna 的功能, 使其不仅适用于 Java 项
目, 还能为其他语言的依赖管理提供有效的检测和修复工具, 从而提高更广泛的软件项目的质量和可靠性.
References:
[1] TIOBE Index. TIOBE. 2024. https://www.tiobe.com/tiobe-index/
[2] Krueger CW. Software reuse. ACM Computing Surveys, 1992, 24(2): 131–183. [doi: 10.1145/130844.130856]
[3] Cox R. Surviving software dependencies: Software reuse is finally here but comes with risks. Queue, 2019, 17(2): 24–47. [doi: 10.1145/
3329781.3344149]
[4] Gkortzis A, Feitosa D, Spinellis D. Software reuse cuts both ways: An empirical analysis of its relationship with security vulnerabilities.
Journal of Systems and Software, 2021, 172: 110653. [doi: 10.1016/j.jss.2020.110653]
[5] No any ASM service available [Moxy 4.0.1 in Jersey]. #1849, 2024. https://github.com/eclipse-ee4j/eclipselink/issues/1849
[6] Eclipse Jersey. 2024. https://projects.eclipse.org/projects/ee4j.jersey
[7] Wang Y, Wu RX, Wang C, Wen M, Liu YP, Cheung SC, Yu H, Xu C, Zhu ZL. Will dependency conflicts affect my program’s
semantics? IEEE Trans. on Software Engineering, 2022, 48(7): 2295–2316. [doi: 10.1109/TSE.2021.3057767]
[8] Wang Y, Wen M, Liu ZW, Wu RX, Wang R, Yang B, Yu H, Zhu ZL, Cheung SC. Do the dependency conflicts in my project matter? In:
Proc. of the 26th ACM Joint Meeting on European Software Engineering Conf. and Symp. on the Foundations of Software Engineering.
Lake Buena Vista: ACM, 2018. 319–330. [doi: 10.1145/3236024.3236056]
[9] Wang Y, Wen M, Wu RX, Liu ZW, Tan SH, Zhu ZL, Yu H, Cheung SC. Could I have a stack trace to examine the dependency conflict
issue? In: Proc. of the 41st IEEE/ACM Int’l Conf. on Software Engineering (ICSE). Montreal: IEEE, 2019. 572–583. [doi: 10.1109/ICSE.
2019.00068]
[10] Soto-Valero C, Durieux T, Baudry B. A longitudinal analysis of bloated Java dependencies. In: Proc. of the 29th ACM Joint Meeting on
European Software Engineering Conf. and Symp. on the Foundations of Software Engineering. Athens: ACM, 2021. 1021–1031. [doi: 10.
1145/3468264.3468589]
[11] Soto-Valero C, Harrand N, Monperrus M, Baudry B. A comprehensive study of bloated dependencies in the Maven ecosystem. Empirical
Software Engineering, 2021, 26(3): 45. [doi: 10.1007/s10664-020-09914-8]
[12] Hassan F, Mostafa S, Lam ESL, Wang XY. Automatic building of Java projects in software repositories: A study on feasibility and

