Understanding Code Snippets in Code Reviews: A Preliminary Study of the OpenStack Community

被引:1
|
作者
Fu, Liming [1 ]
Liang, Peng [1 ]
Zhang, Beiqi [1 ]
机构
[1] Wuhan Univ, Sch Comp Sci, Wuhan, Peoples R China
基金
国家重点研发计划;
关键词
Code Snippet; Code Review; OpenStack;
D O I
10.1145/3524610.3527884
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Code review is a mature practice for software quality assurance in software development with which reviewers check the code that has been committed by developers, and verify the quality of code. During the code review discussions, reviewers and developers might use code snippets to provide necessary information (e.g., suggestions or explanations). However, little is known about the intentions and impacts of code snippets in code reviews. To this end, we conducted a preliminary study to investigate the nature of code snippets and their purposes in code reviews. We manually collected and checked 10,790 review comments from the Nova and Neutron projects of the OpenStack community, and finally obtained 626 review comments that contain code snippets for further analysis. The results show that: (1) code snippets are not prevalently used in code reviews, and most of the code snippets are provided by reviewers. (2) We identified two high-level purposes of code snippets provided by reviewers (i.e., Suggestion and Citation) with six detailed purposes, among which, Improving Code Implementation is the most common purpose. (3) For the code snippets in code reviews with the aim of suggestion, around 68.1% was accepted by developers. The results highlight promising research directions on using code snippets in code reviews.
引用
收藏
页码:152 / 156
页数:5
相关论文
共 50 条
  • [31] Are the Code Snippets What We Are Searching for? A Benchmark and an Empirical Study on Code Search with Natural-Language Queries
    Yan, Shuhan
    Yu, Hang
    Chen, Yuting
    Shen, Beijun
    Jiang, Lingxiao
    PROCEEDINGS OF THE 2020 IEEE 27TH INTERNATIONAL CONFERENCE ON SOFTWARE ANALYSIS, EVOLUTION, AND REENGINEERING (SANER '20), 2020, : 344 - 354
  • [32] Code Reviews in C plus plus Preliminary Results from an Eye Tracking Study
    Hauser, Florian
    Schreistetter, Stefan
    Reuter, Rebecca
    Mottok, Juergen
    Gruber, Hans
    Holmqvist, Kenneth
    Schorr, Nick
    ETRA 2020 SHORT PAPERS: ACM SYMPOSIUM ON EYE TRACKING RESEARCH & APPLICATIONS, 2020,
  • [33] Collaborations and Code Reviews
    Carver, Jeffrey C.
    Caglayan, Bora
    Habayeb, Mayy
    Penzenstadler, Birgit
    Yamashita, Aiko
    IEEE SOFTWARE, 2015, 32 (05) : 27 - 29
  • [34] Understanding Low-Code or No-Code Adoption in Software Startups: Preliminary Results from a Comparative Case Study
    Rafiq, Usman
    Filippo, Cenacchi
    Wang, Xiaofeng
    PRODUCT-FOCUSED SOFTWARE PROCESS IMPROVEMENT, PROFES 2022, 2022, 13709 : 390 - 398
  • [35] Recommending Code Understandability Improvements based on Code Reviews
    Oliveira, Delano
    2021 36TH IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING WORKSHOPS (ASEW 2021), 2021, : 131 - 132
  • [36] Do code reviews lead to fewer code smells?
    Tuna, Erdem
    Seaman, Carolyn
    Tuzun, Eray
    JOURNAL OF SYSTEMS AND SOFTWARE, 2024, 215
  • [37] CROP: Linking Code Reviews to Source Code Changes
    Paixao, Matheus
    Krinke, Jens
    Han, Donggyun
    Harman, Mark
    2018 IEEE/ACM 15TH INTERNATIONAL CONFERENCE ON MINING SOFTWARE REPOSITORIES (MSR), 2018, : 46 - 49
  • [38] How Do Developers Adapt Code Snippets to Their Contexts? An Empirical Study of Context-Based Code Snippet Adaptations
    Zhang, Tanghaoran
    Lu, Yao
    Yu, Yue
    Mao, Xinjun
    Zhang, Yang
    Zhao, Yuxin
    IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2024, 50 (11) : 2712 - 2731
  • [39] Code Reviews, Software Inspections, and Code Walkthroughs: Systematic Mapping Study of Research Topics
    Fronza, Ilenia
    Hellas, Arto
    Ihantola, Petri
    Mikkonen, Tommi
    SOFTWARE QUALITY: QUALITY INTELLIGENCE IN SOFTWARE AND SYSTEMS ENGINEERING, 2020, 371 : 121 - 133
  • [40] Intelligent mining vulnerabilities in python']python code snippets
    Guo, Wenbo
    Huang, Cheng
    Niu, Weina
    Fang, Yong
    JOURNAL OF INTELLIGENT & FUZZY SYSTEMS, 2021, 41 (02) : 3615 - 3628