Usage and Attribution of Stack Overflow Code Snippets in GitHub Projects
Not on the map. Why?
Abstract (arXiv)
Stack Overflow (SO) is the most popular question-and-answer website for software developers, providing a large amount of copyable code snippets. Using those snippets raises maintenance and legal issues. SO's license (CC BY-SA 3.0) requires attribution, i.e., referencing the original question or answer, and requires derived work to adopt a compatible license. While there is a heated debate on SO's license model for code snippets and the required attribution, little is known about the extent to which snippets are copied from SO without proper attribution. We present results of a large-scale empirical study analyzing the usage and attribution of non-trivial Java code snippets from SO answers in public GitHub (GH) projects. We followed three different approaches to triangulate an estimate for the ratio of unattributed usages and conducted two online surveys with software developers to complement our results. For the different sets of projects that we analyzed, the ratio of projects containing files with a reference to SO varied between 3.3% and 11.9%. We found that at most 1.8% of all analyzed repositories containing code from SO used the code in a way compatible with CC BY-SA 3.0. Moreover, we estimate that at most a quarter of the copied code snippets from SO are attributed as required. Of the surveyed developers, almost one half admitted copying code from SO without attribution and about two thirds were not aware of the license of SO code snippets and its implications.
Key facts. Cited by 6 papers in the map (data through 14 Oct 2026). First posted on arXiv 8 Feb 2018.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2023: 1; 2024: 2; 2025: 1; 2026: 2.
6 papers.
- 2024PeaTMOSS: A Dataset and Initial Analysis of Pre-Trained Models in Open-Source Softwarecited by 9
- 2024Instruct or Interact? Exploring and Eliciting LLMs' Capability in Code Snippet Adaptation Through Prompt Engineeringcited by 6
- 2023Machine Learning practices and infrastructurescited by 2
- 2025The AI Memory Gap: Users Misremember What They Created With AI or Withoutcited by 2
- 2026AdaptEval: A Benchmark for Evaluating Large Language Models on Code Snippet Adaptationcited by 1
- 2026The Uneven Decline of Collective Knowledge Production: Evidence from Stack Overflow After Generative AIcited by 0
- 2026The Uneven Decline of Collective Knowledge Production: Evidence from Stack Overflow After Generative AI28 Sep 2026
- 2026AdaptEval: A Benchmark for Evaluating Large Language Models on Code Snippet Adaptation8 Jan 2026
- 2025The AI Memory Gap: Users Misremember What They Created With AI or Without15 Sep 2025
- 2024Instruct or Interact? Exploring and Eliciting LLMs' Capability in Code Snippet Adaptation Through Prompt Engineering23 Nov 2024
- 2024PeaTMOSS: A Dataset and Initial Analysis of Pre-Trained Models in Open-Source Software1 Feb 2024
- 2023Machine Learning practices and infrastructures13 Jul 2023