arrow
Return

Toxic Code Snippets on Stack Overflow

delete2021-03-01
delete62
delete
OA
AI
C
Chaiyong Ragkhitwetsagul *
J
Jens Krinke
M
Matheus Paixão
G
Giuseppe Bianco
Rocco Oliveto cover
Rocco Oliveto (Rocco Oliveto)
DOI:10.1109/TSE.2019.2900307delete
deleteOriginal
deleteShare
deleteSave
View PDF
Abstract

Abstract

En 中文
Online code clones are code fragments that are copied from software projects or online sources to Stack Overflow as examples. Due to an absence of a checking mechanism after the code has been copied to Stack Overflow, they can become toxic code snippets, e.g., they suffer from being outdated or violating the original software license. We present a study of online code clones on Stack Overflow and their toxicity by incorporating two developer surveys and a large-scale code clone detection. A survey of 201 high-reputation Stack Overflow answerers (33 percent response rate) showed that 131 participants (65 percent) have ever been notified of outdated code and 26 of them (20 percent) rarely or never fix the code. 138 answerers (69 percent) never check for licensing conflicts between their copied code snippets and Stack Overflow's CC BY-SA 3.0. A survey of 87 Stack Overflow visitors shows that they experienced several issues from Stack Overflow answers: mismatched solutions, outdated solutions, incorrect solutions, and buggy code. 85 percent of them are not aware of CC BY-SA 3.0 license enforced by Stack Overflow, and 66 percent never check for license conflicts when reusing code snippets. Our clone detection found online clone pairs between 72,365 Java code snippets on Stack Overflow and 111 open source projects in the curated Qualitas corpus. We analysed 2,289 non-trivial online clone candidates. Our investigation revealed strong evidence that 153 clones have been copied from a Qualitas project to Stack Overflow. We found 100 of them (66 percent) to be outdated, of which 10 were buggy and harmful for reuse. Furthermore, we found 214 code snippets that could potentially violate the license of their original software and appear 7,112 times in 2,427 GitHub projects.
Keywords:
Cloning
Licenses
Software
Programming
Computer bugs
Security
Tutorials
Code clone detection
stack overflow
outdated code
software licensing
An empirical study of code reuse between GitHub and stack overflow during software development
err2024-04-01
err1
PREAI
errChen, Xiangping; Xu, Furen; Huang, Yuan; Zhou, Xiaocong; Zheng, Zibin
errShare
errSave
An empirical study on bug propagation through code cloning
err2019-12-01
err8
PREAI
errMondal, Manishankar; Roy, Banani; Roy, Chanchal K.; Schneider, Kevin A.
errShare
errSave
A Study of C/C plus plus Code Weaknesses on Stack Overflow
err2022-07-01
err19
PREAI
errZhang, Haoxiang; Wang, Shaowei; Li, Heng; Chen, Tse-Hsun; Hassan, Ahmed E.
errShare
errSave
I Know What You Are Searching for: Code Snippet Recommendation from Stack Overflow Posts
err2023-04-26
err13
errOAAI
errGao, Zhipeng; Xia, Xin; Lo, David; Grundy, John; Zhang, Xindong; Xing, Zhenchang
errShare
errSave
Broken External Links on Stack Overflow
err2022-09-01
err5
errOAAI
errLiu, Jiakun; Xia, Xin; Lo, David; Zhang, Haoxiang; Zou, Ying; Hassan, Ahmed E.; Li, Shanping
errShare
errSave
errShare
errSave
errShare
errSave

Journal

IEEE Transactions on Software Engineering cover
IEEE Transactions on Software Engineering
IF:
5.6
Papers:
3.0K
Citations:
1.3W

Organization

U
university college london
Scholars:
5.2K
Papers: 2.3K
Citations: 5.8W
U
universidade estadual do ceará
Scholars:
96
Papers: 27
Citations: 232
M
Mahidol University
Scholars:
1.4K
Papers: 500
Citations: 7.1K
U
University of London
Scholars:
1.7K
Papers: 763
Citations: 14.7W
U
University of Molise
Scholars:
142
Papers: 65
Citations: 1.3K
researcher View more organizations
Cited Papers

Cited Papers

errShare
errSave
2.4 W CW 770 nm laser arrays with nonabsorbing mirrors
err1987-05-07
err0
PREAI
errD.F. Welch; W. Streifer; R.L. Thornton; T. Paoli
errShare
errSave
Sustainability of the community-based ecotourism development in the Aksu-Zhabagly nature reserve, Kazakhstan
err2022-03-07
err0
errOAAI
errImanaly Akbar; Sergeyeva Aigul Maksatovna; Myrzaliyeva Zabira Kazbekkyzy; Tazhekova Akmaral Zhaksybekkyzy; Saulembaev Altynbai Tagabayevich; Mominov Serik Abdukarimovich
errShare
errSave
Dual Hole Transport Layers Heterojunction and Band Alignment Engineered Mo:BiVO4 Photoanodes for Efficient Water Splitting (Small 37/2024)
err2024-09-13
err0
PREAI
errGuilin Wang; Tongxin Tang; Kai‐Hang Ye; Xin Ding; Junwei Chen; WenHao Zou; Yushen Xiao; JieYu Li; Long Zhao; Chaojie Chen; Sitong Ge; Lei Li; Xiujuan Wei; Chao Chen; Yang Cao; Zhan Lin; Shanqing Zhang
errShare
errSave
errShare
errSave
Lys63/Met1-hybrid ubiquitin chains are commonly formed during the activation of innate immune signalling
err2016-06-01
err0
errOAAI
errChristoph H. Emmerich; Siddharth Bakshi; Ian R. Kelsall; Juanma Ortiz-Guerrero; Natalia Shpiro; Philip Cohen
errShare
errSave
researcher View more