Elamur Research

An Analysis of the Automatic Bug Fixing Performance of ChatGPT

Paper · 2023 · Dominik Sobania, Martin Briesch, Carol Hanna et al.

Summary

A suggested software repair can look convincing while leaving the original defect untouched. It can also correct the intended mistake and introduce another error elsewhere. This paper asks how well ChatGPT handles that distinction: can it identify and repair faulty code, rather than merely produce plausible advice or a different implementation? The authors study this question using QuixBugs, a benchmark of small programming problems with deliberately faulty implementations. They evaluate the Python problems, compare their findings with published results for other repair approaches, and investigate whether a short conversation improves the outcome. The practical motivation is straightforward. Developers need help correcting programs, but an assistant saves effort only when its suggestions survive careful checking.

The initial experiment uses all 40 Python problems in QuixBugs. For each problem, the authors remove comments, supply the faulty source code, and ask whether it contains a defect and how to repair it. They submit four independent requests per problem and manually assess the responses. A problem counts as repaired if a correct answer appears in at least one run. Their definition of correctness is demanding: the response must address the defect introduced in the benchmark, and its suggested changes must not create another error that prevents proper execution. A working replacement implementation does not automatically qualify. Under this procedure, ChatGPT repairs 19 problems. Published results report 21 for Codex, 19 for CoCoNut under the authors’ patch-ranking restriction, and 7 for the collection of conventional repair approaches used in the comparison.

The headline comparison therefore supports a limited but meaningful conclusion. On these compact benchmark programs, ChatGPT can compete with dedicated learning-based repair and with Codex, despite receiving only the faulty code in the initial request. It performs better than the conventional approaches represented by the selected literature results. That finding does not establish a universal ranking of repair systems. The baselines come from earlier studies, the counted ChatGPT result allows success across repeated requests, and the benchmark contains small Python programs. The authors also emphasize that passing an available test suite is weaker evidence than fixing the underlying problem. Their comparison uses generalizing repairs for the conventional approaches instead of accepting every patch that passes the supplied tests.

The conversational experiment supplies the paper’s other central result. When an initial response is unsuccessful, the authors provide a concrete failure: an input with its expected output, or an input with the error it produces. The follow-up procedure permits a single hint. The reported overall coverage then reaches 31 of the 40 problems, expressed in the conclusion as 77.5%. That total needs careful interpretation. Among previously unresolved problems, 9 benefit from the additional explanation, while 3 receive a correct response to a fresh initial request without needing the hint. The overall result demonstrates the value of the broader interaction procedure, but it does not attribute every newly solved problem exclusively to feedback.

The paper also examines what failure looks like. ChatGPT often asks for further information or says that the code appears correct. Other responses discuss a different issue, repair the target defect while breaking something else, or offer a working replacement. These observations make the study more useful than a score alone. They show why feedback can help, why repeated requests sometimes matter, and why verification remains necessary. The authors leave an important engineering question open: whether the effort required to inspect the answers outweighs the help they provide. They propose automated feedback and automated checking as promising directions, without demonstrating a fully autonomous repair workflow.

Interesting ideas

Evidence before explanation. A concrete failing input gives a repair assistant an observable discrepancy to resolve. Source code alone can leave the intended behavior unclear, especially when the implementation looks familiar or almost correct. An input paired with an expected result, or with an actual error, narrows that uncertainty. The conversational experiment shows that this additional evidence can help ChatGPT address problems that its initial response did not solve. The reusable idea extends beyond programming: when a system gives an unhelpful answer, provide a compact counterexample that exposes the failure. Such evidence makes a follow-up more informative than a general instruction to reconsider, while also giving the eventual response something specific to satisfy.

Separate repair from replacement. A program that produces the desired outputs may still fail to demonstrate that the original defect was understood. The authors therefore distinguish a targeted correction from an alternative implementation. That distinction is useful whenever a task concerns an existing artifact whose structure matters. A developer may need to preserve surrounding behavior, maintain compatibility, or review a localized change. A researcher may instead be measuring whether a system identifies a particular mistake. Recording replacements separately preserves potentially useful suggestions without letting them answer a different research question. The important move is to define the desired kind of success before evaluating the outputs, instead of deciding afterward that every working result is equivalent.

Measure stability as well as coverage. The study repeats requests because a response to the same problem can vary. A problem solved somewhere among repeated attempts is different from a problem solved reliably whenever it is presented. The authors retain this distinction by recording successful runs as well as overall problem coverage. Engineers can reuse that approach when evaluating any assistant whose outputs are not stable. Coverage reveals which tasks appear reachable; consistency indicates how much repetition and checking a user may need. Reporting only the best observed answer hides that practical burden. Reporting only a single attempt can conceal useful capability. Both views matter, provided their conditions remain explicit.

Classify failures by the next action they suggest. The response categories distinguish requests for missing information, incorrect reassurance, irrelevant repairs, new defects, and replacements. These outcomes call for different interventions. A request for more context suggests supplying evidence. A proposed correction that creates another problem suggests checking the entire change. An alternative implementation raises a question about whether replacement is acceptable. This makes the classification useful as a workflow design tool, not merely a descriptive appendix. Similar categories could guide evaluation of editing assistants, diagnostic systems, or other tools that modify existing material. A single failure label would obscure which part of the interaction needs improvement.

Preserve the source of each success. The follow-up study records whether a previously unresolved problem is solved immediately in a new run or only after additional information. That detail protects the interpretation of the result. Without it, improvement might be credited entirely to the intervention even when fresh sampling also contributes. The same principle applies to systems that combine retries, retrieval, human feedback, and external checks. Keep enough records to tell which conditions preceded a successful result. Those records do not automatically establish causality, but they prevent a combined workflow score from being mistaken for the isolated effect of a particular component.

Treat verification as part of the product. The authors’ concern about the effort of checking answers is an engineering question that survives every encouraging repair count. A useful assistant must reduce the work needed to obtain a dependable change, rather than simply generate more candidate changes. The paper motivates placing test execution, failure evidence, and patch inspection alongside generation. It does not implement that complete arrangement, but the design lesson is concrete: evaluate the path from faulty program to accepted correction. This applies wherever generated artifacts need external validation. Fluency and apparent relevance can help a user understand a proposal; they cannot establish that the proposal meets the task’s requirements.

Deep dive: An Analysis of the Automatic Bug Fixing Performance of ChatGPT

How ChatGPT repaired QuixBugs programs, why feedback improved its results, and what the study establishes about automatic bug fixing. · about 36 minutes to read

How Mova uses it

For Mova, the small transparent language system in Rust, the most useful connection is a way to organize evidence and decisions. The paper supplies no account of a Mova implementation, so it cannot establish that Mova already repairs code, runs test suites, or supports the same conversational procedure. Its contribution here is a set of possible design choices. A transparent system could make the relationship between a reported failure, a proposed change, and the evidence for accepting that change explicit. That would borrow the study’s strongest practical lesson without claiming that Mova shares ChatGPT’s measured repair capability.

A possible Mova workflow would preserve the faulty program and the observations associated with it. A user’s expected output would remain distinguishable from an observed error message, and both would remain distinguishable from an assistant’s explanation. This separation matters because each item has a different evidential role. An expected result states a requirement; an error message records behavior; an explanation proposes an interpretation. The dialogue experiment shows why adding behavioral information can improve a repair interaction. For a transparent system, the corresponding opportunity is to expose what new evidence entered the conversation and which subsequent proposal responded to it.

The response classification also offers a practical vocabulary for Mova. A system could distinguish an unresolved request for context from a claim that no defect exists. It could separately mark a targeted correction, a replacement implementation, and a change whose execution reveals another failure. These would be proposed workflow states, not demonstrated Mova features. Their value would be to prevent an interface from presenting every code-containing answer as an equally complete repair. A user could then see whether the system is asking a question, suggesting a candidate, or reporting that some independent check has succeeded.

The distinction between correction and replacement fits the transparency goal particularly well. If Mova were used to assist with code, it could show the proposed edit alongside the original and indicate whether the change addresses a localized defect or rewrites the implementation. The paper gives a reason to retain that distinction: its evaluation rejects some working alternatives because they do not identify the intended mistake. Mova would not need to adopt that criterion for every application. It could instead make the criterion visible, allowing an evaluation or a developer to decide whether preserving the existing implementation is part of the task.

Rust is part of Mova’s description, but it is not a language tested in this study. The reported repair results concern Python programs from QuixBugs. They therefore provide no measured expectation for Rust repair, for Mova’s own source code, or for a different language-processing architecture. A responsible use of the paper would borrow the evaluation procedure before borrowing its performance claims: define the target defect, retain independent attempts, supply explicit failure evidence when appropriate, and check whether additional changes damage behavior. Any claim about Mova’s effectiveness would require observations from Mova itself.

The most concrete research direction is therefore an inspectable repair conversation whose proposals remain provisional until checked. Mova could potentially record how an answer changes after a failing example, retain unsuccessful suggestions for analysis, and distinguish repeated-request success from feedback-dependent success. The paper motivates these possibilities but does not demonstrate them for Mova. It also supplies a useful stopping question for such a project: does the whole interaction reduce the user’s verification effort? A transparent record would help investigate that question, while making clear which parts of the process are observed behavior and which remain suggestions.

The problem and its context

Software repair begins with a gap between what a program does and what it should do. Detecting that gap is already difficult; finding a change that closes it without damaging other behavior is another problem. The paper places its study within code and programming languages, focusing on automated program repair, commonly abbreviated APR. An APR system proposes modifications to faulty software. The intended benefit is to support developers who would otherwise need to locate the cause and construct a correction themselves. The authors motivate this work through the consequences of unresolved defects, including software failures and associated economic costs.

The earlier repair approaches described in the paper fall into broad methodological families. Generate-and-validate methods explore candidate edits and check the resulting programs. Their search strategy determines which changes to try, while their validation procedure decides whether a candidate appears acceptable. Semantics-driven approaches instead formulate requirements that a constraint solver uses to construct a repair. The distinction concerns how a candidate is obtained: searching among modifications or synthesizing a change from constraints. In either case, producing a candidate is only part of the task. The method still needs some representation of what the corrected program should do.

Tests frequently supply that representation. A test gives an input and an expected behavior, allowing a candidate program to be checked automatically. This is powerful because it converts part of the repair decision into an executable procedure. It is also incomplete because a finite test suite may leave important behavior unspecified. A patch can satisfy the checked cases and fail elsewhere. The paper returns to this issue when comparing conventional repair results: the number of programs with test-passing patches exceeds the number counted as genuinely repaired. The authors use that discrepancy to explain why benchmark success depends on the chosen definition of correctness.

The paper describes validation cost as another difficulty for conventional repair. Search-based systems may repeatedly execute tests as they investigate edits, while synthesis-based systems rely on solver calls. Both can require substantial computation. The authors characterize typical repair tools as taking hours before producing a viable patch. Their discussion of industrial use includes an approach based on genetic improvement, in which emerging defects are tracked during a workday and candidate corrections are sought overnight. That example establishes a practical setting for automated repair: suggestions can be useful even when they arrive for later developer review, but the delay and review burden remain part of the workflow.

Learning-based repair offers a different route to candidate generation. As described by the authors, such methods learn patterns from existing examples of faulty and corrected code. They frame repair as a translation-like task, mapping an erroneous program fragment towards a corrected one. The output may be a ranked collection of possible patches. This replaces explicit exploration of software edits with learned generation, but it does not remove the need for checking. The paper notes that generated patches are not necessarily tested automatically and may fail even to compile. A strong candidate-generation mechanism and a strong acceptance procedure are separate capabilities.

This background makes the ranking of candidate patches important. A system that places the correct edit first presents a different practical situation from one that includes it far down a long list. Both may contain the desired answer somewhere, but the work required to find and validate that answer can differ substantially. The authors account for this when selecting results from CoCoNut. They count a repair only when the correct patch occupies the leading position in its reported ranking. That restriction makes the comparison more relevant to what a user might receive immediately, while also limiting which published results can be used.

The paper then turns to broad language systems that can process source code. It names CodeBERT, PyMT5, and Codex as examples in this line of work and relates them to the Transformer and attention architecture. The key shift is that a system developed for language and code can also be asked to suggest a correction. It need not be designed exclusively as a repair tool. The authors treat this as an empirical opportunity rather than assuming that general coding ability guarantees reliable debugging. Generating plausible source code and identifying the actual cause of an existing program’s failure are related but distinct tasks.

ChatGPT adds an interaction pattern that is central to the study. As a chatbot, it can respond within an ongoing exchange, taking previous messages into account. A developer can present code, receive a question or suggestion, and supply further observations. That capability changes the repair interface. The user is no longer limited to a single static request or an initial test suite. The conversation can progressively make the intended behavior clearer. The paper investigates whether that possibility produces useful repairs, instead of treating dialogue merely as a convenient way to submit code.

There is an important ambiguity in an initial debugging request. A source fragment may reveal the implementation but provide only indirect clues about its intended function. Familiar names and conventional algorithm structures can help, yet they do not fully specify requirements. Conversely, a test suite specifies particular observations but may not capture the whole intended behavior. The authors argue that both textual descriptions and tests can be ambiguous or misleading. Dialogue offers a way to add evidence when the initial description is insufficient. The experiments test a modest version of that idea through brief follow-ups, rather than an unrestricted collaboration with a developer.

QuixBugs is chosen because its programs are compact enough to discuss directly while remaining challenging for repair approaches. That choice supports the immediate research question: can ChatGPT recognize and correct defects in manageable source fragments? It also sets the boundary of the study. The experiment does not ask the system to investigate an unfamiliar repository, identify relevant files, reconstruct a build environment, or maintain a large application. The context is deliberately narrower. Understanding that scope makes the findings easier to use: they concern repair suggestions for small, already selected faulty programs, with an additional investigation of how concrete feedback changes the interaction.

The method, step by step

Prepare a task that can be judged

The study begins with the Python portion of QuixBugs. Each benchmark problem supplies an erroneous implementation, and the evaluation concerns the defect associated with that implementation. The authors use the entire collection of 40 Python problems rather than selecting only examples that appear suitable for ChatGPT. This choice gives the repair count a defined denominator and keeps the comparison tied to a recognized benchmark. It also means that an unsuccessful response remains part of the result even when the system asks for information that the initial request does not provide.

Before submitting the code, the authors remove its comments. This is a substantive data-preparation decision. Some comments contain information that would disclose the correction, so leaving them in place could make the task easier for reasons unrelated to inspecting the faulty implementation. Removing them reduces that source of leakage. At the same time, it removes potentially useful descriptions of intended behavior. The resulting task asks how much the assistant can infer from the source code and the generic debugging request. The later feedback experiment then examines what happens when selected behavioral information is supplied explicitly.

The request format remains fixed across benchmark problems. It asks the assistant to determine whether the program contains an error and explain the correction, then presents the uncommented code after a blank line. The authors do not attach a failing input, a test result, or a detailed behavioral specification to this initial request. Standardizing the wording reduces variation introduced by the evaluator’s phrasing. It also establishes a clear baseline condition: any successful initial response must work from the erroneous source fragment and the general request for repair.

Evaluating code repair and feedback

The steps in order.

Evaluating code repair and feedbackStep 1: Select faulty QuixBugs Python programs1. Select faulty QuixBugs Python programsStep 2: Remove comments that could reveal repairs2. Remove comments that could reveal repairsStep 3: Submit standardized independent repair requests3. Submit standardized independent repair requestsStep 4: Inspect corrections for targeted correctness4. Inspect corrections for targeted correctnessStep 5: Compare coverage with published baselines5. Compare coverage with published baselinesStep 6: Give unresolved cases a concrete failure6. Give unresolved cases a concrete failureStep 7: Inspect follow-up repairs and classify responses7. Inspect follow-up repairs and classify responses

Repeat requests without turning them into dialogue

For each problem, the authors make four independent requests. Independence matters here because the initial comparison is not a conversation in which one attempt learns from a previous failure. Each request is a fresh opportunity to inspect the same faulty program. The repeated procedure accounts for the variability the authors expect from ChatGPT. It allows them to observe whether a defect is consistently repaired, occasionally repaired, or never repaired under that request format.

The main coverage measure counts a benchmark problem as solved when a correct response occurs in at least one of those runs. The study also records how many runs succeed for each problem. These are complementary observations. The coverage measure describes the set of problems reachable through the permitted attempts. The successful-run count describes repeatability within that procedure. Neither should be silently substituted for the other. A reader interested in a single immediate suggestion needs to know that the reported coverage permits repeated independent requests.

The initial experiment uses ChatGPT versions associated with December 15, 2022 and January 9, 2023. The authors identify these versions because the service changes during the study. This detail is part of the experimental setup, not incidental chronology. If the underlying service changes, the same visible request may no longer yield comparable behavior. The paper reports that observed repairability was similar around the update, while acknowledging that version changes could still affect the findings. It does not provide a controlled experiment isolating the update’s contribution.

Decide what counts as a repair

The authors inspect responses manually. A qualifying answer may contain the corrected program or a precise description of the necessary source change. Requiring a particular output format would exclude an exact textual correction even when it gives the developer everything needed. The evaluation therefore focuses on the substance of the proposed change. The answer must identify and correct the intended benchmark defect, and its additional edits must not prevent the resulting program from working properly.

The bitcount example makes this criterion concrete. The faulty implementation contains n ^= n - 1, whereas the intended correction uses n &= n - 1. The relevant distinction is between the assignment operation using exclusive OR and the assignment operation using AND. A response that identifies that edit addresses the benchmark’s defect directly. A fresh implementation that counts bits through another strategy may produce useful code, but it does not necessarily demonstrate recognition of the mistake in the supplied program. The paper treats those outcomes differently.

The rule also rejects a response that fixes the targeted defect while adding a harmful change elsewhere. This prevents an evaluation from accepting a locally correct observation when the complete proposed patch is unusable. It is especially relevant when an assistant returns an entire rewritten function rather than a minimal edit. More output creates more places where behavior can change. The authors’ classification retains such responses as a distinct type of failure, preserving the information that the target issue was recognized without treating the whole answer as a successful repair.

The paper does not introduce a mathematical repair objective, a training loss, or a new optimization algorithm. Its method is an empirical protocol: prepare inputs, submit requests, assess proposed changes, and compare outcomes. There is consequently no formal equation that needs to be reconstructed to explain the experiment. Nor do the authors train a new repair system or describe a task-specific training dataset for ChatGPT. The experimental data procedure concerns the benchmark inputs and the recorded interactions. The authors state that their conversations and other experimental materials are publicly available.

Construct the literature comparison

The conventional APR comparison uses a comprehensive earlier study of QuixBugs. That study reports results for approaches including Arja, Cardumen, Dynamoth, and JGenProg. The full comparison draws on ten conventional methods. The ChatGPT paper imports the earlier study’s correctness judgments instead of rerunning each tool. This makes the comparison feasible and grounds it in existing repair research, but it also means that not every experimental condition is controlled within a common execution environment.

For CoCoNut, the authors use published results with sufficient detail about patch rankings. They accept only instances where the correct patch is ranked first. The paper explains that this reporting detail guided the selection, even though more recent approaches existed. This is an important methodological tradeoff. Choosing a newer headline result without knowing where correct patches appear would obscure the effort required to reach them. Choosing a study with detailed rankings supports a more specific comparison, at the cost of leaving some later repair techniques outside the evaluation.

Codex results likewise come from a separate published QuixBugs evaluation. The paper compares the reported number of repaired problems instead of conducting a new shared experiment between Codex and ChatGPT. The resulting comparison answers whether ChatGPT’s observed coverage is competitive with these selected literature results. It is less suited to deciding how the systems would rank under identical query budgets, identical access to behavioral evidence, or identical automated checking. Those distinctions do not invalidate the comparison, but they define the kind of conclusion it can support.

Add a bounded follow-up

The dialogue study begins from an unsuccessful initial answer. The authors then give a short, standardized message explaining that the function fails and supplying a concrete example. When the defect produces a wrong value, the hint includes an input and the result that should be returned. When execution produces an error, the hint provides the input and the error message. A more elaborate call format is used when the input is difficult to express simply. These alternatives serve the same purpose: making the failure observable.

The systematic procedure permits a single such hint. This restriction separates it from an open-ended conversation in which the evaluator keeps assisting until a repair appears. It gives the study a bounded intervention that can be described and inspected. The follow-up experiment uses the January 9, 2023 version of ChatGPT. The paper also distinguishes cases where the new initial request already succeeds, so that a follow-up is unnecessary. That detail is essential when interpreting the final coverage: the broader procedure contains both renewed sampling and the addition of failure evidence.

Alongside the systematic experiment, the authors examine longer exchanges about gcd and bitcount. These examples help explain behavior that the aggregate repair count cannot show. They reveal how an initial request for context can lead to a useful correction, and how a conversation can also produce explanations or replacements that miss the specific defect. The qualitative examples are illustrations, not substitutes for the bounded follow-up procedure. Reading the two together gives a fuller account of the method: controlled request formats provide comparable outcomes, while inspected conversations show what happened within particular interactions.

Experiments and results

Initial repair coverage

The main evaluation uses the 40 Python programs in QuixBugs. ChatGPT receives four independent initial requests per program, and the reported coverage counts problems with a correct response in at least one run. Under the authors’ manual, targeted-repair criterion, ChatGPT repairs 19 problems. CoCoNut also has 19 qualifying repairs under the restriction that the correct patch must lead its ranking. Codex has 21 reported repairs. The conventional APR comparison contributes 7 repairs judged to generalize beyond the available tests. These are coverage counts, rather than measurements of speed, cost, or developer productivity.

QuixBugs Python problems with reported correct repairs

ChatGPT is competitive with the selected learning-based results and exceeds the conventional APR comparison.

QuixBugs Python problems with reported correct repairsConventional APR approaches: 7Conventional APR approaches7CoCoNut, correct patch ranked first: 19CoCoNut, correct patch ranked first19ChatGPT, success within independent requests (this paper): 19ChatGPT, success within independentrequests (this paper)19Codex: 21Codex21
The numbers
System or settingproblems repaired
Conventional APR approaches7
CoCoNut, correct patch ranked first19
ChatGPT, success within independent requests (this paper)19
Codex21

The equality between the ChatGPT and CoCoNut counts should not conceal the different routes to those counts. ChatGPT’s measure allows a correct response somewhere among its independent requests. CoCoNut’s measure restricts the accepted result by patch rank. Codex and conventional APR figures are adopted from their respective studies. The chart therefore summarizes the comparison the authors construct; it does not make those underlying procedures identical. Its strongest use is to show that the initial ChatGPT experiment reaches a level of benchmark coverage comparable with the selected learning-based references.

The conventional APR result requires an additional distinction. If the evaluation accepted every program variant that passed the supplied test suite, the earlier study would contribute 16 solved problems. The authors instead use 7 because those repairs are judged to work beyond the checked cases. This choice gives the comparison a stronger correctness requirement. It also illustrates a recurring problem in evaluation and benchmarks: the operational success criterion can change the apparent result substantially. Passing known tests is evidence about those tests, while a repair claim concerns the underlying program behavior.

The authors suggest that test-suite overfitting helps explain the gap between conventional approaches and language-based systems. That explanation is plausible within their discussion, but the experiment does not isolate it as a cause. The compared approaches differ in candidate generation, available prior information, and evaluation procedures. The result supports the observation that the selected conventional methods have lower generalizing repair coverage in the adopted literature results. It does not establish that a particular search strategy is responsible for every failure or that generated suggestions are immune to overfitting.

Coverage is accompanied by variability

Repeated requests produce an uneven pattern of success. The authors report that many solved problems receive a correct answer only in one or two runs. Bucketsort and flatten are the exceptions that succeed in all four runs. This observation is important because the headline count can otherwise suggest a more dependable interaction than the experiment demonstrates. A program can belong to the solved set while still frequently receiving an unsuccessful response. The paper therefore supports repeated querying as a potentially useful tactic, while also showing why a user cannot assume that the next response will reproduce a previous success.

The study does not provide a separate numerical measure of the human effort needed to exploit this variability. An evaluator who submits repeated requests must still identify which answer is correct. More attempts can increase the chance of seeing a useful repair, but they also create more material to inspect. This tradeoff matters especially when the successful response is mixed with incorrect reassurance or plausible but irrelevant edits. The results establish attainable benchmark coverage under the protocol. They do not establish that a developer can obtain those repairs with negligible review work.

The correctness criterion also shapes the observed coverage. Working replacement implementations are excluded when they fail to address the benchmark defect. So are answers that identify the right correction but introduce another harmful change. A looser usefulness measure could treat some of those responses more favorably, but it would answer a different question. The paper’s strict count measures targeted repair as the authors define it. Its qualitative discussion acknowledges that a rejected answer can still help a programmer understand or work around a problem.

Feedback improves the broader procedure

The follow-up study supplies failure evidence to unresolved cases and reports overall coverage of 31 problems. The conclusion gives this result as 77.5% of the benchmark. That is the paper’s strongest reported outcome, and it belongs to the interaction procedure with additional opportunities to respond. It should not be presented as the result of the initial code-only request or as a guaranteed success rate for arbitrary debugging tasks. Its conditions include the small Python benchmark, manual assessment, and the bounded provision of a concrete failure example.

QuixBugs Python coverage under the reported interaction procedures

The procedure that includes failure hints reaches broader coverage than the initial request experiment.

QuixBugs Python coverage under the reported interaction proceduresInitial independent-request procedure: 19Initial independent-request procedure19Overall procedure including follow-up hints (this paper): 31Overall procedure including follow-uphints (this paper)31
The numbers
System or settingproblems repaired
Initial independent-request procedure19
Overall procedure including follow-up hints (this paper)31

The paper gives the components needed to interpret this improvement. For 9 previously unresolved problems, the more detailed failure description helps obtain a correct repair. For 3, a fresh initial request succeeds before the hint is needed. The distinction prevents the final total from being read as a clean measurement of feedback alone. It remains evidence that the expanded procedure reaches more problems. Within that result, the authors separately identify cases associated with supplied failure information and cases associated with a newly successful initial response.

The additional information is concrete and limited. It does not directly state the source edit that should be made. Instead, it tells the assistant how the program’s observed behavior conflicts with the desired behavior, or reports an execution error. This is why the result is more informative than simply showing that an assistant can repeat a repair after being told the answer. The hint changes the available problem evidence. At the same time, selecting and checking that evidence involves human contribution, so the outcome belongs to a human-assisted repair process.

The response analysis explains the scores

The qualitative classification finds that requests for more information are the most frequent response type. Claims that the program contains no apparent defect come next. Less frequent categories include targeted corrections accompanied by new errors and working alternative implementations. The paper describes the ordering of these categories, but the available textual account does not give exact category totals. Their value here is explanatory: they show that an unsuccessful initial answer can arise from missing context, incorrect diagnosis, or an unsuitable modification, instead of a single uniform inability to write corrected code.

Taken together, the experiments establish competitive repair coverage and a useful role for failure feedback within this benchmark. They also reveal unstable outputs and several ways in which superficially helpful answers fail the repair criterion. The authors do not measure end-to-end development time, automated deployment, or performance on larger applications. The practical conclusion is therefore about a promising source of repair suggestions and a productive interaction pattern. Whether that combination becomes an efficient engineering tool depends on how suggestions are checked and how much work the surrounding process requires.

What the ablations show

The paper has no component-removal ablation study; it instead offers a feedback comparison, repeated-request observations, a response classification, and inspected conversations.

Concrete feedback and renewed sampling play different roles

The closest comparison to an ablation is the move from the initial request procedure to the follow-up procedure. The initial condition supplies faulty code and a generic repair request. The follow-up adds a specific behavioral failure. This comparison supports the idea that a code fragment may become easier to repair when the intended behavior is made more explicit. It is especially relevant to responses that initially ask for context or declare that no defect is visible. In those cases, the next message supplies evidence that the first interaction lacked.

The comparison is not a clean isolation of a single variable. Previously unresolved problems are presented in a new interaction, and some receive correct answers before the follow-up is used. The authors record this rather than treating all newly solved cases as hint-dependent. That accounting is a strength of the analysis. It shows why an improved overall result should be decomposed by the circumstances of success. A new attempt and a better specified problem are different interventions, even when both occur within the same broader experimental procedure.

The study also does not compare every hint type under matched conditions. Expected outputs, error messages, and more elaborate example calls are selected according to the failure being described. The results therefore show that this collection of useful behavioral evidence can support repair. They do not identify which format is generally best, how much detail is necessary, or whether a shorter message would achieve the same effect. Those questions remain open because the authors investigate a practical standardized follow-up instead of a systematic design space of feedback.

Repeated requests reveal reliability limits

The independent runs function as a stability analysis. Their purpose is to avoid treating a single answer as a complete description of the system’s ability. The uneven successful-run counts show that repairability under the prompt is not a simple fixed property of each problem. Some defects are reached intermittently. A user who receives an unsuccessful answer may obtain a useful correction from another request, but the study does not provide a rule for knowing in advance when repetition will help.

This analysis also changes how the benchmark score should be understood. The solved set records observed capability under multiple opportunities, while the run counts indicate that capability may be difficult to access consistently. Neither observation cancels the other. The paper provides evidence of real successful repairs, and it provides evidence that those repairs are often unstable across attempts. For evaluation design, the lesson is to retain both the final coverage and the path through which it was obtained.

Gcd illustrates useful diagnostic evidence

The gcd conversation begins with an unsuccessful response that asks for more information. The authors then supply a particular input and the recursion error produced by execution. The subsequent answer moves towards the relevant issue and provides a corrected program. This example gives a concrete interpretation of the feedback result: an error message can direct attention towards behavior that was not recognized from the code alone. The interaction does not merely request greater effort; it changes the evidence available for diagnosis.

The example remains qualitative. It demonstrates a successful conversation for that program, instead of establishing that recursion errors are always easy to repair or that error messages outperform other forms of feedback. Its role is explanatory. The reader can see a plausible connection between the newly supplied observation and the direction of the revised answer. That connection helps make sense of the aggregate improvement without requiring an unsupported claim about the system’s internal reasoning.

Bitcount separates assistance from targeted repair

The bitcount conversation is less straightforward. After the initial request for context, the authors first provide a description of the function’s purpose rather than the requested failing example. The next answer discusses testing. When the authors later describe a problematic input and a suspected infinite loop, ChatGPT supplies several candidate implementations. Some do not resolve the loop problem, while others work as replacements. The exchange shows continued relevance to the topic without consistently producing the localized correction required by the evaluation.

This matters because a useful-looking conversation can end in several different kinds of output. An explanation may guide testing. A replacement may offer a practical workaround. A candidate may remain faulty despite being accompanied by convincing commentary. The authors’ strict criterion separates these outcomes from identifying the faulty operation in the original implementation. The example therefore supports the classification’s purpose: evaluating repair requires attention to the actual proposed code changes, not merely whether the conversation appears to make progress.

The analyses explain behavior without exposing mechanism

The response categories and dialogue examples describe what the system says and proposes. They do not establish why a particular internal process produces a repair or a failure. The authors suggest that some replacements may reproduce familiar implementations, but the study does not trace the origin of generated code. Its evidential strength lies in observable behavior: what input was supplied, what answer followed, and whether the answer met the repair criterion. Keeping that boundary clear preserves the value of the analysis without turning plausible interpretation into demonstrated mechanism.

Limitations

Limits explicitly identified by the authors

The authors identify service changes as a threat to validity. ChatGPT is being updated during the study, and a major update occurs while the experiments are underway. Though the observed repairability appears similar around that change, the paper does not establish that the update has no effect. The reported outcomes belong to the service versions used in the experiment. A later service with the same public name could behave differently. This limits reproducibility through the interface alone, even when the benchmark programs and request wording are retained.

They also identify request wording as a possible influence. A pre-study varies the questions and reportedly finds no significant effect, but the paper does not present a detailed numerical comparison of those alternatives. The mitigation is therefore narrower than a broad claim of prompt insensitivity. The authors standardize the main requests and report that their preliminary variations did not reveal a major difference. Other formulations, more detailed task descriptions, or different styles of conversation could still alter the outcome.

Programming language, benchmark size, and the number of requests are further limits named in the paper. The authors choose a standard benchmark and focus on Python, but that choice cannot show how performance transfers to other languages or larger programs. Similarly, the repeated-request procedure is part of the measured setup. A workflow allowing fewer opportunities might have different coverage, while a more extensive interaction might behave differently again. The paper establishes results for its particular request budget rather than a universal property of the assistant.

Manual judgment is another explicitly stated threat. The authors determine whether responses address the intended defect and assign the response categories themselves. Some decisions are straightforward, such as whether the necessary operator change is identified. Others require interpretation, especially when a response combines explanation, partial correction, extra edits, and a new implementation. The authors make their conversations available so that others can inspect these judgments. That supports scrutiny, but it does not remove the subjective element from the evaluation.

The authors also leave the practical verification burden unresolved. They ask whether inspecting the answers may demand enough mental effort to outweigh the benefit. This is a substantial limit on the engineering conclusion. A system can produce correct repairs in a benchmark while still creating a difficult review task for its users. The paper proposes automated hints and automated verification as possible ways forward, but it does not measure their effectiveness or demonstrate a completed workflow combining them.

Limits visible in the experimental design

The benchmark provides small, already selected faulty programs. That setup removes many activities involved in software maintenance. The assistant does not have to discover which part of a large project is relevant, gather dispersed implementation context, or determine whether the reported behavior is actually a defect. These omissions are appropriate to the study’s focus, but they matter when applying its conclusion. Successful repair of a compact supplied function is evidence about that task. It is not evidence that the same procedure can resolve an issue requiring broad repository investigation.

The comparison with other systems is assembled from literature results. This supports a useful view of where the observed coverage sits relative to established approaches, but it leaves methodological differences in place. The systems are not all run with the same interface, candidate budget, version constraints, or feedback. CoCoNut’s leading-patch restriction improves specificity for that baseline, yet it does not make every condition equivalent. The paper’s comparative language should therefore be read as referring to the selected reported results, rather than a fully controlled ranking of current repair tools.

The conventional APR figure combines the repair coverage adopted from a study of multiple methods. It does not provide the basis for attributing a single common failure mode to every conventional approach. The paper discusses test-suite overfitting as an explanation, but its own experiment does not vary that factor while holding other conditions fixed. A careful reader can accept the reported generalizing-repair count while remaining cautious about the causal explanation for the gap. Observed performance differences and explanations of those differences require different kinds of evidence.

The success criterion emphasizes defect localization and correction. This suits a study of targeted bug repair, but it narrows the meaning of failure. A working alternative may be rejected even when a developer would accept it. Conversely, a targeted patch that meets the benchmark criterion does not automatically establish suitability for every surrounding software context. The evaluation is deliberately asking whether the introduced defect is addressed without harmful added changes. It does not measure all forms of assistance that could help a programmer complete the broader task.

The follow-up result includes human-supplied information. Someone must obtain the failing example, know the intended output when relevant, and decide what to communicate. The experiment therefore demonstrates assisted interaction rather than independent discovery of all necessary requirements. Its proposed automation of hint generation remains future work. The distinction matters because the human contribution may already contain a substantial part of the diagnostic work, even when it does not directly specify the repair.

There is also no comprehensive measure of cost. The paper does not quantify elapsed repair time across the compared systems, the time spent evaluating suggestions, or the effort needed to prepare hints. It does not track how quickly a user identifies the correct answer among repeated responses. Those missing measurements prevent the repair counts from becoming a direct productivity estimate. Competitive coverage is encouraging evidence about candidate quality, but a practical tool must also make the correct candidate economical to obtain and verify.

Finally, the analysis cannot determine the provenance of a generated solution. The authors suspect that some alternative implementations reflect previously learned material, but they do not trace those outputs to particular sources. The study also does not establish how exposure to related programs might affect benchmark performance. These are boundaries on the interpretation of apparent understanding. The observable claim remains narrower and secure: under the stated requests, certain answers correct the targeted defect, while others fail according to the authors’ criteria.

What came after

The later citation record places this study within discussions of software engineering, evaluation, reliability, and broader applications of ChatGPT. Citation alone does not establish that a later work implements the feedback procedure, adopts the same correctness criterion, or confirms the reported repair counts. The later works named here support a view of the research directions surrounding the paper, but most are identified only by title. Their relationship should therefore be described at the level that those descriptions justify. The clearest continuing question is how to turn promising generated suggestions into dependable, assessable task completion.

From compact repairs to broader software tasks

SWE-bench asks about resolving real-world GitHub issues. That task framing broadens the setting beyond the compact faulty functions studied here. The connection is a progression in evaluation scope: the Sobania study examines whether an assistant can correct a supplied program, while the later title directs attention toward issue resolution in a real software-development setting. The citation information does not establish that SWE-bench reproduces the same feedback experiment or uses the same definition of targeted repair. Its relevance is the broader question of what successful software assistance should encompass.

SWE-agent places agent-computer interfaces at the center of automated software engineering. That emphasis connects naturally with the earlier paper’s finding that the interaction procedure matters. The difference between an isolated request and a conversation is already consequential in the QuixBugs experiment. SWE-agent’s title points to a wider concern with how a software agent interacts with its working environment. The available citation description does not specify which parts of the earlier repair protocol it adopts, so it would be unwarranted to claim a direct implementation lineage or a particular performance improvement.

NExT concerns learning to reason about code execution. Execution behavior is also central to the feedback in the Sobania study: a failing input, an unexpected result, or a runtime error can change the repair response. This is a thematic connection rather than proof that the later work uses the same hint format. The earlier experiment demonstrates that behavioral evidence can help within a conversation. The later title identifies execution-oriented reasoning as its own research target. Together they mark related ways of moving beyond judgments based only on how plausible source code appears.

ICE-Score concerns the evaluation of code through instructions to a language system. Its relevance is the assessment side of the repair problem. The Sobania paper depends on manual decisions about whether an answer corrects the target defect, introduces another problem, or merely replaces the implementation. A later work focused on code evaluation addresses a neighboring need: how generated code should be judged. The citation information does not establish that ICE-Score reproduces those categories or replaces their manual assessment, so no such capability should be inferred from the connection.

Evaluation and failure remain central questions

Can we trust the evaluation on ChatGPT? makes evaluation reliability its explicit question. The earlier repair study supplies concrete reasons that this question matters. Version changes, repeated-request variability, human judgment, and differing success definitions all affect the interpretation of its results. The later title supports a connection to that evaluation problem, but not a claim about the later work’s specific findings. The useful continuity is the need to state exactly what was asked, what information was available, and what counted as success.

A Categorical Archive of ChatGPT Failures is linked by the idea of organizing unsuccessful behavior into meaningful categories. In the repair study, a request for context differs from an incorrect claim of correctness, and both differ from a patch that creates another defect. Such distinctions help readers understand where an interaction goes wrong. The later title indicates a broader archive organized around failure types. The citation record does not establish that it adopts this paper’s categories or reproduces its examples, but it situates the repair analysis within a wider interest in describing failure precisely.

A Survey of Safety and Trustworthiness through Verification and Validation connects to the paper’s unresolved verification burden. The repair results repeatedly distinguish a plausible answer from an accepted correction. That distinction is an instance of the broader concern named in the later survey: what evidence warrants trust in a system’s output? The citation information supports discussing that shared concern, while leaving the survey’s detailed treatment unspecified. The earlier paper contributes a concrete engineering case in which external checks and careful acceptance criteria are necessary.

A Survey on Security and Privacy: The Good, the Bad, and the Ugly places the citation in a broader security and privacy discussion. The repair experiment itself does not test either topic, so its successful patches should not be treated as evidence of security or privacy guarantees. The connection is therefore contextual. A study of code assistance becomes part of a wider literature considering the capabilities and risks of general-purpose language systems. Without a fuller description of the survey’s treatment, the citation cannot justify a more specific claim about what it concludes from these repair results.

Broader applications sharpen the need for task-specific evidence

Summary of ChatGPT-Related Research and Perspective Towards the Future maps early applications, performance, and obstacles involving GPT-3.5 and GPT-4. The Sobania study fits within that map as a task-specific evaluation of software repair. Its contribution is neither a general endorsement nor a general rejection of ChatGPT. It offers measured coverage on a defined benchmark, a bounded conversational intervention, and a description of unsuccessful answers. That level of specificity is useful to a survey because it prevents a broad claim of coding ability from replacing evidence about a particular activity.

Exploring the Feasibility of ChatGPT for Event Extraction concerns a different task: extracting events from text. Its title supports a methodological parallel with the repair study, since both ask whether a general conversational system is suitable for a particular application. It does not support transferring the repair result to extraction or claiming that the later work adopts failure hints. The connection illustrates why task-specific evaluation matters. An assistant’s usefulness in one setting leaves the quality and failure modes of another setting to be established separately.

Is ChatGPT better than Human Annotators? studies possibilities and limitations in explaining implicit hate speech. That subject differs sharply from program repair, and the citation does not make the repair findings evidence about annotation quality. The shared research concern is how to assess a fluent explanation against a task’s real requirements. In the Sobania paper, an explanation must lead to a valid targeted correction to count as success. The later work’s title identifies another setting where apparent explanatory competence needs application-specific scrutiny.

ChatGPT vs Human-authored Text concerns controllable summarization and sentence style transfer. It broadens the citation context toward constraints on generated text. The available description does not show direct reuse of the bug-fixing procedure. Its relevance is that performance depends on the task and the acceptance criterion: producing relevant output is not necessarily the same as meeting the requested constraints. Across these later directions, the repair paper remains a concrete example of why capability claims need specified inputs, visible checking rules, and a clear account of the human contribution.

Cite

Cite as Dominik Sobania, Martin Briesch, Carol Hanna and Justyna Petke. 2023. An Analysis of the Automatic Bug Fixing Performance of ChatGPT. arXiv:2301.08653.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.1109/apr59189.2023.00012 · arXiv 2301.08653

@misc{sobania2023analysis,
  title = {{An Analysis of the Automatic Bug Fixing Performance of ChatGPT}},
  author = {Dominik Sobania, Martin Briesch, Carol Hanna and Justyna Petke},
  year = {2023},
  doi = {10.1109/apr59189.2023.00012},
  eprint = {2301.08653},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.1109/apr59189.2023.00012}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/sobania-2023-analysis-automatic-bug-fixing-performance/

References

21 references, from the paper's own bibliography.

  1. W. E. Wong, X. Li, and P. A. Laplante, “Be more familiar with our enemies and pave the way forward: A review of the roles bugs played in software failures,” Journal of Systems and Software, vol. 133, pp. 68–94, 2017. OpenAlex ↗ · Scholar ↗
  2. C. Le Goues, T. Nguyen, S. Forrest, and W. Weimer, “GenProg: A generic method for automatic software repair,” Ieee transactions on software engineering, vol. 38, no. 1, pp. 54–72, 2011. OpenAlex ↗ · Scholar ↗
  3. L. Gazzola, D. Micucci, and L. Mariani, “Automatic software repair: a survey,” in Proceedings of the 40th International Conference on Software Engineering, ICSE 2018, Gothenburg, Sweden, May 27 - June 03, 2018, M. Chaudron, I. Crnkovic, M. Chechik, and M. Harman, Eds. 1em plus 0.5em minus 0.4em ACM, 2018, p. 1219. [Online]. Available: https://doi.org/10.1145/3180155.3182526 OpenAlex ↗ · Scholar ↗
  4. S. O. Haraldsson, J. R. Woodward, A. E. Brownlee, and K. Siggeirsdottir, “Fixing bugs in your sleep: How genetic improvement became an overnight success,” in Proceedings of the Genetic and Evolutionary Computation Conference Companion, 2017, pp. 1513–1520. OpenAlex ↗ · Scholar ↗
  5. J. Petke, S. O. Haraldsson, M. Harman, W. B. Langdon, D. R. White, and J. R. Woodward, “Genetic improvement of software: a comprehensive survey,” IEEE Transactions on Evolutionary Computation, vol. 22, no. 3, pp. 415–432, 2017. OpenAlex ↗ · Scholar ↗
  6. Q. Zhang, C. Fang, Y. Ma, W. Sun, and Z. Chen, “A survey of learning-based automated program repair,” 2023. [Online]. Available: https://arxiv.org/abs/2301.03270 OpenAlex ↗ · Scholar ↗
  7. A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, Ł. Kaiser, and I. Polosukhin, “Attention is all you need,” in Advances in neural information processing systems, 2017, pp. 5998–6008. our card
  8. Z. Feng, D. Guo, D. Tang, N. Duan, X. Feng, M. Gong, L. Shou, B. Qin, T. Liu, D. Jiang et al., “CodeBERT: A pre-trained model for programming and natural languages,” in Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: Findings, 2020, pp. 1536–1547. our card
  9. C. Clement, D. Drain, J. Timcheck, A. Svyatkovskiy, and N. Sundaresan, “PyMT5: Multi-mode translation of natural language and Python code with transformers,” in Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), 2020, pp. 9052–9065. our card
  10. M. Chen, J. Tworek, H. Jun, Q. Yuan, H. P. d. O. Pinto, J. Kaplan, H. Edwards, Y. Burda, N. Joseph, G. Brockman et al., “Evaluating large language models trained on code,” arXiv preprint arXiv:2107.03374, 2021. our card
  11. D. Sobania, M. Briesch, and F. Rothlauf, “Choose your programming copilot: a comparison of the program synthesis performance of GitHub Copilot and genetic programming,” in Proceedings of the Genetic and Evolutionary Computation Conference, 2022, pp. 1019–1027. OpenAlex ↗ · Scholar ↗
  12. D. Lin, J. Koppel, A. Chen, and A. Solar-Lezama, “QuixBugs: A multi-lingual program repair benchmark set based on the Quixey Challenge,” in Proceedings Companion of the 2017 ACM SIGPLAN international conference on systems, programming, languages, and applications: software for humanity, 2017, pp. 55–56. OpenAlex ↗ · Scholar ↗
  13. H. Ye, M. Martinez, T. Durieux, and M. Monperrus, “A comprehensive study of automatic program repair on the QuixBugs benchmark,” Journal of Systems and Software, vol. 171, p. 110825, 2021. OpenAlex ↗ · Scholar ↗
  14. T. Lutellier, H. V. Pham, L. Pang, Y. Li, M. Wei, and L. Tan, “CoCoNuT: combining context-aware neural translation models using ensemble for program repair,” in ISSTA '20: 29th ACM SIGSOFT International Symposium on Software Testing and Analysis, Virtual Event, USA, July 18-22, 2020, S. Khurshid and C. S. Pasareanu, Eds. 1em plus 0.5em minus 0.4em ACM, 2020, pp. 101–114. [Online]. Available: https://doi.org/10.1145/3395363.3397369 OpenAlex ↗ · Scholar ↗
  15. J. A. Prenner, H. Babii, and R. Robbes, “Can OpenAI's codex fix bugs? an evaluation on QuixBugs,” in Proceedings of the Third International Workshop on Automated Program Repair, 2022, pp. 69–75. OpenAlex ↗ · Scholar ↗
  16. Y. Yuan and W. Banzhaf, “ARJA: Automated repair of java programs via multi-objective genetic programming,” IEEE Transactions on software engineering, vol. 46, no. 10, pp. 1040–1067, 2018. OpenAlex ↗ · Scholar ↗
  17. M. Martinez and M. Monperrus, “Ultra-large repair search space with automatically mined templates: The cardumen mode of astor,” in International Symposium on Search Based Software Engineering. 1em plus 0.5em minus 0.4em Springer, 2018, pp. 65–86. OpenAlex ↗ · Scholar ↗
  18. T. Durieux and M. Monperrus, “Dynamoth: dynamic code synthesis for automatic program repair,” in Proceedings of the 11th International Workshop on Automation of Software Test, 2016, pp. 85–91. OpenAlex ↗ · Scholar ↗
  19. M. Martinez and M. Monperrus, “Astor: Exploring the design space of generate-and-validate program repair beyond GenProg,” Journal of Systems and Software, vol. 151, pp. 65–80, 2019. OpenAlex ↗ · Scholar ↗
  20. J. Xuan, M. Martinez, F. Demarco, M. Clement, S. L. Marcote, T. Durieux, D. Le Berre, and M. Monperrus, “Nopol: Automatic repair of conditional statement bugs in Java programs,” IEEE Transactions on Software Engineering, vol. 43, no. 1, pp. 34–55, 2016. our card
  21. B. Cornu, T. Durieux, L. Seinturier, and M. Monperrus, “NPEfix: Automatic runtime repair of null pointer exceptions in Java,” arXiv preprint arXiv:1512.07423, 2015. OpenAlex ↗ · Scholar ↗