arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2101.11149cs.SE
收藏

基于自然语言的IDE内代码生成:前景与挑战

In-IDE Code Generation from Natural Language: Promise and Challenges

Frank F. Xu, Bogdan Vasilescu, Graham Neubig

摘要:

软件开发的很大一部分涉及概念化或交流需要在程序中表达的底层过程和逻辑。编程的一个主要困难是将概念转化为代码,特别是在处理不熟悉的库的API时。最近,用于从自然语言查询中生成和检索代码的机器学习方法激增,但这些方法主要是纯粹基于检索准确性或生成的代码与开发人员编写的代码的重叠进行评估的,并且这些方法对开发人员工作流程的实际影响令人惊讶地未经证实。我们对在IDE中使用此类技术的前景和挑战进行了首次全面调查,询问“在当前的技术状态下,它是否提高了开发人员的生产力或准确性,它如何影响开发人员的体验,以及剩下的差距和挑战是什么?”“我们首先为IDE开发一个插件,它实现了代码生成和代码检索功能的混合,并协调虚拟环境以支持收集许多用户事件。我们要求具有各种背景的开发人员完成14个Python编程任务,从基本的文件操作到机器学习或数据可视化,无论是否有插件的帮助。虽然开发人员体验的定性调查基本上是积极的,但关于提高生产力,代码质量或程序正确性的定量结果并不确定。分析确定了几个痛点,可以提高未来基于机器学习的代码生成/检索开发人员助手的有效性,并演示了开发人员何时更喜欢代码生成而不是代码检索,反之亦然。我们发布所有数据和软件,为未来的实证研究和开发更好的模型铺平道路。

英文摘要:

A great part of software development involves conceptualizing or communicating the underlying procedures and logic that needs to be expressed in programs. One major difficulty of programming is turning concept into code, especially when dealing with the APIs of unfamiliar libraries. Recently, there has been a proliferation of machine learning methods for code generation and retrieval from natural language queries, but these have primarily been evaluated purely based on retrieval accuracy or overlap of generated code with developer-written code, and the actual effect of these methods on the developer workflow is surprisingly unattested. We perform the first comprehensive investigation of the promise and challenges of using such technology inside the IDE, asking "at the current state of technology does it improve developer productivity or accuracy, how does it affect the developer experience, and what are the remaining gaps and challenges?" We first develop a plugin for the IDE that implements a hybrid of code generation and code retrieval functionality, and orchestrate virtual environments to enable collection of many user events. We ask developers with various backgrounds to complete 14 Python programming tasks ranging from basic file manipulation to machine learning or data visualization, with or without the help of the plugin. While qualitative surveys of developer experience are largely positive, quantitative results with regards to increased productivity, code quality, or program correctness are inconclusive. Analysis identifies several pain points that could improve the effectiveness of future machine learning based code generation/retrieval developer assistants, and demonstrates when developers prefer code generation over code retrieval and vice versa. We release all data and software to pave the road for future empirical studies and development of better models.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑