论文标题

将堆栈溢出代码段的拟合到现有代码中

Optimising the Fit of Stack Overflow Code Snippets into Existing Code

论文作者

Reid, Brittany, Treude, Christoph, Wagner, Markus

论文摘要

软件开发人员经常从在线资源中重新使用代码,例如其项目中的堆栈溢出。但是,搜索代码片段并将其集成到现有源代码中的过程可能很乏味。为了提高效率并减少代码重复使用的时间,我们为Eclipse IDE(集成开发人员环境),NLP2TestableCode提供了自动代码重用工具。 NLP2TestableCode不仅可以使用自然语言任务搜索Java代码片段,还可以根据用户的现有代码来评估代码片段,修改片段以改善拟合和正确的错误,然后再向用户提供最佳片段,而无需离开编辑器。 NLP2TestableCode还包括自动生成可自定义测试用例并建议参数和返回类型的功能,以进一步评估代码段。在评估中,NLP2TeStableCode能够找到82.9%的任务的可编译代码段,而可测试代码片段的42.9%。

Software developers often reuse code from online sources such as Stack Overflow within their projects. However, the process of searching for code snippets and integrating them within existing source code can be tedious. In order to improve efficiency and reduce time spent on code reuse, we present an automated code reuse tool for the Eclipse IDE (Integrated Developer Environment), NLP2TestableCode. NLP2TestableCode can not only search for Java code snippets using natural language tasks, but also evaluate code snippets based on a user's existing code, modify snippets to improve fit and correct errors, before presenting the user with the best snippet, all without leaving the editor. NLP2TestableCode also includes functionality to automatically generate customisable test cases and suggest argument and return types, in order to further evaluate code snippets. In evaluation, NLP2TestableCode was capable of finding compilable code snippets for 82.9% of tasks, and testable code snippets for 42.9%.

扫码加入交流群

加入微信交流群

微信交流群二维码

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