Preprint Article Version 1 Preserved in Portico This version is not peer-reviewed

Does ChatGPT Help Novice Programmers Write Better Code? Results from Static Code Analysis

Version 1 : Received: 17 June 2024 / Approved: 17 June 2024 / Online: 17 June 2024 (14:37:47 CEST)

A peer-reviewed article of this Preprint also exists.

Haindl, P.; Weinberger, G. Does ChatGPT Help Novice Programmers Write Better Code? Results from Static Code Analysis. IEEE Access 2024, 1–1, doi:10.1109/access.2024.3445432. Haindl, P.; Weinberger, G. Does ChatGPT Help Novice Programmers Write Better Code? Results from Static Code Analysis. IEEE Access 2024, 1–1, doi:10.1109/access.2024.3445432.

Abstract

In the rapidly evolving landscape of AI-supported programming education, there's a growing interest in leveraging such tools to support students helping about what good code makes out. This study investigates the impact of ChatGPT on code quality among part-time undergraduate students enrolled in introductory Java programming courses. With no prior Java experience, students from two separate groups completed identical programming exercises emphasizing coding conventions and code quality. Utilizing static code analysis tools, we assessed adherence to a common coding convention ruleset and calculated cyclomatic and cognitive complexity metrics for submitted code. Our comparative analysis highlights significant improvements in code quality for the ChatGPT-assisted group (treatment group), with marked reductions in rule violations and both cyclomatic and cognitive complexities. Specifically, the treatment group demonstrated greater adherence to coding standards, with fewer violations across several rules, and produced code with lower complexity. These results suggest that ChatGPT can be a valuable tool in programming education, aiding students in writing cleaner, less complex code and better adhering to coding conventions. However, the study's limitations, including the small sample size and the novice status of the participants, necessitate further research with larger, more diverse populations and in different educational contexts.

Keywords

Programming Education; ChatGPT Large Language Models; Static Code Analysis

Subject

Computer Science and Mathematics, Software

Comments (0)

We encourage comments and feedback from a broad range of readers. See criteria for comments and our Diversity statement.

Leave a public comment
Send a private comment to the author(s)
* All users must log in before leaving a comment
Views 0
Downloads 0
Comments 0


×
Alerts
Notify me about updates to this article or when a peer-reviewed version is published.
We use cookies on our website to ensure you get the best experience.
Read more about our cookies here.