Usage and Attribution of Stack Overflow Code Snippets in GitHub Projects

02/08/2018
by   Sebastian Baltes, et al.
0

Stack Overflow (SO) is the largest Q&A website for software developers, providing a huge 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 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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
06/20/2018

Toxic Code Snippets on Stack Overflow

Online code clones are code fragments that are copied from software proj...
research
08/18/2023

How Do Java Developers Reuse StackOverflow Answers in Their GitHub Projects?

StackOverflow (SO) is a widely used question-and-answer (Q&A) website fo...
research
09/03/2023

Who Made This Copy? An Empirical Analysis of Code Clone Authorship

Code clones are code snippets that are identical or similar to other sni...
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
04/14/2022

Recommending Code Improvements Based on Stack Overflow Answer Edits

Background: Sub-optimal code is prevalent in software systems. Developer...
research
09/30/2021

Crypto Experts Advise What They Adopt

Previous studies have shown that developers regularly seek advice on onl...
research
05/28/2019

Analyzing and Supporting Adaptation of Online Code Examples

Developers often resort to online Q&A forums such as Stack Overflow (SO)...

Please sign up or login with your details

Forgot password? Click here to reset