An Empirical Study of Usages, Updates and Risks of Third-Party Libraries in Java Projects

Ying Wang, Bihuan Chen, Kaifeng Huang, Bowen Shi, Congying Xu, Xin Peng, Yijian Wu, Yang Liu

Abstract

Third-party libraries are essential to modern software development, yet they introduce significant maintenance and security challenges. This empirical study of 806 Java projects reveals that while "dependency debt" is pervasive, the actual risk is often mitigated by the fact that projects typically use less than 2% of a library's features. We explore the "Iceberg" usage pattern, update inertia, and the efficacy of bug-driven alerting systems.

The Challenge of Dependency Management

Modern software is built on a complex web of third-party dependencies. While these libraries accelerate development, they also create "dependency hell," where developers must balance the need for updates against the risk of breaking changes. Existing research often focuses narrowly on security or popularity; this study provides a holistic view of usage, updates, and actual risk.

Methodology

The authors analyzed 806 active open-source Java projects and 13,565 libraries. They developed a toolchain including lib-extractor for dependency mapping, up-extractor for version history, and static analysis tools (Soot, JavaParser) for method-level call graph construction. They also curated a dataset of 1,170 severe bugs from Jira for 15 popular libraries.

Library Usage Intensity: The "Iceberg" Pattern

A key finding is the extreme "software bloat" in Java projects. Most projects import large libraries but only use a tiny sliver of their functionality.

Figure 1: Distributions of Library-Level Usage Intensity across Projects and Libraries.

As shown in Figure 1, 60% of libraries had at most 2% of their APIs called. This "Iceberg" pattern suggests that the vast majority of imported code is never executed, which has implications for both performance and security.

Update Dynamics and Versioning

Developers exhibit significant hesitation when it comes to updating libraries. Nearly 55% of projects leave more than half of their dependencies untouched throughout their lifecycle. This inertia leads to significant version lag, with 38% of projects trailing the latest release by more than 10 versions.

Figure 2: Distributions of projects using multiple versions of the same library.

Figure 2 highlights the complexity of versioning, showing that many projects end up with multiple versions of the same library, often due to transitive dependencies. While most updates are upgrades, about 3.6% are downgrades, usually to restore compatibility.

Risk Assessment: The "Safe" Buggy Dependency

The study's most surprising result is that 98% of projects using a library version known to have severe bugs were actually safe. Because projects use so little of a library's API, they rarely call the specific methods containing the bugs. This finding suggests that traditional security tools, which flag any outdated library, suffer from high false-positive rates. A "bug-driven alerting system" that checks for calls to specific buggy methods could drastically reduce alert fatigue.

Conclusion and Future Directions

The study concludes that "Library Debloating"—removing unused library code—is a promising path for optimizing software. The researchers have released their dataset and tools at https://3rdpartylibs.github.io to support further work in automated dependency management and risk assessment.

Summary updated

BibTeX
@inproceedings{wang2020empirical,
  author = {Ying Wang and Bihuan Chen and Kaifeng Huang and Bowen Shi and Congying Xu and Xin Peng and Yijian Wu and Yang Liu},
  title = {{An Empirical Study of Usages, Updates and Risks of Third-Party Libraries in Java Projects}},
  booktitle = {ICSME},
  year = {2020},
  url = {https://openreview.net/forum?id=Z0BeZPTsye-},
}
Figure