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

Siri,写下一个方法

Siri, Write the Next Method

Fengcai Wen, Emad Aghajani, Csaba Nagy, Michele Lanza, Gabriele Bavota

摘要:

代码补全是集成开发环境(IDE)的杀手级功能之一,研究人员已经提出了不同的方法来提高其准确性。虽然这些技术对于加速代码编写很有价值,但它们仅限于与开发人员在当前上下文下可能键入的接下来几个令牌相关的建议。在最好的情况下,他们可以推荐一些开发人员接下来可能使用的API。我们介绍了FeaRS,一种新颖的基于检索的方法,给定开发人员在IDE中编写的当前代码,可以推荐下一个完整的方法(即,签名和方法体),开发人员可能会实现。为了做到这一点,FeaRS利用了“实现模式”(即,通常在同一任务中实现的方法组),通过挖掘数千个开源项目来学习。我们将我们的方法实例化到Android应用程序的特定上下文。我们对超过2万个应用程序进行了大规模的实证评估,初步结果令人鼓舞,但也强调了未来需要克服的挑战。

英文摘要:

Code completion is one of the killer features of Integrated Development Environments (IDEs), and researchers have proposed different methods to improve its accuracy. While these techniques are valuable to speed up code writing, they are limited to recommendations related to the next few tokens a developer is likely to type given the current context. In the best case, they can recommend a few APIs that a developer is likely to use next. We present FeaRS, a novel retrieval-based approach that, given the current code a developer is writing in the IDE, can recommend the next complete method (i.e., signature and method body) that the developer is likely to implement. To do this, FeaRS exploits "implementation patterns" (i.e., groups of methods usually implemented within the same task) learned by mining thousands of open source projects. We instantiated our approach to the specific context of Android apps. A large-scale empirical evaluation we performed across more than 20k apps shows encouraging preliminary results, but also highlights future challenges to overcome.

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

↑