Scientifically Evaluating LLM Programming Capabilities: From Patch Fixing to Terminal Execution
This article explores how to scientifically evaluate the programming capabilities of large language models (LLMs) beyond simple benchmark scores. It analyzes three main evaluation methods—real-world bug fixing, high-complexity engineering refactoring, and terminal-based agent execution—and explains why single leaderboards are insufficient. Finally, it provides a multi-dimensional evaluation framework and practical testing strategies for enterprises to select the right AI programming tools.
As large language models (LLMs) rapidly integrate into software development workflows, determining “which model is best for coding” requires looking beyond promotional benchmark scores. True programming capability involves multiple stages, including requirement understanding, code localization, solution design, patch writing, test verification, environment operation, and exception recovery.
Some models excel at simple code generation, function completion, or algorithmic problems, but fail in real-world engineering environments. They may struggle with reproducing issues, uncontrolled modification scopes, ignored compatibility, and missing boundary tests. Therefore, evaluating an LLM’s programming ability should focus on whether it can consistently complete tasks in uncertain, complex, and real-world constrained environments.
I. Three Main Types of Programming Evaluations
Currently, representative engineering programming evaluations can be broadly categorized into three types.
1. Real-World Project Bug Fixing
The first type is based on real issues from open-source repositories. A typical task includes a project snapshot, a bug description or feature request, and test cases to verify the fix. The model must understand the problem background, locate the relevant code, modify the implementation, and run tests to confirm the result.
This type of evaluation is closer to daily development than standard algorithm questions because the model faces a complete project with multiple modules rather than an isolated function. It must handle:
- Incomplete requirement descriptions, requiring code-based inference for true intent;
- Relevant logic scattered across multiple files;
- Ensuring fixes do not break existing APIs and compatibility;
- Test cases that may only cover partial scenarios;
- Potential dependency, build, or environment configuration issues.
High-quality datasets, cleaned and filtered by humans, typically remove vague, unstable, or controversial samples, making them better for horizontal comparison. However, this evaluation still faces a ceiling effect. When most models achieve high scores on a relatively fixed task format, score differences no longer accurately reflect true capability gaps.
2. High-Complexity Engineering Refactoring
The second type increases task difficulty by requiring more code modifications, handling complex call relationships, and sometimes involving multiple modules and long execution paths.
Unlike single-point bug fixes, these tasks emphasize engineering reasoning. The model must not only answer “which line of code to change” but also determine:
- Which callers will be affected by the modification;
- Whether configurations, APIs, or data structures need synchronized adjustments;
- If new logic will introduce state inconsistencies;
- Whether legacy behavior must be retained;
- If additional tests are needed;
- Whether the modification aligns with the project’s existing coding style.
Complex tasks are better at distinguishing actual model performance levels. A model might perform stably on short, clearly bounded problems, but its success rate will drop noticeably on tasks requiring reading multiple files, making multi-round modifications, and repeated verification.
Furthermore, complex evaluations should focus on patch quality rather than just test passes. A solution that “passes current tests” is not necessarily a good engineering implementation. If a patch introduces a large number of irrelevant changes, hides exceptions, bypasses core logic, or relies on specific test data behaviors, its actual maintainability remains poor.
3. Agent Execution in Terminal Environments
The third type requires the model to directly interact with a command-line or terminal environment to perform file operations, project builds, test runs, log analysis, and dependency troubleshooting.
This evaluates complete agent capabilities rather than just code generation. The model must:
- Observe the current directory and project structure;
- Determine the next command to execute;
- Adjust its strategy based on command output;
- Locate the root cause when errors occur;
- Modify files and re-verify;
- Control execution counts and operation scope within constraints.
The difficulty of terminal tasks lies in the dynamic environmental feedback. The model cannot generate a one-time answer; it must make continuous decisions based on actual results. For example, a test failure might stem from a code error, or it could be due to missing dependencies, incorrect paths, permission restrictions, or build cache issues. An excellent model should distinguish between these causes rather than blindly repeating the same commands.
II. Why a Single Leaderboard Doesn’t Represent Real Programming Ability
Programming evaluation results are often influenced by dataset design, test quality, and model strategies, so a score cannot simply be equated with “comprehensive programming ability.”
First, test cases are not always perfect. Some only verify common paths and fail to cover anomalous inputs; others have overly loose assertions that allow incomplete fixes to pass; and some deviate from the task description, causing correct implementations to fail.
Second, training data contamination affects results. If evaluation tasks, solutions, or related discussions have entered the model’s training corpus, it might complete the task through memorization or pattern matching rather than on-the-spot reasoning. In this case, the score overestimates the model’s performance on unfamiliar projects.
Third, whether the model has tool permissions significantly impacts results. A model that can read all files, execute tests, access dependencies, and perform multi-round modifications is not on the same playing field as one that generates patches directly from limited context. Evaluation reports must clearly state context length, tool permissions, maximum execution rounds, internet access, and failure retry strategies.
Finally, success rate does not reflect cost. Two models might complete a task, but one might only perform a few necessary operations while the other makes numerous invalid attempts. For enterprise development, response time, compute consumption, modified file count, manual review cost, and recovery difficulty after failure are equally important metrics.
III. How to Build a More Reliable Evaluation System
A more reasonable evaluation should use multi-dimensional metrics rather than just publishing a total score.
1. Task Completion Rate
This is the most basic metric, indicating whether the model can make the target tests pass. However, it should distinguish between “all tests pass,” “partial tests pass,” and “generated an unrunnable patch” to avoid classifying all failures into a single category.
2. Patch Correctness
It is necessary to check whether the patch truly solves the problem, covers key scenarios in the requirements, and avoids bypassing logic, hardcoding answers, or modifying tests. In real engineering, the semantic correctness of a patch is more important than superficially passing tests.
3. Modification Scope & Maintainability
Metrics can include modified file count, code change size, proportion of irrelevant changes, and whether original style is preserved. High-quality models typically prefer local, explainable, and easily reviewable modifications rather than large-scale rewrites.
4. Testing & Verification Capability
Whether the model actively runs relevant tests, locates issues from failure logs, and adds boundary tests demonstrates its ability to participate in the engineering closed-loop. Models that only submit code without verification pose higher risks in production environments.
5. Terminal Operation Efficiency
Command count, failure count, repeated operations, and completion time should be recorded. A terminal agent shouldn’t necessarily execute more commands, but rather complete tasks in fewer steps based on sufficient evidence.
6. Stability & Reproducibility
If results fluctuate significantly when the same task is run multiple times, the model’s strategy is still unstable. For enterprise use, it is better to focus on average performance across different projects, languages, and complexities, rather than a single best run.
IV. How Enterprises Should Test for Selection
If a team plans to introduce AI programming tools, it is recommended not to directly copy public leaderboards, but to build an internal test set. This set can be drawn from historical bugs, code refactoring, API migration, log troubleshooting, and test completion scenarios, ensuring proper data isolation.
The evaluation process can be divided into three layers:
The first layer consists of offline code tasks to compare basic understanding and generation capabilities; the second layer involves engineering tasks with tests to verify whether the model can complete modifications and regressions; the third layer includes controlled terminal tasks to observe the model’s continuous execution capability in a real toolchain.
At the same time, manual review should be retained. Developers need to check whether the model has introduced security vulnerabilities, performance degradation, resource leaks, or compatibility issues. For high-risk code, static analysis, dependency scanning, and manual approval should be added; automated test passes should not automatically result in a merge.
V. Conclusion
There is no absolute ranking that covers all scenarios for LLM programming capabilities. Simple completion, real-world bug fixing, complex engineering refactoring, and terminal agent execution measure different capability dimensions. The closer the evaluation is to a real development workflow, the higher the task uncertainty and the greater the demands on the model’s context understanding, tool usage, error recovery, and engineering judgment.
Therefore, when comparing different models, focus on whether the evaluation conditions are consistent, whether tasks have contamination risks, whether tests are reliable, and whether the model can achieve maintainable modifications at a lower cost. For individual developers, terminal interaction efficiency and code explanation capabilities may be more important; for enterprise teams, security, stability, review costs, and internal project adaptation should also be considered.
A truly valuable AI programming solution is not a single champion on a leaderboard, but one that consistently reduces development workload with clear boundaries, controlled permissions, and complete verification mechanisms, enabling developers to deliver high-quality software faster and more reliably.
