On the Evolution of Unused Dependencies in Java Project Releases: An Empirical Study
Modern software development heavily relies on third-party dependencies to reduce workload and improve developer productivity. Given the vast number of dependencies available and the ease of including them in projects, some introduced dependencies are never used, leading to bloated software, longer build times, and increased network bandwidth usage. While several previous studies have examined the prevalence of unused dependencies and their impact on security, it remains unclear how these dependencies are introduced and removed in software projects. This study aims to answer this question through an empirical study involving 3,020 release versions of 417 Java projects. Our analysis shows that unused packages are common in most projects (52% of projects), but few releases (9%) introduce new unused dependencies. Among those resolved unused dependencies, 59% of them were removed and 41% were used in later versions. Our findings highlight that not all unused dependencies should be removed in practice.