Generating Question Titles for Stack Overflow from Mined Code Snippets

被引:41
作者
Gao, Zhipeng [1 ]
Xia, Xin [1 ]
Grundy, John [1 ]
Lo, David [2 ]
Li, Yuan-Fang [1 ]
机构
[1] Monash Univ, Bldg 6,29 Ancora Imparo Way,Clayton Campus, Clayton, Vic 3800, Australia
[2] Singapore Management Univ, Sch Informat Syst, 80 Stamford Rd, Singapore 178902, Singapore
关键词
Stack overflow; question generation; question quality; sequence-to-sequence;
D O I
10.1145/3401026
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
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.
引用
收藏
页数:37
相关论文
共 76 条
[1]  
Allamanis M, 2015, PR MACH LEARN RES, V37, P2123
[2]  
Allamanis M, 2013, IEEE WORK CONF MIN S, P53, DOI 10.1109/MSR.2013.6624004
[3]  
[Anonymous], 2016, ARXIV160306744
[4]  
[Anonymous], 2016, ARXIV160803000
[5]  
[Anonymous], 2016, M ASS COMP LING
[6]  
[Anonymous], 2016, ARXIV160802927
[7]  
[Anonymous], 2017, ARXIV170407734
[8]  
[Anonymous], 2020, IEEE TOPIC CONF WIRE
[9]  
[Anonymous], 2014, ABS14090473 CORR
[10]  
[Anonymous], 2012, P 18 ACM SIGKDD INT, DOI [DOI 10.1145/2339530.2339665, 10.1145/2339530.2339665]