How Readable is Model-generated Code? Examining Readability and Visual Inspection of GitHub Copilot
arXiv:2208.14613 · doi:10.1145/3551349.3560438
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.
Cited by in corpus (8)
- "I'm Not Sure, But...": Examining the Impact of Large Language Models' Uncertainty Expression on User Reliance and Trust
- Practices and Challenges of Using GitHub Copilot: An Empirical Study
- Just another copy and paste? Comparing the security vulnerabilities of ChatGPT generated code and StackOverflow answers
- Take It, Leave It, or Fix It: Measuring Productivity and Trust in Human-AI Collaboration
- Human-AI Experience in Integrated Development Environments: A Systematic Literature Review
- Investigating the Readability of Test Code: Combining Scientific and Practical Views
- Do It For Me vs. Do It With Me: Investigating User Perceptions of Different Paradigms of Automation in Copilots for Feature-Rich Software
- A Systematic Literature Review of the Use of GenAI Assistants for Code Comprehension: Implications for Computing Education Research and Practice