The Impact of Compiler Warnings on Code Quality in C plus plus Projects

被引:0
|
作者
Johansson, Albin [1 ]
Holmberg, Carl [1 ]
Neto, Francisco G. de Oliveira [2 ]
Leitner, Philipp [2 ]
机构
[1] Chalmers Univ Technol, Dept Comp Sci & Engn, Gothenburg, Sweden
[2] Chalmers Univ Gothenburg, Dept Comp Sci & Engn, Gothenburg, Sweden
基金
瑞典研究理事会;
关键词
Compiler Warnings; Code Quality; Bayesian Data Analysis;
D O I
10.1145/3643916.3644410
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Modern compilers often offer a variety of warning flags, which developers can enable to get feedback on code that, while syntactically correct, may be problematic. In the case of C++, one example of such "correct but problematic" code is code that leads to undefined behavior (UB). The usage of compiler warnings has long been suspected as a way to decrease bugs and increase code quality. However, empirical evidence that supports this hypothesis is rare. In this study, we present evidence from a study of 127 open source C++ projects. We categorize their usage of compiler warnings into five groups based on which warning flags are being used, and analyse the relationship between compiler warnings and five quality metrics (bugs, critical issues, vulnerabilities, code smells, and technical debt) using Bayesian analysis. We conclude that, in general, compiler warnings indeed correlate with, and potentially cause, higher code quality, with the clearest impact being on the number of critical issues in a project. Using stricter warning flags expectantly correlates with higher code quality in our study objects. However, there are substantial differences between projects, which we attribute to the project's individual development culture. That is, while warnings matter, other factors such as quality culture, are likely to be even more important to source code quality.
引用
收藏
页码:270 / 279
页数:10
相关论文
共 50 条
  • [1] Compiler Support for Profiling C plus plus Template Metaprograms
    Mihalicza, Jozsef
    Pataki, Norbert
    Porkolab, Zoltan
    12TH SYMPOSIUM ON PROGRAMMING LANGUAGES AND SOFTWARE TOOLS, SPLST' 11, 2011, : 32 - 43
  • [2] Bridging Excel and C/C plus plus Code
    Punuru, Janardhana R.
    Knopf, F. Carl
    COMPUTER APPLICATIONS IN ENGINEERING EDUCATION, 2008, 16 (04) : 289 - 304
  • [3] Enhancing Security Check in Visual Studio C/C plus plus Compiler
    Wu, Yongdong
    2009 WRI WORLD CONGRESS ON SOFTWARE ENGINEERING, VOL 4, PROCEEDINGS, 2009, : 109 - 113
  • [4] A C/C plus plus Source-to-Source Compiler for dependable applications
    Benso, A
    Chiusano, S
    Prinetto, P
    Tagliaferri, L
    DSN 2000: INTERNATIONAL CONFERENCE ON DEPENDABLE SYSTEMS AND NETWORKS, PROCEEDINGS, 2000, : 71 - 78
  • [5] Analysis and Code Model Extraction for C/C plus plus Source Code
    Wagner, Christian
    Margaria, Tiziana
    Pagendarm, Hans-Georg
    2009 14TH IEEE INTERNATIONAL CONFERENCE ON ENGINEERING OF COMPLEX COMPUTER SYSTEMS (ICECCS), 2009, : 110 - +
  • [6] ABC: Accelerated Building of C/C plus plus Projects
    Zhang, Ying
    Jiang, Yanyan
    Xu, Chang
    Ma, Xiaoxing
    Yu, Ping
    2015 22ND ASIA-PACIFIC SOFTWARE ENGINEERING CONFERENCE (APSEC 2015), 2015, : 182 - 189
  • [7] A C/C plus plus Code Vulnerability Dataset with Code Changes and CVE Summaries
    Fan, Jiahao
    Li, Yi
    Wang, Shaohua
    Nguyen, Tien N.
    2020 IEEE/ACM 17TH INTERNATIONAL CONFERENCE ON MINING SOFTWARE REPOSITORIES, MSR, 2020, : 508 - 512
  • [8] Compiler Optimization for Scientific Computation in C/C plus
    Botor, Tomas
    Habiballa, Hashim
    INTERNATIONAL CONFERENCE OF COMPUTATIONAL METHODS IN SCIENCES AND ENGINEERING 2018 (ICCMSE-2018), 2018, 2040
  • [9] C plus plus EDSL for parallel code generation
    Berenyi, Daniel
    PROCEEDINGS 2015 8TH ROMANIA TIER 2 FEDERATION GRID, CLOUD & HIGH PERFORMANCE COMPUTING IN SCIENCE (RO-LCG), 2015,
  • [10] PackHunter: Recovering Missing Packages for C/C plus plus Projects
    Wu, Rongxin
    Huang, Zhiling
    Tian, Zige
    Wang, Chengpeng
    Zhang, Xiangyu
    IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2025, 51 (01) : 206 - 219