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 条
  • [41] Multicloud API Binding Generation from Documentation
    Araujo, Gabriel
    Barrozzi, Vitor Vitali
    Gajda, Michal J.
    [J]. INTELLIGENT COMPUTING, VOL 1, 2022, 506 : 171 - 177
  • [42] CroLSim: Cross Language Software Similarity Detector using API documentation
    Nafi, Kawser Wazed
    Roy, Banani
    Roy, Chanchal K.
    Schneider, Kevin A.
    [J]. 2018 IEEE 18TH INTERNATIONAL WORKING CONFERENCE ON SOURCE CODE ANALYSIS AND MANIPULATION (SCAM), 2018, : 139 - 148
  • [43] Processing natural language software requirement specifications
    Osborne, M
    MacNish, CK
    [J]. PROCEEDINGS OF THE SECOND INTERNATIONAL CONFERENCE ON REQUIREMENTS ENGINEERING, 1996, : 229 - 236
  • [44] Inferring Crypto API Rules from Code Changes
    Paletov, Rumen
    Tsankov, Petar
    Raychev, Veselin
    Vechev, Martin
    [J]. PROCEEDINGS OF THE 39TH ACM SIGPLAN CONFERENCE ON PROGRAMMING LANGUAGE DESIGN AND IMPLEMENTATION, PLDI 2018, 2018, : 450 - 464
  • [45] Inferring Crypto API Rules from Code Changes
    Paletov, Rumen
    Tsankov, Petar
    Raychev, Veselin
    Vechev, Martin
    [J]. ACM SIGPLAN NOTICES, 2018, 53 (04) : 450 - 464
  • [46] Inferring Web API Descriptions From Usage Data
    Suter, Philippe
    Wittern, Erik
    [J]. 2015 THIRD IEEE WORKSHOP ON HOT TOPICS IN WEB SYSTEMS AND TECHNOLOGIES (HOTWEB), 2015, : 7 - 12
  • [47] Mining Specifications from Documentation using a Crowd
    Sun, Peng
    Brown, Chris
    Beschastnikh, Ivan
    Stolee, Kathryn T.
    [J]. 2019 IEEE 26TH INTERNATIONAL CONFERENCE ON SOFTWARE ANALYSIS, EVOLUTION AND REENGINEERING (SANER), 2019, : 275 - 286
  • [48] Generating Formal Hardware Verification Properties from Natural Language Documentation
    Harris, Christopher B.
    Harris, Ian G.
    [J]. 2015 IEEE 9TH INTERNATIONAL CONFERENCE ON SEMANTIC COMPUTING (ICSC), 2015, : 49 - 56
  • [49] Inferring declarative requirements specifications from operational scenarios
    van Lamsweerde, A
    Willemet, L
    [J]. IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 1998, 24 (12) : 1089 - 1114
  • [50] Generating Chat Bots from Web API Specifications
    Vaziri, Mandana
    Mandel, Louis
    Shinnar, Avraham
    Simeon, Jerome
    Hirzel, Martin
    [J]. PROCEEDINGS OF THE 2017 ACM SIGPLAN INTERNATIONAL SYMPOSIUM ON NEW IDEAS, NEW PARADIGMS, AND REFLECTIONS ON PROGRAMMING AND SOFTWARE (ONWARD!'17), 2017, : 44 - 57