[論文レビュー] Early Career Developers' Perceptions of Code Understandability. A Study of Complexity Metrics
この実証的研究では、サイクロマティック・コンプレックスィティと認知的コンプレックスィティのどちらが開発者のコード理解性の主観的評価をよりよく予測するかを評価している。216名のジュニア開発者のうち、認知的コンプレックスィティはサイクロマティック・コンプレックスィティよりもわずかに強い相関を示したが、両方の指標は全体的に強くない予測要因であった。
Context. Code understandability is fundamental. Developers need to understand the code they are modifying clearly. A low understandability can increase the amount of coding effort, and misinterpreting code impacts the entire development process. Ideally, developers should write clear and understandable code with the least effort. Aim. Our work investigates whether the McCabe Cyclomatic Complexity or the Cognitive Complexity can be a good predictor for the developers' perceived code understandability to understand which of the two complexities can be used as criteria to evaluate if a piece of code is understandable. Method. We designed and conducted an empirical study among 216 early career developers with professional experience ranging from one to four years. We asked them to manually inspect and rate the understandability of 12 Java classes that exhibit different levels of Cyclomatic and Cognitive Complexity. Results. Our findings showed that while the old-fashioned McCabe Cyclomatic Complexity and the most recent Cognitive Complexity are modest predictors for code understandability when considering the complexity perceived by early-career developers, they are not for problem severity. Conclusions. Based on our results, early-career developers should not be left alone when performing code-reviewing tasks due to their scarce experience. Moreover, low complexity measures indicate good understandability, but having either CoC or CyC high makes understandability unpredictable. Nevertheless, there is no evidence that CyC or CoC are indicators of early-career perceived severity.Future research efforts will focus on expanding the population to experienced developers to confront whether seniority influences the predictive power of the chosen metrics.
研究の動機と目的
- 2つのコード複雑性指標(サイクロマティック・コンプレックスィティと認知的コンプレックスィティ)のうち、どちらが開発者のコード理解性の主観的評価をよりよく予測するかを調査すること。
- 高い複雑性レベルがソフトウェアクラスにおけるコード問題の深刻さの認識と相関するかを評価すること。
- 最近導入されたが、実証的根拠が限られている認知的コンプレックスィティが、コード理解性の指標として有効であるかを検証すること。
- 静的解析ツールやソフトウェア開発実務における複雑性指標に関する、根拠に基づく知見を提供すること。
- 初心者レベルのソフトウェア開発者における、理論的複雑性指標と現実世界の開発者認識との間のギャップを明らかにすること。
提案手法
- 学士および修士課程の学生で、1〜4年間のプロフェッショナル経験を持つ216名のジュニア開発者を参加者として従事した。
- SonarQubeで測定されたサイクロマティック・コンプレックスィティおよび認知的コンプレックスィティの異なる水準を持つ12個のJavaクラスを選定した。
- 開発者が各クラスの理解性を標準化された尺度で評価する手作業によるインスペクションタスクを実施した。
- 各クラスにおけるコード問題の深刻さの認識についての追加評価を収集し、複雑性指標との相関を評価した。
- 統計的分析を用いて、サイクロマティック・コンプレックスィティと認知的コンプレックスィティの両方が、主観的理解性に与える予測力の差を比較した。
- 被験者およびコードサンプル全体にわたる一貫した評価条件を確保するため、制御された、同一被験者デザインを採用した。

実験結果
リサーチクエスチョン
- RQ1認知的コンプレックスィティは、サイクロマティック・コンプレックスィティよりも開発者のコード理解性の主観的評価とより強く相関するか?
- RQ2高いサイクロマティック・コンプレックスィティまたは認知的コンプレックスィティを示すクラスは、より深刻なコード問題であると認識されるか?
- RQ3複雑性指標の水準に応じて、コード理解性の主観的評価に有意な差が生じるか?
- RQ4ジュニア開発者は複雑性指標に基づいて一貫してコード理解性を評価するのか、それとも他の要因がより影響力を持つのか?
- RQ5最近導入された認知的コンプレックスィティが、実務においてコード理解性の信頼できる代理指標として機能できるか?
主な発見
- 認知的コンプレックスィティは、サイクロマティック・コンプレックスィティよりも開発者のコード理解性の主観的評価とわずかに強い相関を示した。
- いずれの複雑性指標と主観的理解性との間の相関は全体的に弱く、予測力が限定的であることを示している。
- 複雑性レベル(サイクロマティックまたは認知的)とコード問題の深刻さの認識との間に有意な相関は認められなかった。
- 高い複雑性を示すクラスが一貫して深刻な問題を含むと認識されたわけではなく、複雑性と保守性の関係に関する仮定に疑問を呈するものであった。
- 本研究の結果から、サイクロマティック・コンプレックスィティおよび認知的コンプレックスィティのいずれも、ジュニア開発者におけるコード理解性の主観的評価を強く予測するものではないことが示された。
- 本研究は、コード理解性を評価するための代替的または補完的な指標のさらなる研究の必要性を浮き彫りにした。

この論文を読む
Nubintのビューアで原文を開き、読みながら気になる箇所をすぐに質問できます。
Nubintでこの論文を読むこのレビューはAIが論文の原文をもとに作成しました。引用する前に原文をご確認ください。