Evaluating LLM Coding Capabilities: From Single-Turn Generation to Task Closure
Large language models can look impressive in one-shot coding demos, but real development requires understanding existing code, planning multi-file changes, running checks, and fixing errors. This article explains why single-turn generation is insufficient and introduces an evaluation approach based on task closure and rework cost. It covers four observation points, a lightweight Python record format, guidance for interpreting model announcements and demos, and practical recommendations for team adoption.
1. Why Single-Turn Generation Is Not Enough
LLM performance in programming scenarios is often demonstrated with a piece of code that is “correct on the first try.” Such demos show that a model has basic syntax and algorithm capabilities, but they do not reflect the complexity of real development work. Actual work usually includes clarifying requirements, reading legacy code, modifying multiple files, running checks, handling errors, and going back to adjust the design when problems are found. Observing only the first step can easily lead to overestimating the model’s actual output.
There are two more reasonable questions. First, can the model, with limited human guidance, push a task to an acceptable state? This is called task closure capability. Second, after the task is completed, how much time do developers still need to spend correcting it? This is called rework cost. Together, these two factors determine the real impact of a tool on engineering efficiency.
2. Breaking Coding Capability into Four Observation Points
2.1 Understanding Existing Projects
Real projects contain legacy code, implicit conventions, and incomplete documentation. If a model can only write from a blank file, the code it generates may be inconsistent with existing interfaces, naming conventions, and error-handling patterns. During observation, focus on whether it can first locate the relevant modules, explain call relationships, and identify which locations will be affected by a change.
2.2 Decomposing Tasks and Modifying Multiple Files
A requirement often involves data structures, business logic, and tests at the same time. Better performance means the model first provides a change plan, then modifies files in order, and explains why each file needs adjustment. If it changes only one file while assuming other parts are unaffected, integration errors are likely.
2.3 Running Checks and Handling Errors
Have the model actually run tests, compilation, or static checks, and feed the error information back to it. The key is whether it can locate the cause from error logs instead of repeatedly submitting similar changes. If it still fails to converge after two or three rounds, this usually indicates a misunderstanding of the problem.
2.4 Measuring Rework Cost
Even if the final tests pass, record the number of human interventions, the number of changed lines, and any design decisions that were overturned. Only when rework cost is low can the output go directly into the code review process.
3. Building a Simple Task Closure Record
Teams can prepare a fixed task list and compare different tools or different versions under the same conditions. The script below tracks the number of interaction rounds, test pass status, and manual edit volume for each task. It records only objective metrics and does not depend on any specific product.
from dataclasses import dataclass, field@dataclassclass TaskRecord:task_id: strrounds: int = 0 # number of interaction rounds with the modeltests_passed: bool = False # whether the final tests passedmanual_edits: int = 0 # number of files manually editedlines_changed: int = 0 # number of changed lines before mergenotes: list[str] = field(default_factory=list)def summarize(records: list[TaskRecord]) -> dict:total = len(records)closed = [r for r in records if r.tests_passed]n = len(closed)return {"total_tasks": total,"closure_rate": round(n / total, 2) if total else 0.0,"avg_rounds_closed": round(sum(r.rounds for r in closed) / n, 2) if n else None,"avg_manual_edit_files_closed": round(sum(r.manual_edits for r in closed) / n, 2) if n else None,"avg_lines_changed_closed": round(sum(r.lines_changed for r in closed) / n, 2) if n else None,}if __name__ == "__main__":# Example data is only for demonstrating the output format, not any real evaluation resultrecords = [TaskRecord("T-01", rounds=2, tests_passed=True, manual_edits=0, lines_changed=36),TaskRecord("T-02", rounds=5, tests_passed=False, manual_edits=3, lines_changed=120),TaskRecord("T-03", rounds=3, tests_passed=True, manual_edits=1, lines_changed=48),]print(summarize(records))
When using this type of record, keep a few points in mind. The task list should cover three scenarios: new features, bug fixes, and refactoring, rather than testing only small greenfield projects. The context, dependency versions, and acceptance criteria for each task need to remain consistent; otherwise, comparison results are meaningless. Closure rate and rework cost should be viewed together. A high completion rate with high rework indicates that the model has only deferred problems to later stages.
4. Distinguishing Release Information, Demos, and Propagated Conclusions
When facing news about a new model release, first separate three layers of content. The first layer is facts, such as release time, availability scope, and officially listed features; these can be verified. The second layer is demos, meaning a demonstration in which a complex task is completed end to end. This shows the upper bound of capability, but it needs to be reproduced before it can be confirmed. The third layer is conclusions derived from demos, such as “it can replace a certain type of role.” Such conclusions usually require large amounts of data to support.
To judge whether a demo has reference value, ask three questions. Does the demo disclose the input and the complete process? Does it include failure cases as controls? Does the conclusion state the applicable task types and project scale? Demos lacking this information are suitable as exploration directions, but should not be used directly as the basis for procurement or team decisions.
5. Recommendations for Team Adoption
- Select real historical tasks as samples, covering new features, bug fixes, and refactoring, not only new projects.
- Provide the same context and acceptance criteria for each task to ensure consistent comparison conditions.
- Record both closure rate and rework cost. The two metrics need to be judged together; looking at only one can easily lead to one-sided conclusions.
- Conduct code review on model output, focusing on security, newly introduced dependencies, and boundary conditions. Passing tests is a necessary condition, not a sufficient one.
- Rerun the same set of tasks periodically to observe changes after version updates, and avoid relying on one-off conclusions.
- When sensitive code or internal data is involved, first confirm the scope of data use and handling requirements, then decide whether to include it in testing.
