Cited by 152Software Engineering ResearchSoftware Testing and Debugging TechniquesTeaching and Learning Programming

Refining ChatGPT-Generated Code: Characterizing and Mitigating Code Quality Issues

Open access
Liu, Yue, Le-Cong, Thanh, Widyasari, Ratnadira, Tantithamthavorn, Chakkrit, Li, Li, Le, Xuan-Bach D., Lo, David·2024·ACM Transactions on Software Engineering and Methodology

Abstract

Since its introduction in November 2022, ChatGPT has rapidly gained popularity due to its remarkable ability in language understanding and human-like responses. ChatGPT, based on GPT-3.5 architecture, has shown great promise for revolutionizing various research fields, including code generation. However, the reliability and quality of code generated by ChatGPT remain unexplored, raising concerns about potential risks associated with the widespread use of ChatGPT-driven code generation. In this article, we systematically study the quality of 4,066 ChatGPT-generated programs of code implemented in two popular programming languages, i.e., Java and Python, for 2,033 programming tasks. The goal of this work is threefold. First, we analyze the correctness of ChatGPT on code generation tasks and uncover the factors that influence its effectiveness, including task difficulty, programming language, time that tasks are introduced, and program size. Second, we identify and characterize potential issues with the quality of ChatGPT-generated code. Last, we provide insights into how these issues can be mitigated. Experiments highlight that out of 4,066 programs generated by ChatGPT, 2,756 programs are deemed correct, 1,082 programs provide wrong outputs, and 177 programs contain compilation or runtime errors. Additionally, we further analyze other characteristics of the generated code through static analysis tools, such as code style and maintainability, and find that 1,930 ChatGPT-generated code snippets suffer from maintainability issues. Subsequently, we investigate ChatGPT’s self-repairing ability and its interaction with static analysis tools to fix the errors uncovered in the previous step. Experiments suggest that ChatGPT can partially address these challenges, improving code quality by more than 20%, but there are still limitations and opportunities for improvement. Overall, our study provides valuable insights into the current limitations of ChatGPT and offers a roadmap for future research and development efforts to enhance the code generation capabilities of artificial intelligence models such as ChatGPT.

AI snapshot

Written from the paper’s full text.

TL;DR

This paper empirically evaluates ChatGPT-generated solutions for 2,033 LeetCode tasks in Java and Python, finding that many correct programs still carry quality problems. It also tests whether feedback prompts can help ChatGPT repair those issues, with partial success.

Key findings

  • Of 4,066 generated programs, 2,756 passed all tests, 1,082 produced wrong outputs, and 177 had compilation or runtime errors. Overall pass@1 was 0.664 for Python and 0.691 for Java, with performance dropping on harder tasks and newer tasks.
  • Code style and maintainability issues were common: 1,930 of 4,066 programs (47%) had such issues, including 1,243 of 2,756 passing programs (45%). Wrong outputs were also frequent, affecting 1,082 programs (27%).
  • ChatGPT could partially self-repair issues, with reported fix rates from about 20% to 60%. Feedback containing static-analysis and runtime-error details helped more for style and maintainability, while simple feedback sometimes worked better for other issue types.
  • Iterative repair improved code quality over rounds, but new issues were sometimes introduced in the fixed versions.

Methods

  • The authors built a benchmark of 2,033 LeetCode tasks (501 easy, 1,064 medium, 468 hard) and prompted ChatGPT-March-23 with zero-shot prompts, temperature 0, one run per task, generating Java and Python code.
  • Correctness was measured with pass@1 against LeetCode test suites; static analysis used PMD and Checkstyle for Java, and Pylint and Flake8 for Python.
  • Issues were categorized through open card sorting on a sample of 154 tasks, then quantified. Repair experiments compared simple feedback against feedback augmented with static-analysis and runtime-error information, including iterative rounds on 402 tasks released after 2022.

Limitations

  • The paper states external-validity limits: the dataset comes only from LeetCode and covers only Java and Python, so findings may not generalize to other tasks, languages, or project types.
  • The paper states internal-validity concerns around possible bugs in the authors’ code and manual categorization bias, mitigated by public code, three annotators, and temperature 0.
  • The paper states construct-validity concerns about pass@1 relying on LeetCode test suites and prompt variability; it also notes possible data leakage or memorization for older tasks. Evident from the text: only one ChatGPT version and one generation per task were used, which limits claims about other models or repeated sampling.

Model-written summary. Check it against the paper before relying on it.

Integrity signals

Registry

Crossref · 10.1145/3643674

Cites

49 of 49 references verified0 citation errors · 0 not checkable

Statistics

Nothing to recompute.

Claims the paper makes

0 of 27 cited sources checked · 0 supported · 0 flagged

  • Findingown data

    Of the 4,066 programs generated by ChatGPT, 2,756 were judged correct.

    “out of 4,066 programs generated by ChatGPT, 2,756 programs are deemed correct”
    Quote in the paperSubstantial claim
  • Findingown data

    Of the 4,066 programs generated by ChatGPT, 1,082 produced incorrect outputs.

    “1,082 programs provide wrong outputs”
    Quote in the paperSubstantial claim
  • Findingown data

    Of the 4,066 programs generated by ChatGPT, 177 had compilation or runtime errors.

    “177 programs contain compilation or runtime errors”
    Quote in the paperSubstantial claim
  • Findingown data

    1,930 ChatGPT-generated code snippets had maintainability problems.

    “1,930 ChatGPT-generated code snippets sufer from maintainability issues”
    Quote in the paperSubstantial claim
  • Findingown data

    ChatGPT's performance decreased by as much as fivefold on programming tasks introduced after January 2022.

    “ChatGPT's performance drops up to ive times on new programming tasks introduced after January 2022”
    Quote in the paperSubstantial claim
  • May combine two claims. 39
  • Classified as probably not a substantial claim. 35
  • The quote only partly states this claim. 2
  • May combine two claims.

    Findingown data

    66% of Python programs and 69% of Java programs generated by ChatGPT passed all provided test cases.

    “66% and 69% of Python and Java programs generated by ChatGPT are functionally-correct programs, i.e., programs that pass all given test cases”
    Quote in the paperSubstantial claim
  • May combine two claims.

    Findingown data

    The study's dataset consists of 2,033 LeetCode programming tasks and 4,066 ChatGPT-generated code snippets in Java and Python.

    “Introduce a new time-sensitive dataset comprising 2033 programming tasks and 4066 ChatGPT-generated code snippets implemented in two popular programming languages: Java and Python”
    • Also stated in: § 3.2 Constructing Benchmark Dataset · plain
      “we successfully collected 2,033 programming tasks from LeetCode”
    Quote in the paperSubstantial claim
  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Findingown data

    The 2,033 tasks comprised 501 easy, 1,064 medium, and 468 hard tasks.

    “out of the 2,033 tasks in our dataset, we found that 501 were classiied as easy, 1,064 as medium, and 468 as hard”
    Quote in the paperNot a substantial claim
    • Rests on an assumption: LeetCode's difficulty labels accurately reflect the difficulty of programming tasks.
  • May combine two claims.

    Findingown data

    Among ChatGPT-generated code that passed test cases, 53% of Java code and 37% of Python code had code style and maintainability issues.

    “among ChatGPT-generated code that passed the test cases, 53% of the Java code and 37% of the Python code exhibited code style and maintainability issues”
    Quote in the paperSubstantial claim
  • May combine two claims.

    Findingown data

    ChatGPT solved more than half of hard-level tasks before June 2021, but its performance dropped to nearly 0.1 for later periods.

    “ChatGPT can solve more than half of the hard-level code tasks before June 2021, but its performance reduces drastically to nearly 0.1 for the subsequent time periods”
    Quote in the paperSubstantial claim
  • May combine two claims.

    Findingown data

    For Java, ChatGPT's pass@1 accuracy was 0.860 on easy tasks, 0.710 on medium tasks, and 0.468 on hard tasks.

    “for Java, the model attains a pass@1 accuracy of 0.860 for easy tasks, 0.710 for medium tasks, and 0.468 for hard tasks”
    Quote in the paperSubstantial claim
    • Rests on an assumption: LeetCode's difficulty labels accurately reflect the difficulty of programming tasks.
  • May combine two claims. The quote only partly states this claim.

    Findingown data

    The percentage of clean code decreased as task difficulty increased for both Python and Java; for Java, it dropped from 54% for easy tasks to 45% for medium and 33% for hard tasks.

    “the percentage of clean Java code decreases from 54% for easy tasks to 45% for medium tasks, and further drops to 33% for hard tasks”
    Quote in the paperSubstantial claim
    • Rests on an assumption: LeetCode's difficulty labels accurately reflect the difficulty of programming tasks.
  • May combine two claims.

    Findingown data

    The majority of generated code snippets were 10-20 lines for Python and 20-30 lines for Java.

    “the majority of generated code snippets falling into the 10-20 lines range for Python and the 20-30 lines range for Java”
    Quote in the paperNot a substantial claim
  • Probably not a substantial claim: may not pass S1 (asserted), S3 (load-bearing), S4 (based). The quote only partly states this claim.

    Findingown data

    The dataset contains more than 400 programming tasks introduced after 2021.

    “while most tasks are from before 2021, there are still more than 400 test cases for evaluating ChatGPT's code generation capabilities”
    Quote in the paperNot a substantial claim
  • May combine two claims.

    Findingown data

    The differences in pass rates by code length were statistically significant (p < 0.01) with a small to medium effect size.

    “the Mann-Whitney U test conirms the signiicance of the diferences (p-value < 0.01) with a small to medium efect size”
    Quote in the paperSubstantial claim
  • May combine two claims.

    Findingown data

    For easy Python tasks, 7 out of 501 generated snippets (1%) have compilation and runtime errors, while for hard Python tasks, 46 out of 468 (10%) have execution errors.

    “For example, 7 out of 501 generated code snippets (i.e., 1%) for easy Python tasks exhibit compilation and runtime errors, while the number of execution errors increases to 46 out of 468 (i.e., 10%) for hard Python tasks.”
    Quote in the paperNot a substantial claim
  • May combine two claims.

    Findingown data

    Although simple feedback may be better for some issues, iterative feedback with static analysis and runtime errors performs much better than simple feedback as iteration rounds progress.

    “Moreover, although our previous experiments indicated that simple feedback may be better for some issues, iterative feedback with static analysis and runtime errors performs much better than simple feedback as the iteration rounds progress.”
    Quote in the paperSubstantial claim
  • May combine two claims.

    Findingown data

    Wrong output and code style and maintainability issues are more prevalent and are the most common challenges in ChatGPT-generated code.

    “However, Wrong Output and Code Style & Maintainability issues are more prevalent and tend to be the most common challenges faced by the generated code.”
    Quote in the paperSubstantial claim
  • May combine two claims.

    Findingown data

    Illegal Index errors are prevalent in both languages, particularly Java; 45 of 97 compilation and runtime errors in Java (46.4%) are due to invalid index use.

    “We also notice that Illegal Index errors are quite prevalent in both languages, particularly in Java.In fact, out of the 97 compilation and runtime errors encountered in Java, 45 of them (46.4%) are attributed to using an invalid index.”
    Quote in the paperNot a substantial claim
  • May combine two claims.

    Findingreasoning

    Prompts with detailed feedback can effectively assist ChatGPT in self-repairing code quality issues, whereas ambiguous feedback may negatively impact ChatGPT's performance.

    “Finding 9: Prompts with detailed feedback can efectively assist ChatGPT in self-repairing code quality issues, whereas ambiguous feedback may have a negative impact on ChatGPT's performance.”
    Quote in the paperSubstantial claim
  • May combine two claims.

    Findingreasoning

    Feedback with static analysis and runtime errors is more effective in fixing code style and maintainability, while simple feedback performs better for the remaining quality issues in both Java and Python.

    “we observed that feedback with static analysis and runtime errors is more efective in ixing code style and maintainability while simple feedback performs better in the remaining quality issues in both Java and Python.”
    Quote in the paperSubstantial claim
  • May combine two claims.

    Findingown data

    For LeetCode Problem 746 with input [10,15,20], ChatGPT-generated code produced 25 instead of the expected 15 because the loop iterated one step too many and included the last step's cost.

    “However, the ChatGPT-generated code produces an output of 25.This error occurs because the loop iterates one step more than necessary, causing the last step's cost to be included in the calculation even when it should not be.”
    Quote in the paperNot a substantial claim
  • May combine two claims.

    Findingown data

    Of 1,310 code snippets that failed test cases, 14% have compilation and runtime errors, 83% wrong outputs, 4% performance or efficiency issues, and 52% code style and maintainability issues on top of functional errors.

    “Regarding the 1,310 code that failed test cases, 14% encounter compilation and runtime errors, 83% exhibit wrong outputs, 4% exhibit performance or eiciency issues, and notably, 52% exhibited issues related to code style and maintainability on top”
    Quote in the paperSubstantial claim
  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Findingown data

    Table 4 compares common compilation and runtime error categories in Java and Python programs, based on 80 Python and 97 Java programs with errors.

    “Table 4 presents a comparison of common compilation and runtime errors error categories in Java and Python programs (i.e., 80 Python and 97 Java programs with the errors).”
    Quote in the paperNot a substantial claim
  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Findingreasoning

    For LeetCode Problem 1982, ChatGPT-generated code caused a TIMEOUT due to inefficient loop control.

    “when using ChatGPT to solve LeetCode Problem 1982, titled “Find Array Given Subset Sums”, the compiler outputs a łTIMEOUT” error due to ineicient loop control within the generated code.”
    Quote in the paperNot a substantial claim
  • May combine two claims.

    Findingown data

    Performance stabilizes in later rounds, indicating potential upper bounds to iterative gains.

    “However, our results show performance stabilizing in later rounds, indicating potential upper bounds to iterative gains.”
    Quote in the paperSubstantial claim
  • May combine two claims.

    Findingown data

    Static analysis feedback works better for code style and maintainability issues, while simple feedback is more effective for addressing execution errors and wrong outputs.

    “For instance, static analysis feedback works better for code style and maintainability issues, while simple feedback is more efective for addressing execution errors and wrong outputs.”
    Quote in the paperSubstantial claim
  • May combine two claims.

    Findingown data

    The effectiveness of ChatGPT's self-mitigating capabilities depends on the type of feedback provided, the programming language, and the specific code quality issue.

    “Our results suggest that the efectiveness of ChatGPT's self-mitigating capabilities depends on the type of feedback provided, the programming language, and the speciic code quality issue.”
    Quote in the paperSubstantial claim
  • May combine two claims.

    Findingreasoning

    For errors related to wrong outputs or efficiency, simpler prompts worked better in single-round feedback, likely because compiler feedback might be ambiguous or unhelpful.

    “However, for errors related to wrong outputs or eiciency, simpler prompts worked better in single-round feedback, likely because the prompts collected from the compiler feedback might be ambiguous or unhelpful.”
    Quote in the paperSubstantial claim
  • May combine two claims.

    Findingown data

    Static feedback and runtime errors supplied detailed information and resulted in a correct fix at line 41, changing a for-loop to a foreach-loop.

    “Static feedback and runtime errors, on the other hand, provide detailed information, i.e., leading to a correct ix in line 41 which change the for-loop to foreach-loop.”
    Quote in the paperNot a substantial claim
  • May combine two claims.

    Findingown data

    Code produced by ChatGPT frequently has quality problems, including compilation and runtime errors, incorrect outputs, maintainability issues, and performance inefficiencies.

    “Our indings demonstrate that while ChatGPT can generate functional code for various programming tasks, the generated code often sufers from quality issues, such as compilation and errors, wrong outputs, maintainability problems, and performance ineiciencies.”
    • Also stated in: § Additional information · hedged
      “However, the generated code sometimes sufers from diferent code quality issues, such as execution errors, wrong outputs, and maintainability problems.”
    Quote in the paperSubstantial claim
  • Probably not a substantial claim: may not pass S3 (load-bearing). May combine two claims.

    Premisecitation

    The ChatGPT model used was ChatGPT-March-23, trained on data up to 2021.

    “we used the ChatGPT-March-23 version [41], which was trained on data up to 2021”
    Quote in the paperNot a substantial claim0 of 1 sources checked
    • cites [41]

      Not checked in the free run.

  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Interpretationreasoning

    The difference in code length distributions between Python and Java reflects differences in verbosity and structure between the two languages.

    “This discrepancy highlights the diferences in verbosity and structure between the two programming languages”
    Quote in the paperNot a substantial claim
  • May combine two claims.

    Premisecitation

    Code quality issues in ChatGPT-generated code can affect code comprehension, introduce bugs, or create security vulnerabilities.

    “Code quality issues in ChatGPT-generated code, if not properly identiied and addressed, may unduly afect code comprehension, introduce bugs, or create security vulnerabilities in users' projects [47].”
    Quote in the paperSubstantial claim0 of 1 sources checked
    • cites [47]

      Not checked in the free run.

  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Interpretationreasoning

    The inverse relationship between code length and pass rate may be due to increased complexity and more interactions between code elements as code size grows.

    “This could be due to the increased complexity, and the greater number of potential interactions between code elements as the code size grows”
    Quote in the paperNot a substantial claim
  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Study design and conductcitation

    In the static analysis, messages related to style issues such as whitespace, newline, and invalid naming conventions were ignored to reduce false positives, consistent with prior work.

    “we choose to ignore messages related to style issues such as whitespace, newline, and invalid naming conventions, which is consistent with the approach taken in prior work [48]”
    Quote in the paperNot a substantial claim0 of 1 sources checked
    • cites [48] source

      Not checked in the free run.

  • Classified as probably not a substantial claim. May combine two claims.

    Study design and conductnone given

    To mitigate randomness, ChatGPT was made deterministic by setting temperature to 0 and running the model once per task, using the first generated output for evaluation.

    “To mitigate the randomness of ChatGPT, we make ChatGPT deterministic by setting the temperature to 0 and running the model once for each task, using the irst generated output for evaluation.”
    Quote in the paperSubstantial claim
  • May combine two claims.

    Interpretationreasoning

    Simple feedback is general, so ChatGPT is sometimes misguided, resulting in new problems while plausibly solving original issues.

    “This is because simple feedback is quite general so ChatGPT is sometimes misguided, resulting in introducing new problems though plausibly solving the original issues.”
    Quote in the paperSubstantial claim
  • May combine two claims.

    Interpretationown data

    Compilation and runtime errors and performance and efficiency issues are relatively less frequent in ChatGPT-generated code, indicating ChatGPT is generally successful in generating syntactically correct and efficient code.

    “From the table, it is evident that Compilation & Runtime Errors and Performance & Eiciency issues are relatively less frequent, indicating that ChatGPT is generally successful in generating syntactically correct and eicient code.”
    Quote in the paperSubstantial claim
  • Classified as probably not a substantial claim.

    Interpretationreasoning

    The introduction of noise by static analysis and runtime error feedback can confuse ChatGPT and lead to incorrect patches.

    “This is possibly due to the introduction of noise by static analysis and runtime error feedback, which can confuse ChatGPT and lead to incorrect patches.”
    Quote in the paperSubstantial claim
  • May combine two claims.

    Interpretationreasoning

    The probabilistic nature of ChatGPT, which predicts subsequent tokens from preceding ones, enables it to understand common program semantics but captures semantics implicitly from training data, leading to misunderstandings and semantically-related compilation and runtime errors.

    “These observations can be explained by the probabilistic nature of the ChatGPT model, which predicts subsequent tokens based on preceding ones.This nature enables ChatGPT to understand the semantics of common programs that appear frequently in the training set.However, the model captures the semantics implicitly from the training data, leading to misunderstandings of program semantics and subs”
    Quote in the paperSubstantial claim
    • Rests on an assumption: ChatGPT is a probabilistic model that predicts subsequent tokens based on preceding ones.
  • Probably not a substantial claim: may not pass S3 (load-bearing). May combine two claims.

    Interpretationreasoning

    Python's dynamic typing system allows more flexibility in variable types but can lead to unexpected type-related issues at runtime.

    “This observation could be due to Python's dynamic typing system, which allows for more lexibility in variable types, but can also lead to unexpected type-related issues at runtime.”
    Quote in the paperNot a substantial claim
    • Rests on an assumption: Python's dynamic typing system allows more flexibility in variable types but can lead to unexpected type-related issues at runtime.
  • Classified as probably not a substantial claim.

    Study design and conductreasoning

    To make the iterative repairing experiment more rigorous, the authors used only 402 new LeetCode test examples published in 2022, after GPT-3.5's pretraining knowledge cutoff.

    “To make the experiment more rigorous, we only use the 402 new test examples from LeetCode that were published in the year 2022 (after GPT-3.5'spre-training knowledge cutof).”
    Quote in the paperSubstantial claim
    • Rests on an assumption: GPT-3.5's pretraining knowledge cutoff occurred before the year 2022.
  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Interpretationown data

    The study's dataset of 2,033 programming tasks from LeetCode may not represent all possible code generation tasks encountered in real-world software development.

    “Our study is based on a dataset of 2,033 programming tasks from LeetCode, which may not represent all possible code generation tasks encountered in real-world software development.”
    Quote in the paperNot a substantial claim
  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Premisecitation

    There is a large number of studies investigating code quality issues from human-written code.

    “There is a large number of studies investigating code quality issues from humanwritten code.”
    Quote in the paperNot a substantial claim
  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Premisecitation

    Keuning et al. investigated code quality issues in student programs.

    “Keuning et al. [26] investigate code quality issues in student programs.”
    Quote in the paperNot a substantial claim0 of 1 sources checked
    • cites Keuning et al. [26]

      Not checked in the free run.

  • Classified as probably not a substantial claim. May combine two claims.

    Study design and conductcitation

    To address variability in ChatGPT-generated code due to different prompts, the authors followed a similar methodology used by Fan et al. and Tian et al., using a consistent set of prompts across tasks.

    “To address this concern, we followed the similar methodology used by Fan et al. [15] and Tian et al. [55], which ensures that our results are reliable by using a consistent set of prompts across diferent tasks.”
    Quote in the paperSubstantial claim0 of 2 sources checked
    • cites Fan et al. [15]

      Not checked in the free run.

    • cites Tian et al. [55]

      Not checked in the free run.

  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Premisecitation

    Kochhar et al. conducted a large-scale empirical investigation on the code quality of open-source projects implemented in 17 programming languages.

    “Kochhar et al. [27] conducted a large-scale empirical investigation on the code quality of open-source projects implemented in 17 programming languages.”
    Quote in the paperNot a substantial claim0 of 1 sources checked
    • cites Kochhar et al. [27]

      Not checked in the free run.

  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Premisecitation

    The quality of ChatGPT-generated code is a critical concern for top software companies when deciding whether to adopt it in practice.

    “However, the quality of the ChatGPT-generated code is the critical concern for top software companies when deciding whether to adopt it in practice or not [10,21,44].”
    Quote in the paperNot a substantial claim0 of 3 sources checked
    • cites [10]

      Not checked in the free run.

    • cites [21]

      Not checked in the free run.

    • cites [44]

      Not checked in the free run.

  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Premisecitation

    Saboury et al. empirically investigated code smells in 537 releases of five popular JavaScript applications.

    “Saboury et al. [46] empirically investigate code smells in 537 releases of ive popular Javascript applications.”
    Quote in the paperNot a substantial claim0 of 1 sources checked
    • cites Saboury et al. [46]

      Not checked in the free run.

  • Probably not a substantial claim: may not pass S4 (based). May combine two claims.

    Interpretationnone given

    This paper is the first to systematically analyze and characterize code quality issues in ChatGPT-generated code and explore potential solutions to repair them.

    “Moreover, it is the irst to systematically analyze and characterize the code quality issues in ChatGPT-generated code and explore potential solutions to repair them.”
    Quote in the paperNot a substantial claim
  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Interpretationreasoning

    The incompleteness of the test suite could potentially result in missed program bugs.

    “A possible threat arises from the incompleteness of the test suite, which could potentially result in missed program bugs.”
    Quote in the paperNot a substantial claim
  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Study design and conductreasoning

    To eliminate potential bias in manual analysis and categorization, the authors conducted a sorting discussion among three annotators.

    “To eliminate the potential bias, we conducted a sorting discussion among three annotators.”
    Quote in the paperNot a substantial claim
  • May combine two claims.

    Interpretationown data

    Repeated interactions enable ChatGPT to refine its understanding, adjust based on user feedback, and converge towards more accurate solutions.

    “This evidence spotlights how repeated interactions enable ChatGPT to reine its understanding, adjust based on user feedback, and converge towards more accurate solutions.”
    Quote in the paperSubstantial claim
  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Interpretationown data

    The findings may not be directly applicable to programming languages other than Java and Python.

    “Additionally, we focus on Java and Python, two popular programming languages; however, our indings may not be directly applicable to other programming languages.”
    Quote in the paperNot a substantial claim
  • Probably not a substantial claim: may not pass S4 (based). May combine two claims.

    Study design and conductreasoning

    The original test suite from LeetCode is carefully designed and widely recognized, so the risk of missed bugs is minimal.

    “In our experiments, we use the original test suite from LeetCode, which is carefully designed and widely recognized.Thus, we believe this risk is minimal.”
    Quote in the paperNot a substantial claim
    • Rests on an assumption: The original LeetCode test suite is carefully designed and widely recognized.
  • May combine two claims.

    Study design and conductreasoning

    To minimize the non-deterministic nature of ChatGPT, the authors set the temperature parameter to 0, ensuring consistent outputs for the same input and reducing variability.

    “In addition, to minimize the non-deterministic nature of ChatGPT, we set the temperature parameter to 0 in our experiments.This approach ensures that ChatGPT produces consistent outputs for the same input, thereby reducing variability and enhancing the internal validity of our results.”
    Quote in the paperSubstantial claim
  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Study design and conductown data

    The authors released their analysis and categorization results for public verification.

    “We also release our analysis and categorization results for public veriication.”
    Quote in the paperNot a substantial claim
  • Probably not a substantial claim: may not pass S3 (load-bearing). May combine two claims.

    Study design and conductcitation

    To mitigate the risk of bugs in their code, the authors carefully checked their code and made it publicly available.

    “To mitigate this risk, we have carefully checked our code and made our code publicly available [4].”
    Quote in the paperNot a substantial claim0 of 1 sources checked
    • cites [4]

      Not checked in the free run.

  • Probably not a substantial claim: may not pass S4 (based).

    Interpretationnone given

    This paper is the first to conduct a time-sensitive evaluation of ChatGPT on a code generation task.

    “To the best of our knowledge, this paper is the irst to conduct a time-sensitive evaluation of ChatGPT on a code generation task.”
    Quote in the paperNot a substantial claim
  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Premisecitation

    Xia et al. observed that ChatGPT's performance in generating correct patches improves notably as the number of iterations increases, with significant improvement around three iterations.

    “Xia et al. [61] observed that ChatGPT's performance in generating correct patches improves notably as the number of iterations increases, with a signiicant improvement observed around three iterations.”
    Quote in the paperNot a substantial claim0 of 1 sources checked
    • cites Xia et al. [61]

      Not checked in the free run.

  • Probably not a substantial claim: may not pass S3 (load-bearing). May combine two claims.

    Premisecitation

    Fan et al. examined common bugs in Codex-generated code across 113 programming tasks and tested automated program repair tools on those mistakes.

    “Fan et al. [15] further analyze common bugs in code generated by Codex, the backend of Copilot, on 113 programming tasks and benchmark automated program repair tools on ixing the mistakes.”
    Quote in the paperNot a substantial claim0 of 1 sources checked
    • cites [15] source

      Not checked in the free run.

  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Premisecitation

    Gao et al. demonstrated that incorporating additional examples into the prompt could potentially enhance performance in bug fixing tasks.

    “For example, Gao et al. [18] demonstrated that incorporating additional examples into the prompt could potentially enhance performance in bug ixing tasks.”
    Quote in the paperNot a substantial claim0 of 1 sources checked
    • cites Gao et al. [18]

      Not checked in the free run.

  • Probably not a substantial claim: may not pass S4 (based).

    Interpretationreasoning

    A possible explanation for the lack of overlap is that Python and Java have distinct code styles and common practices.

    “The possible reason is that Python and Java have very diferent code styles and common practices.”
    Quote in the paperNot a substantial claim
  • May combine two claims.

    Premisecitation

    Nguyen et al. concentrate on correctness of AI-generated code, while Fan et al. aim to benchmark automated program repair tools for fixing mistakes.

    “Moreover, Nguyen et al. [37] focus on analyzing the correctness of AI-generated code while Fan et al. [15] target to benchmark automated program repair tools on ixing mistakes.”
    Quote in the paperNot a substantial claim0 of 2 sources checked
    • cites [37] source

      Not checked in the free run.

    • cites [15] source

      Not checked in the free run.

  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Premisecitation

    Ahmed et al. showed that in code summarization tasks, augmenting a prompt with explicit semantic facts can significantly improve performance.

    “Meanwhile, Ahmed et al. [1] showed that in code summarization tasks, augmenting a prompt with explicit semantic facts can signiicantly improve performance.”
    Quote in the paperNot a substantial claim0 of 1 sources checked
    • cites Ahmed et al. [1]

      Not checked in the free run.

  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Premisecitation

    Recent research highlights the crucial role of prompt engineering in enhancing the performance of large language models like ChatGPT for software engineering tasks.

    “Recent research highlights the crucial role of prompt engineering in enhancing the performance of large language models (LLMs) like ChatGPT for software engineering tasks [23].”
    Quote in the paperNot a substantial claim0 of 1 sources checked
    • cites [23]

      Not checked in the free run.

  • Probably not a substantial claim: may not pass S3 (load-bearing). May combine two claims.

    Premisecitation

    ChatGPT serves a much broader audience than Codex and GitHub Copilot, including novice programmers and non-coders, with about 1.6 billion visits in April 2023.

    “Unlike Codex and GitHub Copilot, which target experienced professional developers and programmers, ChatGPT caters to a much wider audience, with approximately 1.6 billion visits in April 2023 [49], including novice programmers and non-coders.”
    Quote in the paperNot a substantial claim0 of 1 sources checked
    • cites [49]

      Not checked in the free run.

  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Premisecitation

    Nguyen et al. assessed GitHub Copilot's performance on 33 programming tasks.

    “Nguyen et al. [37] evaluated the performance of Copilot on 33 programming tasks.”
    Quote in the paperNot a substantial claim0 of 1 sources checked
    • cites [37] source

      Not checked in the free run.

  • May combine two claims.

    Interpretationown data

    The quality of ChatGPT-generated code in both Python and Java is imperfect and can be improved.

    “The presence of these issues indicates that the code quality of ChatGPT-generated code for both Python and Java is not perfect and could be improved.”
    Quote in the paperSubstantial claim
65 of 65
  • The paper relies on this without support.

    No prior study formally investigates the reliability and quality of ChatGPT-generated code.

    “there exists no study that formally investigates the reliability and quality of code generated by ChatGPT”
  • The paper relies on this without support.

    This work is the first formal study of the reliability and quality of ChatGPT-generated code.

    “we are the irst to formally study the reliability and quality of ChatGPT-generated code”
  • The paper relies on this without support.

    LeetCode's difficulty labels accurately reflect the difficulty of programming tasks.

    “501 classiied as easy, 1,064 as medium, and 468 as hard”
  • The paper relies on this without support.

    Code quality issues are the most important concern because a single quality issue can lead to monetary and reputation costs.

    “Code quality issues are the most important concern, as one quality issue (aka.software defect) could lead to monetary and reputation costs.”
  • The paper relies on this without support.

    ChatGPT is a probabilistic model that predicts subsequent tokens based on preceding ones.

    “These observations can be explained by the probabilistic nature of the ChatGPT model, which predicts subsequent tokens based on preceding ones.”
  • The paper relies on this without support.

    Python's dynamic typing system allows more flexibility in variable types but can lead to unexpected type-related issues at runtime.

    “This observation could be due to Python's dynamic typing system, which allows for more lexibility in variable types, but can also lead to unexpected type-related issues at runtime.”
  • The paper relies on this without support.

    The original LeetCode test suite is carefully designed and widely recognized.

    “In our experiments, we use the original test suite from LeetCode, which is carefully designed and widely recognized.”
  • The paper relies on this without support.

    GPT-3.5's pretraining knowledge cutoff occurred before the year 2022.

    “we only use the 402 new test examples from LeetCode that were published in the year 2022 (after GPT-3.5'spre-training knowledge cutof).”
  • The paper relies on this without support.

    ChatGPT can learn from user interactions and improve its outputs based on feedback.

    “Unlike traditional code generation tools, ChatGPT has the potential to learn from user interactions and reine its outputs based on the feedback it receives.”
9 of 9

Claims other papers make about this one

Each is checked against this paper’s own text: does it say what the citing paper says it does?

Self-check

Percentages, sums and reported differences re-computed from the paper’s own numbers.

Each contradiction between two passages listed here was confirmed by an independent check.

  • Language is called a significant factor despite nonsignificant comparisons

    Major

    Finding 1 says programming language significantly affects performance, but the paper reports that the Python-Java performance difference is not statistically significant.

  • The iterative-repair tasks have conflicting release dates

    Minor

    The experiment says its 402 tasks were published during 2022, but its results describe the same 402 tasks as released after 2022.

  • The described route costs more than the stated expected output

    Minor

    For the stair example, the claimed route uses steps costing 10 and 20, which sum to 30, not 15.

    Reported 15 · recomputed 30

3 of 3

Cites

Flagged first, then by citations

Research works printed but not linked: 9

  1. Amazon. 2023. Amazon CodeWhisperer. Retrieved from https://aws.amazon.com/codewhisperer/
  2. Tom Copeland. 2005. PMD applied. Vol. 10. Centennial Books San Francisco.
  3. Ian Cordasco and Tarek Ziade. 2010. Flake8: Your tool for style guide enforcement. Programa De Computador (2010).
  4. Shuzheng Gao, Xin-Cheng Wen, Cuiyun Gao, Wenxuan Wang, and Michael R. Lyu. 2023. Constructing effective in-context demonstration for code intelligence tasks: An empirical study. arXiv preprint arXiv:2304.07575 (2023). · arXiv
  5. LeetCode. 2023. 1093. Statistics from a Large Sample. Retrieved from https://leetcode.com/problems/statistics-from-a-large-sample/description/
  6. Carlini Nicholas, Ippolito Daphne, Jagielski Matthew, Lee Katherine, Tramer Florian, and Zhang Chiyuan. 2023. Quantifying memorization across neural language models. In 11th International Conference on Learning Representations. 70–80.
  7. Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, Ilya Sutskever, et al. 2019. Language models are unsupervised multitask learners. OpenAI Blog 1, 8 (2019), 9.
  8. SimilarWeb. 2023. ChatGPT’s Traffic Overview. Retrieved from https://www.similarweb.com/website/chat.openai.com
  9. Donna Spencer. 2009. Card Sorting: Designing Usable Categories. Rosenfeld Media.

Cited by

Sorted by citations

Authors
Liu, Y., Le-Cong, T., Widyasari, R., Tantithamthavorn, C., Li, L., Le, X.-B. D., & Lo, D.
Affiliations
  • Monash University (AU)
  • The University of Melbourne (AU)
  • Singapore Management University (SG)
  • Beihang University (CN)
Venue
ACM Transactions on Software Engineering and Methodology
Published
2024-06-04
Volume
33
Issue
5
Pages
1-26
ISSN
  • 1049-331X (ISSN-L)
  • 1557-7392
OpenAlex
W4391282616
Cited by
149
References
43
Citations by year
2026: 36 · 2025: 75 · 2024: 37 · 2023: 1
FWCI
55.65
Type
journal article
Language
en
Open access
Locations
  • ACM Transactions on Software Engineering and Methodology (publishedVersion)
  • arXiv (Cornell University) (submittedVersion)
  • Singapore Management University Institutional Knowledge (InK) (Singapore Management University) (submittedVersion, cc-by-nc-nd)
  • Adelaide Research & Scholarship (AR&S) (University of Adelaide) (submittedVersion)
  • arXiv (Cornell University)
Funders
  • National Research Foundation (NRF-NRFI08-2022-0002)
  • Australian Research Council’s Discovery Early Career Researcher Award (DE200100941)
  • Australian Government through the Australian Research Council’s Discovery Early Career Researcher Award (DE220101057)
Topics
  • Physical Sciences › Computer Science › Information Systems › Software Engineering Research
  • Physical Sciences › Computer Science › Software › Software Testing and Debugging Techniques
  • Physical Sciences › Computer Science › Computer Science Applications › Teaching and Learning Programming
Keywords
ChatGPT, large language models, code generation, code quality, program correctness, static analysis, software maintainability, code style, self-healing, Java, Python, compilation errors, runtime errors, task difficulty

About these checks

Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.

Claims read by deepseek-v4.1-flash under definition version 3 (extract-v3) on 2026-10-07.

Classified by jev-1.13-20260917 (gold-guideline-v0.2) on 2026-10-07.

Statistics and arithmetic are recomputed, not judged.

Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.

What counts as a claim ›How we measure confidence ›How we check this ›

Are you an author, or do you see a problem with this page? Request a review