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

08/31/2022
by   Naser Al Madi, et al.
0

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.

READ FULL TEXT
research
06/02/2023

Is Model Attention Aligned with Human Attention? An Empirical Study on Large Language Models for Code Generation

Large Language Models (LLMs) have been demonstrated effective for code g...
research
05/16/2023

Towards Modeling Human Attention from Eye Movements for Neural Source Code Summarization

Neural source code summarization is the task of generating natural langu...
research
04/19/2023

How Secure is Code Generated by ChatGPT?

In recent years, large language models have been responsible for great a...
research
02/02/2022

Targeted Code Inspection based on Human Errors

As a direct cause of software defects, human error is the key to underst...
research
08/26/2023

Modeling Programmer Attention as Scanpath Prediction

This paper launches a new effort at modeling programmer attention by pre...
research
05/20/2021

Measuring Coding Challenge Competence With APPS

While programming is one of the most broadly applicable skills in modern...
research
03/08/2019

Developer Reading Behavior While Summarizing Java Methods: Size and Context Matters

An eye-tracking study of 18 developers reading and summarizing Java meth...

Please sign up or login with your details

Forgot password? Click here to reset