Understanding the API usage in Java']Java

被引:37
|
作者
Qiu, Dong [1 ]
Li, Bixin [1 ]
Leung, Hareton [2 ]
机构
[1] Southeast Univ, Sch Comp Sci & Engn, Nanjing, Jiangsu, Peoples R China
[2] Hong Kong Polytech Univ, Dept Comp, Kowloon, Hong Kong, Peoples R China
基金
中国国家自然科学基金;
关键词
API usage; Empirical study; !text type='Java']Java[!/text;
D O I
10.1016/j.infsof.2016.01.011
中图分类号
TP [自动化技术、计算机技术];
学科分类号
0812 ;
摘要
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.
引用
收藏
页码:81 / 100
页数:20
相关论文
共 50 条
  • [31] An early look at XQuery API for Java']Java™ (XQJ)
    Eisenberg, A
    Melton, J
    [J]. SIGMOD RECORD, 2004, 33 (02) : 105 - 111
  • [32] Developing JAVA']JAVA Card Application with RMI API
    Xu JunWu
    Liang JunLing
    [J]. INTERNATIONAL CONFERENCE ON SOLID STATE DEVICES AND MATERIALS SCIENCE, 2012, 25 : 643 - 650
  • [33] A knowledge discovery object model API for Java']Java
    Zuyderduyn, SD
    Jones, SJM
    [J]. BMC BIOINFORMATICS, 2003, 4 (1)
  • [34] Java']Java Vector API: Benchmarking and Performance Analysis
    Basso, Matteo
    Rosa, Andrea
    Omini, Luca
    Binder, Walter
    [J]. PROCEEDINGS OF THE 32ND ACM SIGPLAN INTERNATIONAL CONFERENCE ON COMPILER CONSTRUCTION, CC 2023, 2023, : 1 - 12
  • [35] A Comprehensive Benchmark on Java']Java Cryptographic API Misuses
    Afrose, Sharmin
    Rahaman, Sazzadur
    Yao, Danfeng
    [J]. PROCEEDINGS OF THE TENTH ACM CONFERENCE ON DATA AND APPLICATION SECURITY AND PRIVACY, CODASPY 2020, 2020, : 177 - 178
  • [36] On the Evolution of Exception Usage in Java']Java Projects
    Osman, Haidar
    Chis, Andrei
    Schaerer, Jakob
    Ghafari, Mohammad
    Nierstrasz, Oscar
    [J]. 2017 IEEE 24TH INTERNATIONAL CONFERENCE ON SOFTWARE ANALYSIS, EVOLUTION, AND REENGINEERING (SANER), 2017, : 422 - 426
  • [37] AGGREGATED ACCOUNTING OF MEMORY USAGE IN JAVA']JAVA
    Bouche, Paul
    von Loewis, Martin
    Troeger, Peter
    [J]. ICSOFT 2009: PROCEEDINGS OF THE 4TH INTERNATIONAL CONFERENCE ON SOFTWARE AND DATA TECHNOLOGIES, VOL 1, 2009, : 177 - +
  • [38] How Do Developers Use the Java']Java Stream API?
    Nostas, Joshua
    Sandoval Alcocer, Juan Pablo
    Elias Costa, Diego
    Bergel, Alexandre
    [J]. COMPUTATIONAL SCIENCE AND ITS APPLICATIONS, ICCSA 2021, PT VII, 2021, 12955 : 323 - 335
  • [39] Integrating formal specifications into applications: the ProB Java']Java API
    Koerner, Philipp
    Bendisposto, Jens
    Dunkelau, Jannik
    Krings, Sebastian
    Leuschel, Michael
    [J]. FORMAL METHODS IN SYSTEM DESIGN, 2021, 58 (1-2) : 160 - 187
  • [40] Java']Java Reflection API: Revealing the Dark Side of the Mirror
    Pontes, Felipe
    Gheyi, Rohit
    Souto, Sabrina
    Garcia, Alessandro
    Ribeiro, Marcio
    [J]. ESEC/FSE'2019: PROCEEDINGS OF THE 2019 27TH ACM JOINT MEETING ON EUROPEAN SOFTWARE ENGINEERING CONFERENCE AND SYMPOSIUM ON THE FOUNDATIONS OF SOFTWARE ENGINEERING, 2019, : 636 - 646