# Stack Overflow in Github: Any Snippets There?

**Authors:** Di Yang, Pedro Martins, Vaibhav Saini, Cristina Lopes

arXiv: 1705.01198 · 2017-05-04

## TL;DR

This study investigates the extent and nature of Stack Overflow code snippets used in GitHub Python projects, analyzing large-scale code cloning patterns and programmer behaviors.

## Contribution

It provides the first large-scale quantitative and qualitative analysis of how Stack Overflow snippets are integrated and adapted in real-world GitHub projects.

## Key findings

- Significant code cloning between Stack Overflow and GitHub
- Many snippets are used with minimal modifications
- Programmers adapt snippets based on project-specific needs

## Abstract

When programmers look for how to achieve certain programming tasks, Stack Overflow is a popular destination in search engine results. Over the years, Stack Overflow has accumulated an impressive knowledge base of snippets of code that are amply documented. We are interested in studying how programmers use these snippets of code in their projects. Can we find Stack Overflow snippets in real projects? When snippets are used, is this copy literal or does it suffer adaptations? And are these adaptations specializations required by the idiosyncrasies of the target artifact, or are they motivated by specific requirements of the programmer? The large-scale study presented on this paper analyzes 909k non-fork Python projects hosted on Github, which contain 290M function definitions, and 1.9M Python snippets captured in Stack Overflow. Results are presented as quantitative analysis of block-level code cloning intra and inter Stack Overflow and GitHub, and as an analysis of programming behaviors through the qualitative analysis of our findings.

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/1705.01198/full.md

## Figures

12 figures with captions in the complete paper: https://tomesphere.com/paper/1705.01198/full.md

## References

23 references — full list in the complete paper: https://tomesphere.com/paper/1705.01198/full.md

---
Source: https://tomesphere.com/paper/1705.01198