We use a few cookies

Essential cookies keep the library working. With your permission, we'd also like to use analytics to see what's useful and improve the experience. Read our Privacy Policy or Cookie Policy.

Skip to main content
Home/e-Resources/Computer Science & Information Technology/Code Reuse in Stack Overflow and Popular Open Source Java Projects
PeriodicalsComputer Science & Information Technology

Code Reuse in Stack Overflow and Popular Open Source Java Projects

Checking your access to this record.

Abstract & Overview

Solutions provided in Question and Answer (Q&A) websites such as Stack Overflow are regularly used in Open Source Software (OSS). However, many developers are unaware that both Stack Overflow and OSS are governed by licenses. Hence, developers reusing code from Stack Overflow for their OSS projects may violate licensing agreements if their attributions are not correct. Additionally, if code migrates from one OSS through Stack Overflow to another OSS, then complex licensing issues are likely to exist. Such forms of software reuse also have implications for future software maintenance, particularly where developers have poor understanding of copied code. This paper investigates code reuse between these two platforms (i.e., Stack Overflow and OSS), with the aim of providing insights into this issue. This study mined 151,946 Java code snippets from Stack Overflow, 16,617 Java files from 12 of the top weekly listed projects on SourceForge and GitHub, and 39,616 Java files from the top 20 most popular Java projects on SourceForge. Our analyses were aimed at finding the number of clones (indicating reuse) (a) within Stack Overflow posts, (b) between Stack Overflow and popular Java OSS projects, and (c) between the projects. Outcomes reveal that there was up to 3.3% code reuse within Stack Overflow, while 1.0% of Stack Overflow code was reused in recent popular Java projects and 2.3% in those projects that were more established. Reuse across projects was much higher, accounting for as much as 77.2%. Our outcomes have implication for strategies aimed at introducing strict quality assurance measures to ensure the appropriateness of code reuse, and licensing requirements awareness.

Cite this record

Adriaan Lotter, Sherlock A. Licorish, Bastin Tony Roy Savarimuthu, Sarah Meldrum (2018). Code Reuse in Stack Overflow and Popular Open Source Java Projects. Australasian Software Engineering Conference (ASWEC), 141–150. https://doi.org/10.1109/aswec.2018.00027

Copy in another style

Lotter, A., Licorish, S. A., Savarimuthu, B. T. R., & Meldrum, S. (2018). Code Reuse in Stack Overflow and Popular Open Source Java Projects. Australasian Software Engineering Conference (ASWEC), 141–150. https://doi.org/10.1109/aswec.2018.00027
Author names are used as deposited, so check their order before you submit.

Metadata is harvested from open-access indexes and can be incomplete. Check a citation against the published version before relying on it — see our open access & attribution policy.