paperbot · PL 论文追踪

全部论文 待读 收藏

P2 How Readable is Model-generated Code? Examining Readability and Visual Inspection of GitHub Copilot

模型生成的代码有多可读?考察 GitHub Copilot 的可读性与视觉检查
ASE Proceedings of the 37th IEEE/ACM International Conference on Automated Software Engineering2022匹配度 2/10 · 该论文属于人因与HCI研究,关注Copilot生成代码的可读性和程序员眼动行为,不涉及静态分析、形式化验证、浮点程序分析或贝叶斯程序分析,也不以LLM/Agent改进程序分析工具为目标,与研究方向核心匹配度低。引用 48 inbox
Naser Al Madi
crossref: 2026-09-12

AI 速览

一句话:眼动实验表明,Copilot 生成代码可读性接近人类,但程序员对其视觉关注显著更少。

论文关注大型语言模型用于代码生成后,实践中的代码可读性与视觉检查问题。作者以 GitHub Copilot 为对象,开展 n=21 的人体实验,将模型生成代码与完全由人类程序员(含结对编程)编写的代码进行对比。方法结合静态代码分析与人工标注评估可读性,并用眼动追踪测量程序员阅读代码时的视觉注意力分配。结果显示,模型生成代码在复杂度和可读性上与人类结对程序员编写的代码相当;但眼动数据在统计显著水平上表明,程序员对模型生成代码投入的视觉注意力更少。作者据此指出,在自动化偏见和自满风险下,阅读代码比以往更重要。

问题
大型语言模型被广泛用于代码生成,但其对代码可读性和程序员视觉检查的影响尚不清楚,尤其存在自动化偏见风险。
方法
通过 n=21 的人体实验,结合静态代码分析、人工标注与眼动追踪,对比 GitHub Copilot 生成代码与人类程序员编写代码。
评估
从复杂度、可读性评分和视觉注意力指标评估;发现生成代码可读性接近人类结对程序员,但程序员对其视觉关注显著更少。
原文摘要(Abstract)

Background: Recent advancements in large language models have motivated the practical use of such models in code generation and program synthesis. However, little is known about the effects of such tools on code readability and visual attention in practice. Objective: In this paper, we focus on GitHub Copilot to address the issues of readability and visual inspection of model generated code. Readability and low complexity are vital aspects of good source code, and visual inspection of generated code is important in light of automation bias. Method: Through a human experiment (n=21) we compare model generated code to code written completely by human programmers. We use a combination of static code analysis and human annotators to assess code readability, and we use eye tracking to assess the visual inspection of code. Results: Our results suggest that model generated code is comparable in complexity and readability to code written by human pair programmers. At the same time, eye tracking data suggests, to a statistically significant level, that programmers direct less visual attention to model generated code. Conclusion: Our findings highlight that reading code is more important than ever, and programmers should beware of complacency and automation bias with model generated code.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@inproceedings{paperbot7234,
  title = {How Readable is Model-generated Code? Examining Readability and Visual Inspection of GitHub Copilot},
  author = {Naser Al Madi},
  booktitle = {ASE},
  year = {2022},
  doi = {10.1145/3551349.3560438}
}