Do Comments and Expertise Still Matter? An Experiment on Programmers' Adoption of AI-Generated JavaScript Code
By: Changwen Li, Christoph Treude, Ofir Turel
Potential Business Impact:
Helps coders use AI suggestions by adding comments.
This paper investigates the factors influencing programmers' adoption of AI-generated JavaScript code recommendations within the context of lightweight, function-level programming tasks. It extends prior research by (1) utilizing objective (as opposed to the typically self-reported) measurements for programmers' adoption of AI-generated code and (2) examining whether AI-generated comments added to code recommendations and development expertise drive AI-generated code adoption. We tested these potential drivers in an online experiment with 173 programmers. Participants were asked to answer some questions to demonstrate their level of development expertise. Then, they were asked to solve a LeetCode problem without AI support. After attempting to solve the problem on their own, they received an AI-generated solution to assist them in refining their solutions. The solutions provided were manipulated to include or exclude AI-generated comments (a between-subjects factor). Programmers' adoption of AI-generated code was gauged by code similarity between AI-generated solutions and participants' submitted solutions, providing a behavioral measurement of code adoption behaviors. Our findings revealed that, within the context of function-level programming tasks, the presence of comments significantly influences programmers' adoption of AI-generated code regardless of the participants' development expertise.
Similar Papers
From Teacher to Colleague: How Coding Experience Shapes Developer Perceptions of AI Tools
Human-Computer Interaction
Helps coders use AI better based on skill.
The Influence of Code Comments on the Perceived Helpfulness of Stack Overflow Posts
Software Engineering
Makes code easier to understand with comments.
Does AI Code Review Lead to Code Changes? A Case Study of GitHub Actions
Software Engineering
Helps computers find mistakes in code faster.