Inferring method specifications from natural language API descriptions

Rahul Pandita, Xusheng Xiao, Hao Zhong, Tao Xie, Stephen Oney, Amit Paradkar

Research output: Chapter in Book/Report/Conference proceedingConference contribution

Abstract

Application Programming Interface (API) documents are a typical way of describing legal usage of reusable software libraries, thus facilitating software reuse. However, even with such documents, developers often overlook some documents and build software systems that are inconsistent with the legal usage of those libraries. Existing software verification tools require formal specifications (such as code contracts), and therefore cannot directly verify the legal usage described in natural language text in API documents against code using that library. However, in practice, most libraries do not come with formal specifications, thus hindering tool-based verification. To address this issue, we propose a novel approach to infer formal specifications from natural language text of API documents. Our evaluation results show that our approach achieves an average of 92% precision and 93% recall in identifying sentences that describe code contracts from more than 2500 sentences of API documents. Furthermore, our results show that our approach has an average 83% accuracy in inferring specifications from over 1600 sentences describing code contracts.

Original languageEnglish (US)
Title of host publicationProceedings - 34th International Conference on Software Engineering, ICSE 2012
Pages815-825
Number of pages11
DOIs
StatePublished - 2012
Externally publishedYes
Event34th International Conference on Software Engineering, ICSE 2012 - Zurich, Switzerland
Duration: Jun 2 2012Jun 9 2012

Publication series

NameProceedings - International Conference on Software Engineering
ISSN (Print)0270-5257

Other

Other34th International Conference on Software Engineering, ICSE 2012
Country/TerritorySwitzerland
CityZurich
Period6/2/126/9/12

ASJC Scopus subject areas

  • Software

Fingerprint

Dive into the research topics of 'Inferring method specifications from natural language API descriptions'. Together they form a unique fingerprint.

Cite this