A Quantitative Analysis of Quality and Consistency in AI-generated Code

被引:0
|
作者
Clark, Autumn [1 ]
Igbokwe, Daniel [1 ]
Ross, Samantha [1 ]
Zibran, Minhaz F. [1 ]
机构
[1] Idaho State Univ, Dept Comp Sci, Pocatello, ID 83209 USA
关键词
ChatGPT; Generative AI; Code; Quality; Complexity; Consistency; !text type='Python']Python[!/text; Program; Analysis;
D O I
10.1109/ICoSSE62619.2024.00014
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
With the recent emergence of generative AI (Artificial intelligence), Large Language Model (LLM) based tools such as ChatGPT have become popular assistants to humans in diverse tasks. ChatGPT has also been widely adopted for solving programming problems and for generating source code in software development. This research investigates both the code quality and the consistency of code quality over iterative prompts in 625 ChatGPT-generated Python code samples in the DevGPT dataset and the corresponding code snippets regenerated by manually prompting ChatGPT. Code samples are measured in terms of seven Halstead complexity metrics. We also assess how consistent they are across code snippets generated by different versions of ChatGPT. It was found that while ChatGPT generates good quality code across iterative prompts, it does generate semi-frequent bugs, similar to how humans do, necessitating code review before integration. These traits also remain consistent across code snippets generated by subsequent releases of ChatGPT. These results suggest using AI-generated source code in software development will not hinder the process.
引用
收藏
页码:37 / 41
页数:5
相关论文
共 50 条
  • [31] Racial bias in AI-generated images
    Yang, Yiran
    AI & SOCIETY, 2025,
  • [32] How persuasive is AI-generated propaganda?
    Goldstein, Josh A.
    Chao, Jason
    Grossman, Shelby
    Stamos, Alex
    Tomz, Michael
    PNAS NEXUS, 2024, 3 (02):
  • [33] Caution with AI-generated content in biomedicine
    Zhavoronkov, Alex
    NATURE MEDICINE, 2023, 29 (03) : 532 - 532
  • [34] Perception of Ai-Generated Art: Text Analysis of Online Discussions
    S. Bosonogov
    A. Suvorova
    Journal of Mathematical Sciences, 2024, 285 (1) : 1 - 13
  • [35] Advances in AI-Generated Images and Videos
    Bougueffa, Hessen
    Keita, Mamadou
    Hamidouche, Wassim
    Taleb-Ahmed, Abdelmalik
    Liz-Lopez, Helena
    Martin, Alejandro
    Camacho, David
    Hadid, Abdenour
    INTERNATIONAL JOURNAL OF INTERACTIVE MULTIMEDIA AND ARTIFICIAL INTELLIGENCE, 2024, 9 (01):
  • [36] Caution with AI-generated content in biomedicine
    Alex Zhavoronkov
    Nature Medicine, 2023, 29 : 532 - 532
  • [37] Mind ascribed to AI and the appreciation of AI-generated art
    Messingschlager, Tanja Veronika
    Appel, Markus
    NEW MEDIA & SOCIETY, 2025, 27 (03) : 1673 - 1692
  • [38] Generative AI and AI-generated Contents on Social Media
    Wang, Yichuan
    Su, Yiran
    Proceedings of the Annual Hawaii International Conference on System Sciences, 2024, : 2714 - 2715
  • [39] A feasibility study for the application of AI-generated conversations in pragmatic analysis
    Chen, Xi
    Li, Jun
    Ye, Yuting
    JOURNAL OF PRAGMATICS, 2024, 223 : 14 - 30
  • [40] Gender stereotypes in AI-generated images
    Garcia-Ull, Francisco-Jose
    Melero-Lazaro, Monica
    PROFESIONAL DE LA INFORMACION, 2023, 32 (05):