Back to Search Start Over

From API to NLI: A New Interface for Library Reuse

Authors :
Shen, Qi
Wu, Shijun
Zou, Yanzhen
Zhu, Zixiao
Xie, Bing
Publication Year :
2020
Publisher :
arXiv, 2020.

Abstract

Developers frequently reuse APIs from existing libraries to implement certain functionality. However, learning APIs is difficult due to their large scale and complexity. In this paper, we design an abstract framework NLI2Code to ease the reuse process. Under the framework, users can reuse library functionalities with a high-level, automatically-generated NLI (Natural Language Interface) instead of the detailed API elements. The framework consists of three components: a functional feature extractor to summarize the frequently-used library functions in natural language form, a code pattern miner to give a code template for each functional feature, and a synthesizer to complete code patterns into well-typed snippets. From the perspective of a user, a reuse task under NLI2Code starts from choosing a functional feature and our framework will guide the user to synthesize the desired solution. We instantiated the framework as a tool to reuse Java libraries. The evaluation shows our tool can generate a high-quality natural language interface and save half of the coding time for newcomers to solve real-world programming tasks.<br />Comment: To be published in the Journal of Systems and Software (JSS); 19 pages, 17 figures

Details

Database :
OpenAIRE
Accession number :
edsair.doi.dedup.....41dd506f3c729ed85c544ee4f0305fab
Full Text :
https://doi.org/10.48550/arxiv.2007.03305