Studying the Change Histories of Stack Overflow and GitHub Snippets

被引:8
|
作者
Manes, Saraj Singh [1 ]
Baysal, Olga [1 ]
机构
[1] Carleton Univ, Sch Comp Sci, Ottawa, ON, Canada
关键词
Code snippets; change history; evolution; Stack Overflow; GitHub; time series; co-change; code reuse; CODE; HARMFUL;
D O I
10.1109/MSR52588.2021.00040
中图分类号
TP [自动化技术、计算机技术];
学科分类号
0812 ;
摘要
Stack Overflow is a popular Q&A forum for software developers, providing a large number of copyable code snippets. While GitHub is a collaborative development platform, developers often reuse Stack Overflow code in their GitHub projects. These snippets get revised or edited on each platform. In this work, we study Stack Overflow posts and the code snippets that are reused from these posts in GitHub projects. We investigate and compare the change history of SO snippets with the change history of GitHub snippets. We have applied a stratified random sampling when mining 440,000 GitHub projects to create a dataset representing the change history of the reused snippets; this dataset contains 22,900 GitHub projects, 33,765 Stack Overflow references mapped to 4,634 Stack Overflow posts, and a total of 73,322 commits. We analyze the evolution patterns of snippets on each platform, compare key trends and explore the co-change of these snippets. Our results demonstrate that 76% of snippets evolve on Stack Overflow, while only 22% of the reused code snippets evolve in GitHub. Stack Overflow snippets undergo fewer and smaller changes compared to their evolving counterparts on GitHub. The evolution of snippets on both platforms is driven by the original author of the content. Finally, we found that a small percentage of snippets is co-changing across two platforms, while snippets in GitHub and Stack Overflow evolve independently of one another.
引用
收藏
页码:283 / 294
页数:12
相关论文
共 50 条
  • [21] SCC plus plus : Predicting the programming language of questions and snippets of Stack Overflow
    Alrashedy, Kamel
    Dharmaretnam, Dhanush
    German, Daniel M.
    Srinivasan, Venkatesh
    Gulliver, T. Aaron
    JOURNAL OF SYSTEMS AND SOFTWARE, 2020, 162
  • [22] Identifying Smart Contract Security Issues in Code Snippets from Stack Overflow
    Chen, Jiachi
    Chen, Chong
    Hu, Jiang
    Grundy, John
    Wang, Yanlin
    Chen, Ting
    Zheng, Zibin
    PROCEEDINGS OF THE 33RD ACM SIGSOFT INTERNATIONAL SYMPOSIUM ON SOFTWARE TESTING AND ANALYSIS, ISSTA 2024, 2024, : 1198 - 1210
  • [23] iTrustSO: An Intelligent System for Automatic Detection of Insecure Code Snippets in Stack Overflow
    Chen, Lingwei
    Hou, Shifu
    Ye, Yanfang
    Bourlai, Thirimachos
    Xu, Shouhuai
    Zhao, Liang
    PROCEEDINGS OF THE 2019 IEEE/ACM INTERNATIONAL CONFERENCE ON ADVANCES IN SOCIAL NETWORKS ANALYSIS AND MINING (ASONAM 2019), 2019, : 1097 - 1104
  • [24] Unveiling Python']Python Version Compatibility Challenges in Code Snippets on Stack Overflow
    Yang, Shiyu
    Kanda, Tetsuya
    German, Daniel M.
    Higo, Yoshiki
    IEICE TRANSACTIONS ON INFORMATION AND SYSTEMS, 2024, E107D (08) : 1007 - 1015
  • [25] Patterns of interest change in stack overflow
    Chenbo Fu
    Xinchen Yue
    Bin Shen
    Shanqing Yu
    Yong Min
    Scientific Reports, 12
  • [26] Patterns of interest change in stack overflow
    Fu, Chenbo
    Yue, Xinchen
    Shen, Bin
    Yu, Shanqing
    Min, Yong
    SCIENTIFIC REPORTS, 2022, 12 (01)
  • [27] Studying and recommending information highlighting in Stack Overflow answers
    Ahmed, Shahla Shaan
    Wang, Shaowei
    Tian, Yuan
    Chen, Tse-Hsun
    Zhang, Haoxiang
    INFORMATION AND SOFTWARE TECHNOLOGY, 2024, 172
  • [28] Answers or no answers: Studying question answerability in Stack Overflow
    Chua, Alton Y. K.
    Banerjee, Snehasish
    JOURNAL OF INFORMATION SCIENCE, 2015, 41 (05) : 720 - 731
  • [29] Developing a hyperparameter optimization method for classification of code snippets and questions of stack overflow: HyperSCC
    Ozturk, Muhammed Maruf
    EAI ENDORSED TRANSACTIONS ON SCALABLE INFORMATION SYSTEMS, 2022, 10 (01)
  • [30] PyVerDetector: A Chrome Extension Detecting the Python']Python Version of Stack Overflow Code Snippets
    Yang, Shiyu
    Kanda, Tetsuya
    Pizzolotto, Davide
    German, Daniel M.
    Higo, Yoshiki
    2023 IEEE/ACM 31ST INTERNATIONAL CONFERENCE ON PROGRAM COMPREHENSION, ICPC, 2023, : 25 - 29