arrow
Return

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
黄袁 cover
黄袁 (Yuan Huang) *
X
Xiaocong Zhou
Z
Zibin Zheng
DOI:10.1016/j.jss.2024.111964delete
deleteOriginal
deleteOriginal request for help
deleteShare
deleteSave
Abstract

Abstract

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.
Keywords:
Stack overflow
Code reuse
Code clone
Semantic analysis

Journal

Journal of Systems and Software cover
Journal of Systems and Software
IF:
4.1
Papers:
5.5K
Citations:
8.4K

Organization

S
Sun Yat Sen University
Scholars:
9.9W
Papers: 7.2W
Citations: 95
Cited Papers

Cited Papers

err
IF0
err
err0
errOAAI
err
errShare
errSave
Notes on seed traps in terrestrial plant communities
err1998-01-01
err0
PREAI
errJohannes Kollmann; Dethardt Goetze
errShare
errSave
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é
errShare
errSave
Definitive evidence that a single N-glycan among three glycans on inducible costimulator is required for proper protein trafficking and ligand binding
err2010-01-01
err0
PREAI
errNaoki Kamei; Rie Fukui; Yoshiyuki Suzuki; Yasuhiro Kajihara; Mitsuhiro Kinoshita; Kazuaki Kakehi; Hironobu Hojo; Katsunari Tezuka; Takashi Tsuji
errShare
errSave
Retrieving API Knowledge from Tutorials and Stack Overflow Based on Natural Language Queries
err2023-07-22
err9
errOAAI
errWu, Di; Jing, Xiao-Yuan; Zhang, Hongyu; Feng, Yang; Chen, Haowen; Zhou, Yuming; Xu, Baowen
errShare
errSave
Surveillance following radical or partial nephrectomy for renal cell carcinoma
err2005-01-01
err0
PREAI
errJohn S. Lam; John T. Leppert; Robert A. Figlin; Arie S. Belldegrun
errShare
errSave
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
errShare
errSave
researcher View more