An Exploratory Study on God Header Files in Open-Source C Projects

Yue Wang,Wenhui Chang,Yanzhen Zou,Bing Xie
DOI: https://doi.org/10.1145/3671016.3671391
2024-01-01
Abstract:God Header Files, like God Classes, pose difficulties in code understanding and lead to slow compilation in code evolution. However, there is little empirical evidence on their prevalence and impact. This study aims to investigate God Header Files in open-source C language software projects, in terms of their size, distribution, impact on compilation, and whether existing God Class refactoring approaches can decompose them effectively. We collected and quantitatively analyzed 557 popular open-source C language software projects and their commit histories, focusing on files with large code size, wide impact, and frequent modifications. Then we decomposed several typical header files using graph clustering algorithms and existing God Class refactoring methods. The most important results of our study can be summarized as follows: (1) 37.5% of the studied projects are affected by God Header Files, with 203 projects having 649 God Header Files; (2) 103 of the identified God Header Files have been modified hundreds of times, while 95% of the modifications only involve a small proportion of code. (3) Decomposing God Header Files with generic graph clustering algorithms and God Class refactoring methods could reduce recompilation to some extent during software evolution, but a new solution needs to be proposed in the future. Our study highlights the importance of God Header Files since they are widespread and can be harmful in software maintenance. Decomposition is an effective way to refactor God Header Files but better decomposing algorithms need to be proposed.
What problem does this paper attempt to address?