Abstract
A deprecated Application Programming Interface (API) is one that is no longer recommended to use by its original developers. While deprecated APIs (i.e., deprecated fields, methods, and classes) are still implemented, they can be removed in future implementations. Therefore, developers should not use deprecated APIs in newly written code and should update existing code so that it does not use deprecated APIs anymore. In this paper, we present the results of an exploratory Mining-Software-Repository study to gather preliminary empirical evidence on deprecated API usages in open-source Java applications. To that end, we quantitatively analyzed the commit histories of 14 applications whose software projects were top-starred on GitHub. We found that deprecated APIs usages are pretty widespread in the studied software applications; and only in half of these applications, developers remove deprecated API usages after few commits and days. Also, half of the studied applications mostly use deprecated APIs declared in their own source code, rather than using deprecated APIs that lie in third-party software. Finally, we noted that the introductions and removals of deprecated API usages are mostly the result of changes made by senior developers, rather than newcomer ones.
P. Cassieri—Independent Researcher.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
In this paper, we use the term “class” to also refer to interfaces and enums.
- 2.
It is the company that owns SonarQube, SonarLint, and SonarCloud.
- 3.
In GitHub, a fork is a copy of an existing project that allows the fork’s owner to suggest changes from his/her fork to the original project (via pull requests) as well as bring changes from the original project.
- 4.
A commit introduces a deprecated API usage when: (i) a developer writes a piece of source code that uses a deprecated API; (ii) a developer performs a dependency update that makes an already-used API deprecated; and (iii) a developer deprecates an API in its codebase but this API is currently used in that codebase.
- 5.
We considered a deprecated API as removed in any case it disappears from the source code (i.e., deletion of the deprecated API usage without any substitution; replacement of it with another API usage; rollback to a previous version, un-deprecated, of that API; and un-deprecation of an API consumed internally).
References
Java deprecation. https://docs.oracle.com/javase/8/docs/technotes/guides/javadoc/deprecation/deprecation.html. Accessed 31 July 2023
Sonarsource’s rules. https://rules.sonarsource.com/. Accessed 31 July 2023
Brito, G., Hora, A., Valente, M.T., Robbes, R.: On the use of replacement messages in API deprecation: an empirical study. J. Syst. Softw. 137, 306–321 (2018)
Caivano, D., Cassieri, P., Romano, S., Scanniello, G.: An exploratory study on dead methods in open-source java desktop applications. In: Proceedings of International Symposium on Empirical Software Engineering and Measurement, pp. 10:1–10:11. ACM (2021)
Caivano, D., Cassieri, P., Romano, S., Scanniello, G.: On the spread and evolution of dead methods in java desktop applications: an exploratory study. Empir. Softw. Eng. 28(64), 1–28 (2023)
Fowler, M.: Refactoring: Improving the Design of Existing Code, 1st edn. Addison-Wesley, Boston (1999)
GitHub: Github advanced search page. https://github.com/search/advanced. Accessed 31 July 2023
Goel, M.K., Khanna, P., Kishore, J.: Understanding survival analysis: Kaplan-Meier estimate. IJAR 1(4), 274 (2010)
Borges, H., Valente, M.T.: What’s in a github star? Understanding repository starring practices in a social coding platform. J. Syst. Softw. 146, 112–129 (2018)
Kalliamvakou, E., Gousios, G., Blincoe, K., Singer, L., German, D., Damian, D.: The promises and perils of mining github. In: Proceedings of Mining Software Repositories, pp. 92–101. ACM (2014)
Kaplan, E.L., Meier, P.: Nonparametric estimation from incomplete observations. JASA 53(282), 457–481 (1958)
Li, L., Gao, J., Bissyandé, T.F., Ma, L., Xia, X., Klein, J.: CDA: characterising deprecated android APIs. Empir. Softw. Eng. 25(3), 2058–2098 (2020)
Nocera, S., Romano, S., Francese, R., Scanniello, G.: A large-scale fine-grained empirical study on security concerns in open-source software. In: Proceedings of Euromicro Conference on Software Engineering and Advanced Applications, pp. 418–425. IEEE (2023)
Qiu, D., Li, B., Leung, H.: Understanding the API usage in java. Inf. Softw. Technol. 73, 81–100 (2016)
Romano, S.: Replication package. https://figshare.com/s/2d66e96eb099e4c32b4f
Sawant, A.A., Huang, G., Vilen, G., Stojkovski, S., Bacchelli, A.: Why are features deprecated? An investigation into the motivation behind deprecation. In: Proceedings of International Conference on Software Maintenance and Evolution, pp. 13–24. IEEE (2018)
Sawant, A.A., Robbes, R., Bacchelli, A.: To react, or not to react: patterns of reaction to API deprecation. Empir. Softw. Eng. 24(6), 3824–3870 (2019)
Scalabrino, S., Bavota, G., Linares-Vásquez, M., Piantadosi, V., Lanza, M., Oliveto, R.: API compatibility issues in Android: causes and effectiveness of data-driven detection techniques. Empir. Softw. Eng. 25(6), 5006–5046 (2020)
Stack Overflow: Stack overflow developer survey 2022. https://survey.stackoverflow.co/2022. Accessed 31 July 2023
Tufano, M., et al.: When and why your code starts to smell bad (and whether the smells go away). IEEE Trans. Softw. Eng. 43(11), 1063–1088 (2017)
Wake, W.C.: Refactoring Workbook, 1st edn. Addison-Wesley, Boston (2003)
Zhou, J., Walker, R.J.: API Deprecation: a retrospective analysis and detection method for code examples on the web, pp. 266–277. ACM (2017)
Funding
This study has been partially supported by “MSR4SBOM-Mining Software Repositories for enhanced Software Bills of Materials” (code: P20224HSZE), a research project funded by the Italian Ministry for Universities and Research (MUR).
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2024 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
Cite this paper
Cassieri, P., Romano, S., Scanniello, G. (2024). On Deprecated API Usages: An Exploratory Study of Top-Starred Projects on GitHub. In: Kadgien, R., Jedlitschka, A., Janes, A., Lenarduzzi, V., Li, X. (eds) Product-Focused Software Process Improvement. PROFES 2023. Lecture Notes in Computer Science, vol 14483. Springer, Cham. https://doi.org/10.1007/978-3-031-49266-2_29
Download citation
DOI: https://doi.org/10.1007/978-3-031-49266-2_29
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-031-49265-5
Online ISBN: 978-3-031-49266-2
eBook Packages: Computer ScienceComputer Science (R0)