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 条
  • [1] AI-Generated Code Not Considered Harmful
    Kendon, Tyson
    Wu, Leanne
    Aycock, John
    PROCEEDINGS OF THE 25TH WESTERN CANADIAN CONFERENCE ON COMPUTING EDUCATION, 2023,
  • [2] Navigating (in)security of AI-generated code
    Ambati, Sri Haritha
    Ridley, Norah
    Branca, Enrico
    Stakhanova, Natalia
    2024 IEEE INTERNATIONAL CONFERENCE ON CYBER SECURITY AND RESILIENCE, CSR, 2024, : 30 - 37
  • [3] Validating AI-Generated Code with Live Programming
    Ferdowsi, Kasra
    Huang, Ruanqianqian
    James, Michael B.
    Polikarpova, Nadia
    Lerner, Sorin
    PROCEEDINGS OF THE 2024 CHI CONFERENCE ON HUMAN FACTORS IN COMPUTING SYTEMS (CHI 2024), 2024,
  • [4] DeVAIC: : A tool for security assessment of AI-generated code
    Cotroneo, Domenico
    De Luca, Roberta
    Liguori, Pietro
    INFORMATION AND SOFTWARE TECHNOLOGY, 2025, 177
  • [5] Creating Thorough Tests for AI-Generated Code is Hard
    Singhal, Shreya
    Kumar, Viraj
    PROCEEDINGS OF THE 16TH ANNUAL ACM INDIA COMPUTE CONFERENCE, COMPUTE 2023, 2023, : 108 - 111
  • [6] Assessing AI Detectors in Identifying AI-Generated Code: Implications for Education
    Pan, Wei Hung
    Chok, Ming Jie
    Wong, Jonathan Leong Shan
    Shin, Yung Xin
    Poon, Yeong Shian
    Yang, Zhou
    Chong, Chun Yong
    Lo, David
    Lim, Mei Kuan
    2024 ACM/IEEE 44TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING: SOFTWARE ENGINEERING EDUCATION AND TRAINING, ICSE-SEET 2024, 2024, : 1 - 11
  • [7] Appeal and quality assessment for AI-generated images
    Goering, Steve
    Rao, Rakesh Ramachandra Rao
    Merten, Rasmus
    Raake, Alexander
    2023 15TH INTERNATIONAL CONFERENCE ON QUALITY OF MULTIMEDIA EXPERIENCE, QOMEX, 2023, : 115 - 118
  • [8] An Analysis of the Copyrightability of AI-Generated Images
    Zheng Xianfang
    Xing Ziran
    Contemporary Social Sciences, 2024, 9 (06) : 100 - 114
  • [9] AI-generated Podcast Summaries of Radiology Articles: Analysis of Content and Quality
    Tejani, Ali S.
    Khosravi, Bardia
    Savage, Cody H.
    Moy, Linda
    Kahn, Charles E.
    Yi, Paul H.
    RADIOLOGY, 2025, 314 (03)
  • [10] EX-CODE: A Robust and Explainable Model to Detect AI-Generated Code
    Bulla, Luana
    Midolo, Alessandro
    Mongiovi, Misael
    Tramontana, Emiliano
    INFORMATION, 2024, 15 (12)