長い/複雑なステートメント(Long or complex code line) – 単語の区切り(Word boundary styles) – 整形(Formatting style) 14 出典: 文献[2] Oliveira, Delano, et al. "A systematic literature review on the impact of formatting elements on program understandability." Available at SSRN 4182156 (2022)
4, 8といったスペースの数に関しては統計的に差があるとはいえないというものが 多い。 • コードブロックの区切り(Block delimiters) – {や}を独立した1行としたほうがよいか – 誤認識、時間に関して統計的に有意な差はない。 – 条件分岐等で紛らわしい場合には有意な差が報告されている。 15 出典: 文献[2] Oliveira, Delano, et al. "A systematic literature review on the impact of formatting elements on program understandability." Available at SSRN 4182156 (2022)
– 長すぎないほうがよいという意見が多いことが報告されている。 • 単語の区切り(Word boundary styles) – 複数の単語で構成される識別子の名称 例)minimum_valueとminimumValue – 識別子を探す実験において「_」でつないだほうが見落としが統計的に有意に少ないと いう報告がある。 • 整形(Formatting style) – Book format style, Pretty-printed style, Kerningham&Ritchie styleのように見た目を そろえるために空白行を入れる等の工夫 – 主観評価において、「好ましい」という回答が統計的に有意に多いという報告がある。 16 出典: 文献[2] Oliveira, Delano, et al. "A systematic literature review on the impact of formatting elements on program understandability." Available at SSRN 4182156 (2022)
– 4行程度で誤読させやすいコード片(Atoms of confusion)19種類を抽出 – 73名のプログラムにコードを読んでもらい、統計的に有意に誤読しやすいコード15種 類を選択 • オープンソースソフトウェアで該当するコードを抽出 – Linux, FreeBSD, Gecko, WebKit, GCC, Clang, MongoDB, MySQL, Emacs, Vim, Httpd, Nginx 22 出典: [4] Gopstein, D., Zhou, H. H., Frankl, P., & Cappos, J. (2018, May). Prevalence of confusing code in software projects: Atoms of confusion in the wild. In Proceedings of the 15th international conference on mining software repositories (pp. 281-291).
Frankl, P., & Cappos, J. (2018, May). Prevalence of confusing code in software projects: Atoms of confusion in the wild. In Proceedings of the 15th international conference on mining software repositories (pp. 281-291).
A., & Katahira, K. (2025). Relationship between Model-based Decision-making and the Comprehension Performance of Source Code with Confusing Patterns. IEEE Transactions on Software Engineering. 参考 https://note.com/smorisaki/n/n2a3756d8f21b
Sugiyama, Y., Morisaki, S., Toyama, A., & Katahira, K. (2025). Relationship between Model-based Decision-making and the Comprehension Performance of Source Code with Confusing Patterns. IEEE Transactions on Software Engineering. 参考 https://note.com/smorisaki/n/n2a3756d8f21b わかりやすく変換 誤読しやすい
• 生成AIの出力を4人の研究者が評価 – 妥当な内容か – ネットに公開されている情報でないか – 修正の必要があるか? • 結果 – 大きなコードであっても、抽象的な説明はできず、特定箇所のみを説明してしまう – (x > 100)を「xが100より小さい」と説明してしまう等 30 出典: [6] Sarsa, S., Denny, P., Hellas, A., & Leinonen, J. (2022, August). Automatic generation of programming exercises and code explanations using large language models. In Proceedings of the 2022 ACM Conference on International Computing Education Research-Volume 1 (pp. 27-43).