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 条
  • [1] Stack Overflow in Github: Any Snippets There?
    Yang, Di
    Martins, Pedro
    Saini, Vaibhav
    Lopes, Cristina
    2017 IEEE/ACM 14TH INTERNATIONAL CONFERENCE ON MINING SOFTWARE REPOSITORIES (MSR 2017), 2017, : 280 - 290
  • [2] Usage and attribution of Stack Overflow code snippets in GitHub projects
    Baltes, Sebastian
    Diehl, Stephan
    EMPIRICAL SOFTWARE ENGINEERING, 2019, 24 (03) : 1259 - 1295
  • [3] Attribution Required: Stack Overflow Code Snippets in GitHub Projects
    Baltes, Sebastian
    Kiefer, Richard
    Diehl, Stephan
    PROCEEDINGS OF THE 2017 IEEE/ACM 39TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING COMPANION (ICSE-C 2017), 2017, : 161 - 163
  • [4] Usage and attribution of Stack Overflow code snippets in GitHub projects
    Sebastian Baltes
    Stephan Diehl
    Empirical Software Engineering, 2019, 24 : 1259 - 1295
  • [5] Studying Software Developer Expertise and Contributions in Stack Overflow and GitHub
    Vadlamani, Sri Lakshmi
    Baysal, Olga
    2020 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE AND EVOLUTION (ICSME 2020), 2020, : 312 - 323
  • [6] Toxic Code Snippets on Stack Overflow
    Ragkhitwetsagul, Chaiyong
    Krinke, Jens
    Paixao, Matheus
    Bianco, Giuseppe
    Oliveto, Rocco
    IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2021, 47 (03) : 560 - 581
  • [7] Student Experiences with GitHub and Stack Overflow: An Exploratory Study
    Bhasin, Trishala
    Murray, Adam
    Storey, Margaret-Anne
    2021 IEEE/ACM 13TH INTERNATIONAL WORKSHOP ON COOPERATIVE AND HUMAN ASPECTS OF SOFTWARE ENGINEERING (CHASE 2021), 2021, : 81 - 90
  • [8] Identifying versions of libraries used in stack overflow code snippets
    Zerouali, Ahmed
    Velazquez-Rodriguez, Camilo
    De Roover, Coen
    Proceedings - 2021 IEEE/ACM 18th International Conference on Mining Software Repositories, MSR 2021, 2021, : 341 - 345
  • [9] Identifying Versions of Libraries used in Stack Overflow Code Snippets
    Zerouali, Ahmed
    Velazquez-Rodriguez, Camilo
    De Roover, Coen
    2021 IEEE/ACM 18TH INTERNATIONAL CONFERENCE ON MINING SOFTWARE REPOSITORIES (MSR 2021), 2021, : 341 - 345
  • [10] Geek Talents: Who are the Top Experts on GitHub and Stack Overflow?
    Tian, Yijun
    Ng, Waii
    Cao, Jialiang
    McIntosh, Suzanne
    CMC-COMPUTERS MATERIALS & CONTINUA, 2019, 61 (02): : 465 - 479