Code reuse is an important part of software development. The adoption of code reuse practices is especially common among Node.js developers. The Node.js package manager, NPM, indexes over 1 Million packages and developers often seek out packages to solve programming tasks. Due to the vast number of packages, selecting the right package is difficult and time consuming. With the goal of improving productivity of developers that heavily reuse code through third-party packages, we present Node Code Query (NCQ), a Read-Eval-Print-Loop environment that allows developers to 1) search for NPM packages using natural language queries, 2) search for code snippets related to those packages, 3) automatically correct errors in these code snippets, 4) quickly setup new environments for testing those snippets, and 5) transition between search and editing modes. In two user studies with a total of 20 participants, we find that participants begin programming faster and conclude tasks faster with NCQ than with baseline approaches, and that they like, among other features, the search for code snippets and packages. Our results suggest that NCQ makes Node.js developers more efficient in reusing code.
翻译:代码再利用是软件开发的一个重要部分。 代码再利用做法在Node.js开发商中特别常见。 诺德.js软件包管理员、国家预防机制、100多万套软件索引和开发商经常寻找软件包解决程序设计任务。 由于软件包数量庞大,选择正确的软件包十分困难,耗费时间。 为了通过第三方软件包提高大量再利用代码开发商的生产率,我们提出了节码查询(NCQ),这是一个让开发商能够(1) 使用自然语言查询搜索国家预防机制软件包,(2) 搜索与这些软件包有关的代码片断,(3) 自动纠正这些代码片断中的错误,(4) 快速设置测试这些片段的新环境,(5) 搜索和编辑模式之间的过渡。在总共20名参与者的两次用户研究中,我们发现参与者开始更快地编程,并比基准方法更快地完成与NCQ有关的任务,他们喜欢其他特征,即搜索代码片断和软件包。我们的研究结果表明, NCQ使开发商更高效地重新使用代码。