Decomposing God Header File via Multi-View Graph Clustering
<|reference_start|>Decomposing God Header File via Multi-View Graph Clustering: God Header Files, just like God Classes, pose significant challenges for code comprehension and maintenance. Additionally, they increase the time required for code recompilation. However, existing refactoring methods for God Classes are inappropriate to deal with God Header Files because the code elements in header files are mostly short declaration types, and build dependencies of the entire system should be considered with the aim of improving compilation efficiency. Meanwhile, ensuring acyclic dependencies among the decomposed sub-header files is also crucial in the God Header File decomposition. This paper proposes a multi-view graph clustering based approach for decomposing God Header Files. It first constructs and coarsens the code element graph, then a novel multi-view graph clustering algorithm is applied to identify the clusters and a heuristic algorithm is introduced to address the cyclic dependencies in the clustering results. To evaluate our approach, we built both a synthetic dataset and a real-world God Header Files dataset. The results show that 1) Our approach could achieve 11.5% higher accuracy than existing God Class refactoring methods; 2) Our decomposition results attain better architecture on real-world God Header Files, evidenced by higher modularity and acyclic dependencies; 3) We can reduce 15% to 60% recompilation time for historical commits that require recompiling.<|reference_end|>
@article{wang2024decomposing,
    title={Decomposing God Header File via Multi-View Graph Clustering},
    author={Yue Wang, Wenhui Chang, Tongwei Deng, Yanzhen Zou and Bing Xie},
    journal={arXiv preprint arXiv:2406.16487},
    year={2024},
    archivePrefix={arXiv},
    eprint={2406.16487},
    primaryClass={cs.SE}
}