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 条
  • [21] From Natural Language Software Specifications to UML Class Models
    Bajwa, Imran Sarwar
    Choudhary, M. Abbas
    [J]. ENTERPRISE INFORMATION SYSTEMS, ICEIS 2011, 2012, 102 : 224 - 237
  • [22] Generating Natural Language specifications from UML class diagrams
    Farid Meziane
    Nikos Athanasakis
    Sophia Ananiadou
    [J]. Requirements Engineering, 2008, 13 : 1 - 18
  • [23] Interactive Synthesis of Temporal Specifications from Examples and Natural Language
    Gavran, Ivan
    Darulova, Eva
    Majumdar, Rupak
    [J]. PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2020, 4 (04):
  • [24] Natural SQL: Making SQL Easier to Infer from Natural Language Specifications
    Gan, Yujian
    Chen, Xinyun
    Xie, Jinxia
    Purver, Matthew
    Woodward, John R.
    Drake, John
    Zhang, Qiaofu
    [J]. FINDINGS OF THE ASSOCIATION FOR COMPUTATIONAL LINGUISTICS, EMNLP 2021, 2021, : 2030 - 2042
  • [25] Extracting goal models from natural language requirement specifications
    Das, Souvick
    Deb, Novarun
    Cortesi, Agostino
    Chaki, Nabendu
    [J]. JOURNAL OF SYSTEMS AND SOFTWARE, 2024, 211
  • [26] A formal approach for generating oo specifications from natural language
    Juristo, N
    Morant, JL
    Moreno, AM
    [J]. JOURNAL OF SYSTEMS AND SOFTWARE, 1999, 48 (02) : 139 - 153
  • [27] Generating natural language specifications from UML class diagrams
    Meziane, Farid
    Athanasakis, Nikos
    Ananiadou, Sophia
    [J]. REQUIREMENTS ENGINEERING, 2008, 13 (01) : 1 - 18
  • [28] Automatic Generation of Natural Language Parsers from Declarative Specifications
    Gomez-Rodriguez, Carlos
    Vilares, Jesus
    Alonso, Miguel A.
    [J]. STAIRS 2006, 2006, 142 : 259 - +
  • [30] Learning to Extract API Mentions from Informal Natural Language Discussions
    Ye, Deheng
    Xing, Zhenchang
    Foo, Chee Yong
    Li, Jing
    Kapre, Nachiket
    [J]. 32ND IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE AND EVOLUTION (ICSME 2016), 2016, : 389 - 399