Inferring Resource Specifications from Natural Language API Documentation

被引:108
|
作者
Zhong, Hao [1 ,2 ]
Zhang, Lu [1 ,2 ]
Xie, Tao [3 ]
Mei, Hong [1 ,2 ]
机构
[1] Peking Univ, Minist Educ, Key Lab High Confidence Software Technol, Beijing, Peoples R China
[2] Peking Univ, Sch Elect Engn & Comp Sci, Inst Software, Beijing, Peoples R China
[3] North Carolina State Univ, Dept Comp Sci, Raleigh, NC 27695 USA
基金
中国国家自然科学基金;
关键词
SOURCE CODE;
D O I
10.1109/ASE.2009.94
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Typically, software libraries provide API documentation, through which developers can learn how to use libraries correctly. However, developers may still write code inconsistent with API documentation and thus introduce bugs, as existing research shows that many developers are reluctant to carefully read API documentation. To find those bugs, researchers have proposed various detection approaches based on known specifications. To mine specifications, many approaches have been proposed, and most of them rely on existing client code. Consequently, these mining approaches would fail to mine specifications when client code is not available. In this paper, we propose an approach, called Doc2Spec, that infers resource specifications from API documentation. For our approach, we implemented a tool and conducted an evaluation on Javadocs of five libraries. The results show that our approach infers various specifications with relatively high precisions, recalls, and F-scores. We further evaluated the usefulness of inferred specifications through detecting bugs in open source projects. The results show that specifications inferred by Doc2Spec are useful to detect real bugs in existing projects.
引用
收藏
页码:307 / 318
页数:12
相关论文
共 50 条
  • [1] Inferring specifications for resources from natural language API documentation
    Zhong, Hao
    Zhang, Lu
    Xie, Tao
    Mei, Hong
    [J]. AUTOMATED SOFTWARE ENGINEERING, 2011, 18 (3-4) : 227 - 261
  • [2] Inferring specifications for resources from natural language API documentation
    Hao Zhong
    Lu Zhang
    Tao Xie
    Hong Mei
    [J]. Automated Software Engineering, 2011, 18 : 227 - 261
  • [3] Inferring specifications for resources from natural language API documentation
    Laboratory for Internet Software Technologies, Institute of Software, Chinese Academy of Sciences, Beijing, China
    不详
    不详
    不详
    [J]. Autom Software Eng, 3-4 (227-261):
  • [4] Inferring Method Specifications from Natural Language API Descriptions
    Pandita, Rahul
    Xiao, Xusheng
    Zhong, Hao
    Xie, Tao
    Oney, Stephen
    Paradkar, Amit
    [J]. 2012 34TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE), 2012, : 815 - 825
  • [5] Inferring Service Recommendation from Natural Language API Descriptions
    Xiong, Wei
    Wu, Zhao
    Li, Bing
    Gu, Qiong
    Yuan, Lei
    Hang, Bo
    [J]. 2016 IEEE INTERNATIONAL CONFERENCE ON WEB SERVICES (ICWS), 2016, : 316 - 323
  • [6] ICON: Inferring Temporal Constraints from Natural Language API Descriptions
    Pandita, Rahul
    Taneja, Kunal
    Tung, Teresa
    Williams, Laurie
    [J]. 32ND IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE AND EVOLUTION (ICSME 2016), 2016, : 378 - 388
  • [7] Towards Extracting Web API Specifications from Documentation
    Yang, Jinqiu
    Wittern, Erik
    Ying, Annie T. T.
    Dolby, Julian
    Tan, Lin
    [J]. 2018 IEEE/ACM 15TH INTERNATIONAL CONFERENCE ON MINING SOFTWARE REPOSITORIES (MSR), 2018, : 454 - 464
  • [8] RESTINFER: Automated Inferring Parameter Constraints from Natural Language RESTful API Descriptions
    Liu, Yi
    [J]. PROCEEDINGS OF THE 30TH ACM JOINT MEETING EUROPEAN SOFTWARE ENGINEERING CONFERENCE AND SYMPOSIUM ON THE FOUNDATIONS OF SOFTWARE ENGINEERING, ESEC/FSE 2022, 2022, : 1816 - 1818
  • [9] Inferring Specifications of Object Oriented APIs from API Source Code
    Zhong, Hao
    Zhang, Lu
    Mei, Hong
    [J]. APSEC 2008:15TH ASIA-PACIFIC SOFTWARE ENGINEERING CONFERENCE, PROCEEDINGS, 2008, : 221 - 228
  • [10] Improving open data web API documentation through interactivity and natural language generation
    Gonzalez-Mora, Cesar
    Barros, Cristina
    Garrig, Irene
    Zubcoff, Jose
    Lloret, Elena
    Maz, Jose -Norberto
    [J]. COMPUTER STANDARDS & INTERFACES, 2023, 83