Towards Exploring the Code Reuse from Stack Overflow during Software Development

04/27/2022
by   Yuan Huang, et al.
0

As one of the most well-known programmer Q A websites, Stack Overflow (i.e., SO) is serving tens of thousands of developers every day. Previous work has shown that many developers reuse the code snippets on SO when they find an answer (from SO) that functionally matches the programming problem they encounter in their development activities. To study how programmers reuse code on SO during project development, we conduct a comprehensive empirical study. First, to capture the development activities of programmers, we collect 342,148 modified code snippets in commits from 793 open-source Java projects, and these modified code can reflect the programming problems encountered during development. We also collect the code snippets from 1,355,617 posts on SO. Then, we employ CCFinder to detect the code clone between the modified code from commits and the code from SO, and further analyze the code reuse when programmer solves a programming problem during development. We count the code reuse ratios of the modified code snippets in the commits of each project in different years, the results show that the average code reuse ratio is 6.32 and the maximum is 8.38 year by year, and the proportion of code reuse in the newly established project is higher than that of old projects. We also find that some projects reuse the code snippets from many years ago. Additionally, we find that experienced developers seem to be more likely to reuse the knowledge on SO. Moreover, we find that the code reuse ratio in bug-related commits (6.67 higher than that of in non-bug-related commits (6.59 find that the code reuse ratio (14.44 multiple modifications is more than double the overall code reuse ratio (6.32

READ FULL TEXT
research
02/23/2023

On Code Reuse from StackOverflow: An Exploratory Study on Jupyter Notebook

Jupyter Notebook is a popular tool among data analysts and scientists fo...
research
07/03/2022

One-off Events? An Empirical Study of Hackathon Code Creation and Reuse

Background: Hackathons have become popular events for teams to collabora...
research
03/22/2021

Multi-Programming-Language Commits in OSS: An Empirical Study on Apache Projects

Modern software systems, such as Spark, are usually written in multiple ...
research
07/31/2018

Sourcerer's Apprentice and the study of code snippet migration

On the worldwide web, not only are webpages connected but source code is...
research
08/24/2023

Understanding Solidity Event Logging Practices in the Wild

Writing logging messages is a well-established conventional programming ...
research
03/01/2021

The Secret Life of Hackathon Code

Background: Hackathons have become popular events for teams to collabora...
research
02/11/2021

CENTRIS: A Precise and Scalable Approach for Identifying Modified Open-Source Software Reuse

Open-source software (OSS) is widely reused as it provides convenience a...

Please sign up or login with your details

Forgot password? Click here to reset