Analyzing APIs Documentation and Code to Detect Directive Defects

Analyzing APIs Documentation and Code to Detect Directive Defects
复制标题

DOI:
10.1109/icse.2017.11
复制
发表时间:
2017-05
期刊:
2017 IEEE/ACM 39th International Conference on Software Engineering (ICSE)
影响因子:
--
通讯作者:
Yu Zhou;Ruihang Gu;Taolue Chen;Zhiqiu Huang;Sebastiano Panichella;H. Gall
Yu Zhou;Ruihang Gu;Taolue Chen;Zhiqiu Huang;Sebastiano Panichella;H. Gall
中科院分区:
其他
文献类型:
--
作者:
Yu Zhou;Ruihang Gu;Taolue Chen;Zhiqiu Huang;Sebastiano Panichella;H. Gall

文献摘要

被引文献

相似文献

应用程序编程接口(API)文档代表了API用户最重要的参考之一。但是,经常报道文档与源代码不一致,并且与API本身偏离。这些文档中的这种不一致不可避免地会使API用户极大地阻碍其API理解和通过此类API构建的软件的质量。在本文中,我们提出了一种自动化方法,通过利用程序理解和自然语言处理的技术来检测API文档的缺陷。特别是,我们专注于与参数约束和异常投掷声明有关的API文档的指令。基于一阶逻辑的约束求解器用于根据获得的分析结果来检测此类缺陷。我们评估了文献良好的JDK 1.8 API的部分方法。实验结果表明,在大约2000个API使用限制中,我们的方法可以检测1158个有缺陷的文档指令,精确率为81.6%,召回率为82.0%,这表明其可行性。
Application Programming Interface (API) documents represent one of the most important references for API users. However, it is frequently reported that the documentation is inconsistent with the source code and deviates from the API itself. Such inconsistencies in the documents inevitably confuse the API users hampering considerably their API comprehension and the quality of software built from such APIs. In this paper, we propose an automated approach to detect defects of API documents by leveraging techniques from program comprehension and natural language processing. Particularly, we focus on the directives of the API documents which are related to parameter constraints and exception throwing declarations. A first-order logic based constraint solver is employed to detect such defects based on the obtained analysis results. We evaluate our approach on parts of well documented JDK 1.8 APIs. Experiment results show that, out of around 2000 API usage constraints, our approach can detect 1158 defective document directives, with a precision rate of 81.6%, and a recall rate of 82.0%, which demonstrates its practical feasibility.