Java依赖异味的实证研究与统一检测技术
CSTR:
作者:
作者单位:

作者简介:

通讯作者:

许畅,E-mail:changxu@nju.edu.cn

中图分类号:

TP311

基金项目:

国家自然科学基金(62141210);江苏省自然科学基金前沿引领技术基础研究专项课题(BK20202001);感谢江苏省软件新技术与产业化协同创新中心的支持


Empirical Study and Unified Detection Technique of Dependency Smells in Java Projects
Author:
Affiliation:

Fund Project:

  • 摘要
  • |
  • 图/表
  • |
  • 访问统计
  • |
  • 参考文献
  • |
  • 相似文献
  • |
  • 引证文献
  • |
  • 资源附件
  • |
  • 文章评论
    摘要:

    Java语言因丰富的依赖库和便捷的构建工具(如Maven和Gradle)已成为当今最流行的应用项目开发语言之一.然而,随着依赖库规模的持续增大,Java项目的依赖管理变得愈益复杂,也不断超越现有工具的管理能力,其潜藏问题容易在未预期情况下触发,严重影响当前项目及所在Java生态中其它项目的构建和运行,如造成构建错误、运行崩溃或语义冲突等后果.针对现有调研和技术工作对Java语言依赖管理问题分析不足的缺陷,本文提出依赖异味(Dependency Smell)的概念,统一建模此类问题,并对涉及Maven和Gradle构建工具所有类别的依赖管理问题开展大规模实证研究,分析来自开源社区(如GitHub)、官方文档(如Maven依赖管理手册)和系列调研及技术论文的各类依赖管理问题,最终总结出13类依赖异味,以及它们的触发根源和影响特征等.基于该实证研究发现,我们设计了面向Java项目依赖异味的统一检测算法,并实现了适配于Maven和Gradle构建工具的专项检测工具JDepAna.实验表明,对已知依赖异味,JDepAna达到95.9%的检测召回率,对新的上百个Java项目,JDepAna检测出30,689个依赖异味实例,从中选出360个实例,人工验证真阳率达到96.1%,其中进一步汇报48个实例给开发者,42个已被快速确认,21个已被及时修复,充分验证了我们Java依赖异味检测算法和工具的效果和实用性,以及对Java项目质量保障的有效支撑.

    Abstract:

    Java has emerged as a leading programming language for contemporary application development, attributed to its extensive ecosystem of dependencies and user-friendly build tools such as Maven and Gradle. However, the burgeoning scale of dependencies has led to increased complexity in managing them within Java projects, often surpassing the capabilities of current tools. This complexity can lead to unforeseen issues that significantly hinder the project's builds and runtime, manifesting as build failures, crashes, semantic errors, and other adverse outcomes. This paper aims to address the gaps in the analysis of dependency management issues found in existing research and technical literature by introducing the concept of “Dependency Smell”, with the goal of establishing a unified model for these challenges. We conduct a comprehensive empirical study on dependency management issues, covering all categories of Maven and Gradle related problems. This study analyzes diverse dependency management issues gathered from open-source communities (e.g., GitHub), official documentation (e.g., Maven manual), as well as various surveys and technical papers. Ultimately, we categorize 13 subcategories of dependency smells, elucidating their triggering factors and impact characteristics. Leveraging these empirical findings, we devise a unified detection algorithm for dependency smells in Java projects and develop a specialized detection tool, JDepAna, which seamlessly integrates with Maven and Gradle build tools. Experimental results demonstrate that JDepAna achieves a detection recall rate of 95.9% for known dependency smells. Across more than a hundred new Java projects, JDepAna identifies 30,689 instances of dependency smells, with 360 instances selected for manual verification, resulting in a precision rate of 96.1%. Additionally, we report 48 instances to developers, with 42 instances promptly confirmed and 21 promptly fixed, thereby validating the e?icacy and practicality of our Java dependency smell detection algorithm and tool in facilitating quality assurance for Java projects.

    参考文献
    相似文献
    引证文献
引用本文

孙伟杰,许畅,王莹. Java依赖异味的实证研究与统一检测技术.软件学报,2025,36(7):0

复制
分享
文章指标
  • 点击次数:
  • 下载次数:
  • HTML阅读次数:
  • 引用次数:
历史
  • 收稿日期:2024-08-25
  • 最后修改日期:2024-10-15
  • 录用日期:
  • 在线发布日期: 2024-12-10
  • 出版日期:
文章二维码
您是第位访问者
版权所有:中国科学院软件研究所 京ICP备05046678号-3
地址:北京市海淀区中关村南四街4号,邮政编码:100190
电话:010-62562563 传真:010-62562533 Email:jos@iscas.ac.cn
技术支持:北京勤云科技发展有限公司

京公网安备 11040202500063号