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

从挖掘的代码段生成堆栈溢出的问题标题

Generating Question Titles for Stack Overflow from Mined Code Snippets

Zhipeng Gao, Xin Xia, John Grundy, David Lo, Yuan-Fang Li

摘要:

Stack Overflow已被软件开发人员大量使用,作为通过互联网从同行中寻求编程相关信息的流行方式。Stack Overflow社区建议用户在创建问题时提供相关代码片段,以帮助其他人更好地理解并提供帮助。以前的研究表明,这些问题中有相当一部分是低质量的,对Stack Overflow中的其他潜在专家没有吸引力。这些问得不好的问题不太可能得到有用的答案,并阻碍了整个知识生成和共享过程。考虑到在SO中引入低质量问题的原因之一是,许多开发人员可能无法澄清和总结他们所呈现的代码片段背后的关键问题,因为他们缺乏与问题相关的知识和术语,和/或他们的写作技巧很差,在这项研究中,我们提出了一种方法来帮助开发人员编写高-通过使用深度序列到序列学习方法为代码片段自动生成问题标题来生成高质量的问题。我们的方法是完全数据驱动的,并使用一个注意力机制来执行更好的内容选择,一个复制机制来处理罕见的单词问题和覆盖机制,以消除单词重复问题。我们在各种程序设计语言(例如,Python,Java,JavaScript,C#和SQL)和我们的实验结果表明,我们的方法显着优于几个国家的最先进的基线在自动和人工评估。我们已经发布了我们的代码和数据集,以方便其他研究人员验证他们的想法并激发后续工作。

英文摘要:

Stack Overflow has been heavily used by software developers as a popular way to seek programming-related information from peers via the internet. The Stack Overflow community recommends users to provide the related code snippet when they are creating a question to help others better understand it and offer their help. Previous studies have shown that} a significant number of these questions are of low-quality and not attractive to other potential experts in Stack Overflow. These poorly asked questions are less likely to receive useful answers and hinder the overall knowledge generation and sharing process. Considering one of the reasons for introducing low-quality questions in SO is that many developers may not be able to clarify and summarize the key problems behind their presented code snippets due to their lack of knowledge and terminology related to the problem, and/or their poor writing skills, in this study we propose an approach to assist developers in writing high-quality questions by automatically generating question titles for a code snippet using a deep sequence-to-sequence learning approach. Our approach is fully data-driven and uses an attention mechanism to perform better content selection, a copy mechanism to handle the rare-words problem and a coverage mechanism to eliminate word repetition problem. We evaluate our approach on Stack Overflow datasets over a variety of programming languages (e.g., Python, Java, Javascript, C# and SQL) and our experimental results show that our approach significantly outperforms several state-of-the-art baselines in both automatic and human evaluation. We have released our code and datasets to facilitate other researchers to verify their ideas and inspire the follow-up work.

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

↑