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

面向任务的API使用示例编程任务知识图谱支持的编程

Task-Oriented API Usage Examples Prompting Powered By Programming Task Knowledge Graph

Jiamou Sun, Zhenchang Xing, Xin Peng, Xiwei Xu, Liming Zhu

摘要:

编程教程通常是为了用代码示例演示编程任务而创建的。然而,我们对堆栈溢出问题的研究揭示了高质量编程教程的低利用率,这是由任务描述不匹配和代码信息过载引起的。文档搜索可以找到相关的教程文档,但它们通常无法找到与开发人员的任务需求相关的特定编程操作和代码解决方案。最近提出的基于知识图谱的以活动为中心的搜索支持直接搜索编程动作,但它在动作覆盖、基于自然语言的任务搜索和粗粒度代码示例推荐方面存在局限性。在这项工作中,我们提高行动的知识图谱的代码示例和更多形式的活动句子中的评论提取的行动覆盖率。为了克服任务描述不匹配的问题,我们开发了一种基于代码匹配的任务搜索方法,以找到相关的编程动作和代码示例的代码正在开发中。我们将知识图谱和任务搜索方法集成到IDE中,并开发了一个基于任务推送的工具,以提示开发人员使用面向任务的API示例。为了缓解代码信息过载问题,我们的工具基于底层知识图谱在提示的教程任务摘录和代码示例中突出显示编程操作和API信息。我们的评估证实了高质量的构造知识图谱,并表明我们的代码匹配的任务搜索可以推荐有效的代码解决方案,编程问题上提出的堆栈溢出。一个小规模的用户研究表明,我们的工具是有用的,帮助开发人员在他们的编程任务中查找和使用相关的编程教程。

英文摘要:

Programming tutorials are often created to demonstrate programming tasks with code examples. However, our study of Stack Overflow questions reveals the low utilization of high-quality programming tutorials, which is caused task description mismatch and code information overload. Document search can find relevant tutorial documents, but they often cannot find specific programming actions and code solutions relevant to the developers' task needs. The recently proposed activity-centric search over knowledge graph supports direct search of programming actions, but it has limitations in action coverage, natural language based task search, and coarse-grained code example recommendation. In this work, we enhance action coverage in knowledge graph with actions extracted from comments in code examples and more forms of activity sentences. To overcome the task description mismatch problem, we develop a code matching based task search method to find relevant programming actions and code examples to the code under development. We integrate our knowledge graph and task search method in the IDE, and develop an observe-push based tool to prompt developers with task-oriented API usage examples. To alleviate the code information overload problem, our tool highlights programming action and API information in the prompted tutorial task excerpts and code examples based on the underlying knowledge graph. Our evaluation confirms the high quality of the constructed knowledge graph, and show that our code matching based task search can recommend effective code solutions to programming issues asked on Stack Overflow. A small-scale user study demonstrates that our tool is useful for assisting developers in finding and using relevant programming tutorials in their programming tasks.

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

↑