arrow
返回

An empirical study of code reuse between GitHub and stack overflow during software development

delete2024-04-01
delete1
PRE
AI
X
Xiangping Chen
F
Furen Xu
黄袁 封面图
黄袁 (Yuan Huang) *
X
Xiaocong Zhou
Z
Zibin Zheng
DOI:10.1016/j.jss.2024.111964delete
delete原文链接
delete原文求助
delete分享
delete收藏
摘要

摘要

En 中文
With the rise of programming Q&A websites (e.g., Stack Overflow) and the open-source movement, code reuse has become a common phenomenon. Our study aims to provide a comprehensive study of the code reuse behavior of programmers during software development, i.e., we mainly focus on the code reuse between the code snippets in the commits of open-source projects and the code snippets on Stack Overflow (SO). The open-source java project code dataset we construct contains 793 projects which include 342,148 modified code snippets, and the SO code dataset includes 1,355,617 posts. Then, we employ a code clone detection tool to identify the instances of code reuse between the modified code snippets of commits and the code snippets of the SO posts. We find that the average code reuse ratio of the projects is 6.32%, which will have a significant upward trend in the future. Additionally, we find that experienced developers seem to be more likely to reuse the code on SO, and prefer to reuse posts with more favorites and higher scores. We combine deep learning and topic analysis algorithms to fully exploit the semantic information of SO posts. The result shows a certain difference in the distribution of post types reused by bug-related commits and non-bug-related commits. We also discover that the code reuse ratio (14.44%) in java class files that have undergone multiple modifications is more than double the overall code reuse ratio (6.32%). Finally, we discuss the reuse habits of programmers and find that they may refer to multiple posts in one reuse, and these posts are related to a certain extent. From these results, our study provides multiple practical insights for different stakeholders: researchers, developers, and the SO platform.
Keyword:
Stack overflow
Code reuse
Code clone
Semantic analysis

期刊

Journal of Systems and Software 封面图
Journal of Systems and Software
IF:
4.1
论文数:
5.4K
被引数:
8.4K

机构

S
Sun Yat Sen University
学者数:
9.9W
论文数: 7.2W
被引数: 95
引用论文

引用论文

err
IF0
err
err0
errOAAI
err
err分享
err收藏
Notes on seed traps in terrestrial plant communities
err1998-01-01
err0
PREAI
errJohannes Kollmann; Dethardt Goetze
err分享
err收藏
Hemodynamic Exercise Response in Calves with an Implantable Biventricular Centrifugal Blood Pump
err2002-01-11
err0
errOAAI
errJörg Linneweber; Kenji Nonaka; Tamaki Takano; Shinji Kawahito; Sebastian Schulte‐Eistrup; Tadashi Motomura; Seiji Ichikawa; Minoru Mikami; Shelly Stevens; Heinrich Schima; Ernst Wolner; Yukihiko Nosé
err分享
err收藏
Toward Empirically Investigating Non-Functional Requirements of iOS Developers on Stack Overflow
err2019-01-01
err16
errOAAI
errAhmad, Arshad; Feng, Chong; Li, Kan; Asim, Syed Mohammad; Sun, Tingting
err分享
err收藏
学者 查看更多内容