I Know What You Are Searching for: Code Snippet Recommendation from Stack Overflow Posts

计算机科学 代码段 源代码 情报检索 文档 编码(集合论) 万维网 程序设计语言 集合(抽象数据类型)
作者
Zhipeng Gao,Xin Xia,David Lo,John Grundy,Xindong Zhang,Zhenchang Xing
出处
期刊:ACM Transactions on Software Engineering and Methodology [Association for Computing Machinery]
卷期号:32 (3): 1-42 被引量:3
标识
DOI:10.1145/3550150
摘要

Stack Overflow has been heavily used by software developers to seek programming-related information. More and more developers use Community Question and Answer forums, such as Stack Overflow, to search for code examples of how to accomplish a certain coding task. This is often considered to be more efficient than working from source documentation, tutorials, or full worked examples. However, due to the complexity of these online Question and Answer forums and the very large volume of information they contain, developers can be overwhelmed by the sheer volume of available information. This makes it hard to find and/or even be aware of the most relevant code examples to meet their needs. To alleviate this issue, in this work, we present a query-driven code recommendation tool, named Que2Code , that identifies the best code snippets for a user query from Stack Overflow posts. Our approach has two main stages: (i) semantically equivalent question retrieval and (ii) best code snippet recommendation. During the first stage, for a given query question formulated by a developer, we first generate paraphrase questions for the input query as a way of query boosting and then retrieve the relevant Stack Overflow posted questions based on these generated questions. In the second stage, we collect all of the code snippets within questions retrieved in the first stage and develop a novel scheme to rank code snippet candidates from Stack Overflow posts via pairwise comparisons. To evaluate the performance of our proposed model, we conduct a large-scale experiment to evaluate the effectiveness of the semantically equivalent question retrieval task and best code snippet recommendation task separately on Python and Java datasets in Stack Overflow. We also perform a human study to measure how real-world developers perceive the results generated by our model. Both the automatic and human evaluation results demonstrate the promising performance of our model, and we have released our code and data to assist other researchers.
最长约 10秒,即可获得该文献文件

科研通智能强力驱动
Strongly Powered by AbleSci AI
更新
大幅提高文件上传限制,最高150M (2024-4-1)

科研通是完全免费的文献互助平台,具备全网最快的应助速度,最高的求助完成率。 对每一个文献求助,科研通都将尽心尽力,给求助人一个满意的交代。
实时播报
缪晓丝发布了新的文献求助10
1秒前
所所应助缥缈映安采纳,获得10
5秒前
nan完成签到,获得积分10
5秒前
fujun0095完成签到,获得积分10
5秒前
liu95完成签到 ,获得积分10
9秒前
缪晓丝完成签到,获得积分10
11秒前
小赞完成签到,获得积分10
11秒前
guoxihan完成签到,获得积分10
15秒前
20秒前
战斗暴龙兽完成签到,获得积分10
22秒前
Vincent发布了新的文献求助10
24秒前
26秒前
客官们帮帮忙完成签到 ,获得积分10
29秒前
ninomae完成签到 ,获得积分10
34秒前
34秒前
Dr W完成签到 ,获得积分10
35秒前
Sun1c7完成签到,获得积分10
36秒前
秀丽青枫完成签到 ,获得积分10
36秒前
廉向珊完成签到 ,获得积分10
37秒前
猫儿发布了新的文献求助10
38秒前
40秒前
山城完成签到 ,获得积分10
43秒前
磁带机完成签到,获得积分10
45秒前
想吃芝士焗饭完成签到 ,获得积分10
45秒前
无花果应助Vincent采纳,获得10
49秒前
文与武完成签到 ,获得积分10
50秒前
Lesterem完成签到 ,获得积分10
52秒前
龙阔完成签到 ,获得积分10
53秒前
一程完成签到 ,获得积分10
53秒前
tranphucthinh完成签到,获得积分10
59秒前
Oliver完成签到 ,获得积分10
1分钟前
琦qi完成签到 ,获得积分10
1分钟前
还单身的绝山完成签到 ,获得积分10
1分钟前
Kidmuse完成签到,获得积分10
1分钟前
1分钟前
1分钟前
1997SD完成签到,获得积分10
1分钟前
王灿灿发布了新的文献求助10
1分钟前
猫儿完成签到,获得积分20
1分钟前
fgh完成签到 ,获得积分10
1分钟前
高分求助中
The Oxford Handbook of Social Cognition (Second Edition, 2024) 1050
Kinetics of the Esterification Between 2-[(4-hydroxybutoxy)carbonyl] Benzoic Acid with 1,4-Butanediol: Tetrabutyl Orthotitanate as Catalyst 1000
The Young builders of New china : the visit of the delegation of the WFDY to the Chinese People's Republic 1000
юрские динозавры восточного забайкалья 800
English Wealden Fossils 700
Handbook of Qualitative Cross-Cultural Research Methods 600
Chen Hansheng: China’s Last Romantic Revolutionary 500
热门求助领域 (近24小时)
化学 医学 生物 材料科学 工程类 有机化学 生物化学 物理 内科学 纳米技术 计算机科学 化学工程 复合材料 基因 遗传学 催化作用 物理化学 免疫学 量子力学 细胞生物学
热门帖子
关注 科研通微信公众号,转发送积分 3139659
求助须知:如何正确求助?哪些是违规求助? 2790537
关于积分的说明 7795633
捐赠科研通 2446993
什么是DOI,文献DOI怎么找? 1301543
科研通“疑难数据库(出版商)”最低求助积分说明 626264
版权声明 601176