Toxic Code Snippets on Stack Overflow

06/20/2018
by   Chaiyong Ragkhitwetsagul, et al.
0

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, i.e., 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 ever been notified of outdated code and 26 of them (20 the code. 138 answerers (69 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 enforced by Stack Overflow, and 66 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 outdated and potentially 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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
06/21/2018

Awareness and Experience of Developers to Outdated and License-Violating Code on Stack Overflow: An Online Survey

We performed two online surveys of Stack Overflow answerers and visitors...
research
02/08/2018

Usage and Attribution of Stack Overflow Code Snippets in GitHub Projects

Stack Overflow (SO) is the largest Q&A website for software developers, ...
research
04/16/2020

Optimising the Fit of Stack Overflow Code Snippets into Existing Code

Software developers often reuse code from online sources such as Stack O...
research
10/31/2019

Existence of Stack Overflow Vulnerabilities in Well-known Open Source Projects

A stack overflow occurs when a program or process tries to store more da...
research
02/04/2020

Code Duplication on Stack Overflow

Despite the unarguable importance of Stack Overflow (SO) for the daily w...
research
05/04/2023

Improving Code Example Recommendations on Informal Documentation Using BERT and Query-Aware LSH: A Comparative Study

The study of code example recommendation has been conducted extensively ...
research
02/28/2018

Orion+: Automated Problem Diagnosis in Computing Systems by Mining Metric Data

This work presents the suspicious code at a finer granularity of call st...

Please sign up or login with your details

Forgot password? Click here to reset