论文标题

从API到NLI:一个用于库重复使用的新界面

From API to NLI: A New Interface for Library Reuse

论文作者

Shen, Qi, Wu, Shijun, Zou, Yanzhen, Zhu, Zixiao, Xie, Bing

论文摘要

开发人员经常从现有库中重复使用API​​来实现某些功能。但是,由于它们的大规模和复杂性,学习API很难。在本文中,我们设计了一个抽象框架NLI2Code来简化重复使用过程。在框架下,用户可以使用高级,自动生成的NLI(自然语言接口)而不是详细的API元素重复使用库功能。该框架由三个组成部分组成:一个功能功能提取器,用于以自然语言形式总结经常使用的库函数,代码模式矿工,以提供每个功能功能的代码模板,以及一个合成器,将代码模式填充到良好的片段中。从用户的角度来看,NLI2Code下的重用任务是从选择功能功能开始的,我们的框架将指导用户合成所需的解决方案。我们将该框架实例化为重用Java库的工具。评估表明,我们的工具可以生成高质量的自然语言接口,并节省一半的编码时间,以供新移民解决现实世界中的编程任务。

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.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源