Inferring Resource Specifications from Natural Language API Documentation

Inferring Resource Specifications from Natural Language API Documentation
复制标题

DOI:
10.1109/ase.2009.94
复制
发表时间:
2009-11
期刊:
2009 IEEE/ACM International Conference on Automated Software Engineering
影响因子:
--
通讯作者:
Hao Zhong;Lu Zhang;Tao Xie;Hong Mei
Hao Zhong;Lu Zhang;Tao Xie;Hong Mei
中科院分区:
其他
文献类型:
--
作者:
Hao Zhong;Lu Zhang;Tao Xie;Hong Mei

文献摘要

被引文献

相似文献

通常,软件库提供API文档,开发人员可以通过这些文档学习如何正确使用库。然而,开发人员仍然可能编写与API文档不一致的代码,从而引入错误,因为现有的研究表明,许多开发人员不愿意仔细阅读API文档。为了找到这些漏洞,研究人员提出了各种基于已知规范的检测方法。为了挖掘规范,已经提出了许多方法,其中大多数依赖于现有的客户端代码。因此,当客户端代码不可用时,这些挖掘方法将无法挖掘规范。在本文中,我们提出了一种方法,称为Doc 2Spec,推断资源规格从API文档。对于我们的方法,我们实现了一个工具,并对五个库的Javadoc进行了评估。结果表明,我们的方法推断各种规格相对较高的精度,召回率和F-分数。我们通过检测开源项目中的bug进一步评估了推断规范的有用性。结果表明,Doc 2Spec推断的规格是有用的,以检测现有项目中的真实的错误。
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.