arrow
Return

Understanding the API usage in Java

delete2016-05-01
delete45
PRE
AI
D
Dong Qiu
李
李必信 (Bixin Li) *
H
Hareton Leung
DOI:10.1016/j.infsof.2016.01.011delete
deleteOriginal
deleteShare
deleteSave
Abstract

Abstract

En 中文
Context: Application Programming Interfaces (APIs) facilitate the use of programming languages. They define sets of rules and specifications for software programs to interact with. The design of language API is usually artistic, driven by aesthetic concerns and the intuitions of language architects. Despite recent studies on limited scope of API usage, there is a lack of comprehensive, quantitative analyses that explore and seek to understand how real-world source code uses language APIs. Objective: This study aims to understand how APIs are employed in practical development and explore their potential applications based on the results of API usage analysis. Method: We conduct a large-scale, comprehensive, empirical analysis of the actual usage of APIs on Java, a modern, mature, and widely-used programming language. Our corpus contains over 5000 open-source Java projects, totaling 150 million source lines of code (SLoC). We study the usage of both core (official) API library and third-party (unofficial) API libraries. We resolve project dependencies automatically, generate accurate resolved abstract syntax trees (ASTs), capture used API entities from over 1.5 million ASTs, and measure the usage based on our defined metrics: frequency, popularity and coverage. Results: Our study provides detailed quantitative information and yield insight, particularly, (1) confirms the conventional wisdom that the usage of APIs obeys Zipf distribution; (2) demonstrates that core API is not fully used (many classes, methods and fields have never been used); (3) discovers that deprecated API entities (in which some were deprecated long ago) are still widely used; (4) evaluates that the use of current compact profiles is under-utilized; (5) identifies API library coldspots and hotspots. Conclusions: Our findings are suggestive of potential applications across language API design, optimization and restriction, API education, library recommendation and compact profile construction. (C) 2016 Elsevier B.V. All rights reserved.
Keywords:
API usage
Empirical study
Java
errShare
errSave
Understanding the syntactic rule usage in java
err2017-01-01
err12
PREAI
errQiu, Dong; Li, Bixin; Barr, Earl T.; Su, Zhendong
errShare
errSave
An exploratory study of api changes and usages based on apache and eclipse ecosystems
err2015-12-19
err29
PREAI
errWu, Wei; Khomh, Foutse; Adams, Bram; Gueheneuc, Yann-Gael; Antoniol, Giuliano
errShare
errSave
The OWL API: A Java API for OWL ontologies
err2011-01-01
err491
PREAI
errHorridge, Matthew; Bechhofer, Sean
errShare
errSave
Blindspots in Python and Java APIs Result in Vulnerable Code
err2023-04-26
err4
errOAAI
errBrun, Yuriy; Lin, Tian; Somerville, Jessie Elise; Myers, Elisha M.; Ebner, Natalie
errShare
errSave

Journal

Information and Software Technology cover
Information and Software Technology
IF:
4.3
Papers:
3.8K
Citations:
9.5K

Organization

S
southeast university - china
Scholars:
0
Papers: 831
Citations: 4.1W
H
Hong Kong Polytechnic University
Scholars:
2.2K
Papers: 1.1K
Citations: 4.1W
Cited Papers

Cited Papers

Development of a 10-Item Tool to Identify Advanced Practice Nurse Readiness to Prescribe Pre-exposure Prophylaxis
err2019-05-01
err0
PREAI
errGregory A. Carter; Wasantha Jayawardene; Jon Agley; Justin R. Garcia; Wendy R. Miller; Catherine Sherwood-Laughlin; Beth Meyerson
errShare
errSave
errShare
errSave
Power Laws in Software
err2008-10-07
err131
PREAI
errLouridas, Panagiotis; Spinellis, Diomidis; Vlachos, Vasileios
errShare
errSave