@techreport{oai:ipsj.ixsq.nii.ac.jp:00217306, author = {髙津, 周佑 and 鷲崎, 弘宜 and 深澤, 良彰}, issue = {20}, month = {Mar}, note = {C プリプロセッサは大規模な C 言語プロジェクトにおいて広く利用されているが,特に条件コンパイルディレクティブは主要な役割を果たしている.その反面,可読性や保守性の低下を引き起こす要因とされており,複雑な条件コンパイルディレクティブに対するリファクタリング手法への需要が高い.本論文では,条件コンパイルディレクティブの局所化によるリファクタリングを前提とし,条件中に含まれるマクロ変数に着目した上で,CV 複雑度と呼ばれるメトリクスを導入する.実験によって,このメトリクスを用いて 43 の C 言語のオープンソースプロジェクトを定量分析した.その結果,75% のマクロ変数の利用は局所的であるものの,環境互換性目的で利用されるマクロ変数には,特に散らばっている傾向が見られることが示された., C preprocessors are widely used in large-scale C projects; especially conditional compilation directives play a major role. On the other hand, they are considered to be a source of readability and maintainability degradation, and there is a high demand for refactoring methods for complex conditional compilation directives. In this paper, we introduce a metric called CV complexity, which is based on the premise of refactoring conditional compilation directives by localizing them and focusing on the macro variables contained in the conditions. In our experiments, we quantitatively analyzed 43 C open-source projects using this metric. The results show that while the use of 75 % macro variables is localized, the macro variables used for environment compatibility purposes tend to be particularly scattered.}, title = {条件コンパイルディレクティブ中のマクロ変数によるC言語プロジェクトの複雑度の定量分析}, year = {2022} }