Toxic Code Snippets on Stack Overflow
Not on the map. Why?
Abstract (arXiv)
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% response rate) showed that 131 participants (65%) have ever been notified of outdated code and 26 of them (20%) rarely or never fix the code. 138 answerers (69%) 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% of them are not aware of CC BY-SA 3.0 license enforced by Stack Overflow, and 66% 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%) 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.
Key facts. Cited by 9 papers in the map (data through 14 Oct 2026). First posted on arXiv 20 Jun 2018.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2021: 1; 2022: 0; 2023: 1; 2024: 2; 2025: 1; 2026: 4.
9 papers.
- 2021Natural Language-Guided Programmingcited by 4
- 2024Aligning LLMs through Multi-perspective User Preference Ranking-based Feedback for Programming Question Answeringcited by 4
- 2024Studying and Recommending Information Highlighting in Stack Overflow Answerscited by 2
- 2025RefactorCoderQA: Benchmarking LLMs for Multi-Domain Coding Question Solutions in Cloud and Edge Deploymentcited by 2
- 2023Skill over Scale: The Case for Medium, Domain-Specific Models for SEcited by 0
- 2026Coding in a Bubble? Evaluating LLMs in Resolving Context Adaptation Bugs During Code Adaptationcited by 0
- 2026Human-Aligned Enhancement of Programming Answers with LLMs Guided by User Feedbackcited by 0
- 2026Analyzing Chain of Thought (CoT) Approaches in Control Flow Code Deobfuscation Taskscited by 0
- 2026AdaptAgent: A Multi-agent, Domain-Guided Reasoning Framework for Code Adaptationcited by 0
- 2026AdaptAgent: A Multi-agent, Domain-Guided Reasoning Framework for Code Adaptation5 Aug 2026
- 2026Analyzing Chain of Thought (CoT) Approaches in Control Flow Code Deobfuscation Tasks16 Apr 2026
- 2026Human-Aligned Enhancement of Programming Answers with LLMs Guided by User Feedback24 Jan 2026
- 2026Coding in a Bubble? Evaluating LLMs in Resolving Context Adaptation Bugs During Code Adaptation10 Jan 2026
- 2025RefactorCoderQA: Benchmarking LLMs for Multi-Domain Coding Question Solutions in Cloud and Edge Deployment12 Sep 2025
- 2024Aligning LLMs through Multi-perspective User Preference Ranking-based Feedback for Programming Question Answering27 May 2024
- 2024Studying and Recommending Information Highlighting in Stack Overflow Answers3 Jan 2024
- 2023Skill over Scale: The Case for Medium, Domain-Specific Models for SE5 Jun 2023
- 2021Natural Language-Guided Programming11 Aug 2021