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 条
  • [1] Usage patterns of the Java']Java standard API
    Ma, Homan
    Amor, Robert
    Tempero, Ewan
    [J]. ASPEC 2006: 13TH ASIA-PACIFIC SOFTWARE ENGINEERING CONFERENCE, PROCEEDINGS, 2006, : 342 - +
  • [2] Understanding the syntactic rule usage in java']java
    Qiu, Dong
    Li, Bixin
    Barr, Earl T.
    Su, Zhendong
    [J]. JOURNAL OF SYSTEMS AND SOFTWARE, 2017, 123 : 160 - 172
  • [3] Java']Java accessibility API
    不详
    [J]. JOURNAL OF VISUAL IMPAIRMENT & BLINDNESS, 1997, 91 (06) : 12 - 13
  • [4] The Java']Java location API
    Parsons, D
    [J]. DR DOBBS JOURNAL, 2006, 31 (01): : 53 - 58
  • [5] The Java']Java internationlization API
    Jones, CA
    [J]. DR DOBBS JOURNAL, 1998, 23 (01): : 54 - &
  • [6] The OWL API: A Java']Java API for OWL ontologies
    Horridge, Matthew
    Bechhofer, Sean
    [J]. SEMANTIC WEB, 2011, 2 (01) : 11 - 21
  • [7] The Java']Java CAN API -: A Java']Java gateway to fieldbus communication
    Bühler, D
    Nusser, G
    [J]. 2000 IEEE INTERNATIONAL WORKSHOP ON FACTORY COMMUNICATION SYSTEMS, PROCEEDINGS, 2000, : 37 - 43
  • [8] A Better API for Java']Java Reflection
    Shams, Zalia
    Edwards, Stephen H.
    [J]. SIGCSE 12: PROCEEDINGS OF THE 43RD ACM TECHNICAL SYMPOSIUM ON COMPUTER SCIENCE EDUCATION, 2011, : 674 - 674
  • [9] Analysis of Java']Java Programs using Joana and Java']Java SDG API
    Kumar, Ranjan
    Panda, Subhrakanta
    Mohapatra, Durga Prasad
    [J]. 2015 INTERNATIONAL CONFERENCE ON ADVANCES IN COMPUTING, COMMUNICATIONS AND INFORMATICS (ICACCI), 2015, : 2402 - 2408
  • [10] Java']Java - Sun introduces Java']Java 3D API
    不详
    [J]. IEEE INTERNET COMPUTING, 1999, 3 (01) : 16 - 16