The Impact of Compiler Warnings on Code Quality in C++ Projects
dc.contributor.author | Johansson, Albin | |
dc.contributor.author | Holmberg, Carl | |
dc.contributor.department | Chalmers tekniska högskola / Institutionen för data och informationsteknik | sv |
dc.contributor.department | Chalmers University of Technology / Department of Computer Science and Engineering | en |
dc.contributor.examiner | Gren, Lucas | |
dc.contributor.supervisor | Leitner, Philipp | |
dc.date.accessioned | 2023-08-03T08:51:26Z | |
dc.date.available | 2023-08-03T08:51:26Z | |
dc.date.issued | 2023 | |
dc.date.submitted | 2023 | |
dc.description.abstract | The usage of compiler warnings has widely been assumed to have a positive effect on code quality, but this notion has little evidence in research. This study investigated the relationship between the usage of compiler warnings and overall code quality in C++ projects. A purposive sampling approach was used to collect 127 C++ projects, which were subsequently analyzed with SonarCloud. Bayesian data analysis was utilized to investigate the correlation between compiler warning usage and measured code quality. The results indicated a correlation between stricter compiler warning usage and improved code quality for some code quality metrics, such as bugs, code smells, and technical debt. Projects that used compiler warnings generally performed better than projects with no warnings enabled, even for code quality metrics that were deemed unlikely to be affected by compiler warnings, such as the number of security hotspots and duplicated lines. Notably, projects that treated warnings as errors performed substantially better than similar projects that did not treat their warnings as errors. One proposed explanation was that this could be caused by a tendency among developers to ignore compiler warnings. It was concluded that the usage of stricter compiler warnings and improved code quality are correlated, while external factors such as engineering culture also likely contributed to the results. | |
dc.identifier.coursecode | DATX05 | |
dc.identifier.uri | http://hdl.handle.net/20.500.12380/306737 | |
dc.language.iso | eng | |
dc.setspec.uppsok | Technology | |
dc.subject | compiler warnings | |
dc.subject | code quality | |
dc.subject | C++ | |
dc.subject | static code analysis | |
dc.title | The Impact of Compiler Warnings on Code Quality in C++ Projects | |
dc.type.degree | Examensarbete för masterexamen | sv |
dc.type.degree | Master's Thesis | en |
dc.type.uppsok | H | |
local.programme | Software engineering and technology (MPSOF), MSc |