Evaluating LLM Code-Fixing Ability: A Guide to the Three Main Benchmarks

    Choosing a large language model for software development requires more than a single coding leaderboard score. This article breaks down the three benchmark categories used to evaluate code-fixing ability: real-repository bug-fixing benchmarks, high-difficulty long-chain refactoring benchmarks, and terminal-based agent execution benchmarks. It explains how each is constructed, why the classic bug-fixing benchmark is becoming saturated due to judging flaws and data contamination, and how the harder refactoring and terminal benchmarks restore discriminative power. It also outlines a practical evaluation strategy combining public benchmarks with a private dataset, tracking variance and cost, and avoiding common misreadings of benchmark scores.

    1. Background: Why a Single Coding Leaderboard Is Not Enough

    When introducing large language models into a development workflow, the question teams ask most often is how much real engineering work the model can actually complete. Vendor-published scores are often high, yet the models frequently struggle when applied to a team’s own codebase. The reason is straightforward: coding ability is not a single scalar. It can be broken down into at least four sub-abilities—locating and fixing a single defect, carrying out long-chain changes across files, autonomously executing and verifying work in a command-line environment, and adhering to existing constraints such as dependency versions, coding standards, and compatibility. Any single leaderboard covers only part of this.

    As a result, the industry has gradually adopted a “combined” evaluation practice: use a classic bug-fixing benchmark to check the baseline, a high-difficulty long-change benchmark to check the ceiling, and a terminal-execution benchmark to check agent closed-loop capability. Each is described below.

    2. Category One: Real-Repository Bug-Fixing Benchmarks

    How Tasks Are Constructed

    Samples in this type of benchmark come from real defect records in open-source repositories and their corresponding fix commits. Each task usually contains four elements: a runnable historical code snapshot, a natural-language description of the defect or requirement, a set of test cases used for judging, and the original fix patch as a reference answer. The model must read the description, locate the relevant code in the repository, produce a modification, and is judged solely on whether the tests pass.

    The Value of High-Quality Filtered Versions

    Directly collected raw datasets are noisy: some descriptions are vague enough that even humans struggle to determine intent; some tests are themselves unstable and fail intermittently; and some judging logic is flawed, marking a correct solution as wrong. To address this, the industry produced human-cleaned, streamlined versions, typically on the order of a few hundred tasks, removing ambiguous samples and unstable tests to reduce result variance and improve reproducibility. This version has long been treated as the de facto standard.

    Saturation and Contamination: Two Root Causes of Metric Failure

    When the vast majority of model scores cluster in a high range, the benchmark’s discriminative power drops—it can no longer separate “usable” from “very good.” Two systemic flaws make this worse:

    • Judging flaws: incomplete test coverage or overly narrow assertions cause correct implementations that differ from the reference patch to be marked wrong; conversely, “speculative” changes that merely satisfy the assertions are marked correct.
    • Data contamination: because tasks come from public repositories, their fix patches may already be in the model’s training corpus, so scores overestimate generalization ability.

    Together, these two points are gradually pushing this benchmark out of the core evaluation position.

    3. Category Two: High-Difficulty Long-Chain Refactoring Benchmarks

    As an alternative, the industry introduced refactoring-style benchmarks with significantly higher difficulty, designed around two key constraints.

    The first is contamination resistance. The public subset and an isolated subset are released under strong copyleft-style licenses that explicitly restrict direct redistribution and training use, reducing the probability that “the tasks enter the corpus.”

    The second is task scale. The minimum change for a single task is set at more than ten lines, with a substantial proportion of tasks requiring changes of over a hundred lines, spanning multiple files, multiple modules, or even interface-contract adjustments. Such tasks cannot be completed by local pattern matching; they require genuinely building a mapping among “requirement—code—test.”

    The result is that the score distribution is spread out again: most models fall in a lower range, and only a very few top models clear a higher threshold. This distribution shows that the benchmark still has discriminative power. Note that relative rankings on this type of benchmark do not fully match those on the classic benchmark; it is normal to see “a model leads on the classic benchmark but lags on the high-difficulty one,” which indicates the two assess different abilities.

    4. Category Three: Terminal-Based Agent Execution Benchmarks

    The interaction mode of the first two categories is “give a repository, give a description, submit a patch,” but real development also involves a great deal of command-line work: reading logs, running builds, installing dependencies, changing configurations, restarting services, and verifying results. Terminal-execution benchmarks are designed for this. They abstract the environment into an interactive session, issue tasks in natural language, and judge based on the final environment state or command output.

    Their focus spans three layers:

    1. Environment awareness: whether the model can quickly build an understanding of the directory structure, dependencies, and how to run things through exploratory commands;
    2. Long-horizon planning and self-correction: retry and fallback strategies under anomalies such as command failures, dependency conflicts, and port occupation;
    3. Side-effect control: not breaking the environment, not accidentally deleting data, and keeping changes rollback-able.

    A schematic execution loop can be abstracted as:

    1. for step in range(max_steps):
    2. obs = env.observe() # current terminal output and workspace state
    3. action = model.plan(goal, history, obs)
    4. result = env.run(action) # constrained by sandbox and permissions
    5. history.append((action, result))
    6. if verifier.passed(result):
    7. return success
    8. return failure(reason="step_budget_exhausted")

    This layer of ability has the greatest impact on whether an “agent is deliverable”: a model writing a correct patch is only a necessary condition; getting the change verified in a real environment is the sufficient condition.

    5. How to Combine Them: A Practical Evaluation Method

    A single score is not enough for decision-making. Organize evaluation as follows:

    • Layered screening: first use the classic bug-fixing benchmark to eliminate candidates with insufficient basic ability, then use the high-difficulty refactoring benchmark to rank top models, and finally use the terminal-execution benchmark to validate agent-form products.
    • Build a private set: select defect-fix records merged in your own repositories over the past six months, desensitize them, and construct 50–200 tasks; this is the most effective means against contamination.
    • Focus on variance, not the mean: run the same task multiple times, recording pass rate and latency distribution; engineering adoption cares more about stability than the best result.
    • Include cost in the assessment: record the average number of interaction turns per task, input/output size, and end-to-end latency to form a two-dimensional “capability—cost” view.

    A minimal skeleton for a private evaluation:

    1. dataset: internal_repo_issues_v1
    2. tasks: 120
    3. repeats: 3
    4. metrics:
    5. - pass_rate # test pass rate
    6. - pass_at_k # pass rate within k attempts
    7. - avg_steps # average interaction turns
    8. - p95_latency_seconds
    9. sandbox:
    10. network: restricted
    11. resource_limits: {cpu: 2, memory_gb: 4}

    6. Common Misreadings and Engineering Advice

    • Scores cannot be compared directly across benchmarks. Task scale, judging strictness, and whether networking is allowed all differ.
    • A small gap on a high-difficulty benchmark may translate into a magnified difference in real experience, because failure on a long-chain task often means an entire stretch of work must be taken over manually.
    • Leaderboards reflect only “average ability” and are strongly tied to a team’s tech stack. Ensure the private set includes the languages, frameworks, and build tools your team commonly uses.
    • If you plan to host the evaluation pipeline in the cloud, you can adopt a combination of general-purpose capabilities: a container platform to host the sandbox runtime, object storage to hold datasets and artifacts, a message queue to schedule tasks, and logging plus monitoring and alerting to track failure rates and resource consumption, keeping evaluation reproducible and auditable.

    7. Conclusion

    The three benchmark categories answer three questions: can the model fix a well-defined defect, can it complete a large cross-module change, and can it finish and verify work in a real terminal. The classic bug-fixing benchmark is becoming saturated and moving to a supporting role due to judging flaws and data contamination; the high-difficulty refactoring benchmark rebuilds discriminative power through strong license constraints and large change scale; and the terminal-execution benchmark fills in the agent closed-loop. The most reliable approach for engineering teams is to use public benchmarks for horizontal positioning, use a self-built private set for the final decision, and include stability and cost in the metrics—only then can you obtain an ability judgment that matches real development scenarios.