Evaluating Coding LLMs: From Code Generation to Closed-Loop Engineering

    How should coding large language models be evaluated? This article argues that "writing code fluently" is not the same as "completing engineering work," and outlines what a reliable AI coding assistant must do: verify baselines, validate every fix, analyze build failures with evidence, and report honestly. It covers diagnosing build errors without blindly blaming caches, task decomposition with verification gates, when to escalate questions to developers, and how to design reproducible evaluation benchmarks for real-world engineering performance.

    1. Separate “Writing Code” from “Completing the Work”

    Once coding large language models enter real development workflows, evaluation criteria can no longer stop at whether the code reads smoothly, whether explanations sound clear, or how many files were edited in a short time. What developers actually need to know is: can the model understand the constraints of an existing codebase, make the necessary changes, and provide sufficient evidence that those changes work?

    A common scenario: a developer hands the tool an existing codebase and a phased implementation plan. The AI coding assistant quickly reports that the first several steps are done—but the build fails. It then attributes the failure to a cache anomaly and asks the developer how to handle it. The developer suggests cleaning build artifacts; the tool runs the cleanup, but instead of re-verifying immediately, it keeps modifying subsequent code. When the build fails again, it doubles down on its earlier attribution.

    What this exposes is not necessarily weak code generation, but a missing engineering execution loop:

    • Failing to distinguish observed facts from unverified speculation;
    • Failing to verify whether a fix actually worked;
    • Stacking new changes on top of an unclear baseline state;
    • Mistaking “I ran an operation” for “the problem is solved”;
    • Escalating information that tools should gather directly to the developer.

    That said, a single experience only reflects performance on a specific task and cannot be generalized to a model class across all projects. The more rigorous approach is to convert observed problems into reproducible, measurable evaluation dimensions.

    2. The Core of Engineering Reliability: A Verifiable Execution Loop

    A trustworthy coding assistant should complete at least this cycle:

    Understand the goal → Check the baseline → Implement changes → Run verification → Analyze failures → Adjust the approach → Verify again.

    What matters here is not the number of steps, but that each step has inputs, actions, and observable outcomes.

    1. Understanding the Goal: Turn Requirements into Acceptance Criteria

    “Implement a feature” is usually not a precise enough execution standard. For example, “add configuration reading capability” also involves:

    • Configuration sources and when they are read;
    • Default behavior for missing fields;
    • Error handling for invalid input;
    • Compatibility with existing configuration mechanisms;
    • Impact on existing callers;
    • The corresponding test scope.

    Without these constraints, the model may produce an implementation that is locally plausible but globally unusable.

    Therefore, an acceptance checklist should be established before a task begins. For ambiguities that would change the solution, the model should ask proactively; for information obtainable by reading code, checking tests, or running builds, it should investigate on its own first.

    2. Checking the Baseline: Was the Problem Introduced by This Change?

    Before modifying code, the model should understand the project’s current health: whether the build completes, whether existing tests pass, and whether there are uncommitted changes in the working tree.

    This step prevents two common misjudgments: treating a pre-existing issue as a defect caused by the current change, or explaining a newly introduced problem as pre-existing environment instability.

    If the baseline already fails, the task does not have to stop immediately—but the failure point must be recorded along with its relationship to the target feature. Subsequent acceptance should compare the state before and after the change, not merely check whether errors appear at the end.

    3. Implementing Changes: Preserve Inspectable Intermediate States

    Complex tasks should be broken into phases, but phases should not be mere numbered headings. An effective phase has a tangible deliverable—completing an interface adjustment, updating callers, adding tests for exception branches.

    At the end of each phase, verification should match the scope of the change: targeted checks for a local function change; caller-path checks for public interface changes. Never skip a build error that has already surfaced just because the plan has more steps remaining.

    3. Why Build Failures Should Not Be Blindly Attributed to Cache

    Caching is common in build systems, but “build failed” does not mean “cache corrupted.” The same surface symptom can stem from entirely different causes:

    • Unsatisfied syntax or type constraints;
    • Callers not updated after an interface change;
    • Inconsistent dependency versions or build configuration;
    • Missing conditional compilation paths;
    • Missing generated files;
    • Failure to fetch external dependencies;
    • Stale local artifacts inconsistent with current inputs.

    These require different fixes. Declaring a cache anomaly without log evidence is essentially substituting a familiar explanation for actual diagnosis.

    1. Capture the Error First, Then Decide How to Respond

    After a build failure, record the execution point, the checked scope, the exit status, and the key error messages. For long cascading error output, start with the first error that has explanatory power, then determine whether it caused the subsequent failures.

    But the “first visible error” is not necessarily the root cause. Parallel builds and interleaved output can distort log ordering, so context analysis is still required.

    2. Validate Hypotheses with Low-Cost Checks

    If the error suggests a call is missing an argument, inspect the interface definition and the call site first—don’t wipe all build artifacts. If a generated file is suspected missing, confirm whether the generation step ran—don’t keep editing business logic.

    A sound diagnostic order: check direct evidence first, then run local verification, and only last consider costly, high-impact environment operations.

    Cleaning build artifacts is a legitimate troubleshooting tool, but it forfeits incremental build benefits and can destroy useful intermediate state. Cleanup should have a justification—it should never be the default reaction to any error.

    3. After Any Fix, Return to the Original Verification Point

    If cleanup was executed, the next step is to rerun the originally failing build check and compare results:

    • The original error disappears: the operation may be related to the problem;
    • The error is identical: the current hypothesis lacks support;
    • The error changed: determine whether a deeper problem has surfaced or the environment has shifted.

    In no case should a build problem be declared resolved merely because “the cleanup ran successfully.”

    4. The Real Value of Task Decomposition: Containing Error Propagation

    Multi-phase plans reduce complexity, but only verification gates control risk.

    If an early phase breaks a foundational interface and later phases keep building on it, the result can be a tangle of interlocking errors. At that point it becomes hard to determine which change introduced the problem, and the model tends to thrash in an ever-growing context.

    A more robust strategy is to assign explicit states to each phase:

    • Pending: not yet implemented;
    • Modified, awaiting verification: code changed but not sufficiently validated;
    • Verified: the corresponding checks passed;
    • Blocked: an issue that currently cannot be resolved.

    This state model is more accurate than a single “done” label. In particular, “modification complete” and “acceptance complete” must be distinguished to avoid setting false expectations for developers.

    Independent work can proceed in parallel; dependent steps should verify their prerequisites first. The process need not rigidly run the full test suite for every small change, but verification intensity should match the risk.

    5. When Should the Model Ask the Developer?

    Asking questions is not a weakness. What matters is whether the question is necessary—and whether reasonable investigation happened first.

    When Asking Is Appropriate

    Questions involving business semantics, permission boundaries, compatibility policy, or irreversible operations typically require human confirmation. For example: should invalid configuration cause startup to fail, or should the system continue with defaults? Such decisions cannot be resolved from compilation logs alone.

    When Investigation Should Come First

    If the question is where an interface is defined or why a check failed, the model should read project files, trace call relationships, and examine error output before asking.

    A high-quality escalation contains four parts: observed facts, attempted actions, the result of each attempt, and the decision still needed from a human.

    For example, instead of saying “the environment is broken, what do I do,” say: “Targeted checks pass, but the full build fails at a public interface call site; two callers confirmed not yet updated. Two compatibility options exist—need a decision on whether to keep the legacy calling convention.”

    Questions like this focus the developer’s attention on genuine judgment calls.

    6. Designing Fairer, Reproducible Evaluations

    Comparing coding models’ real capability requires more than completion speed or final test pass rates. Evaluations should fix task conditions as much as possible:

    1. Use identical initial codebase states;
    2. Provide consistent requirements and acceptance criteria;
    3. Specify available tools and execution permissions;
    4. Record the number of human prompts, corrections, and takeovers;
    5. Preserve code diffs, execution logs, and final verification results.

    If a human provided the key fix idea during a task, that counts as human intervention and should not be conflated with fully autonomous completion.

    Suggested evaluation dimensions:

    Functional correctness. Are all requirements implemented? Are exception paths covered? Were regressions introduced?

    Diagnostic quality. Does the model update its judgment based on evidence? Does it repeat actions already proven ineffective?

    Execution efficiency. Record not just elapsed time but also wasted edits, redundant checks, and unnecessary environment operations.

    Change quality. Are modifications focused? Do they introduce unrelated refactoring or unnecessary complexity?

    Reporting honesty. Do completion claims match the actual execution record? Are unverified items clearly flagged?

    Passing on the first attempt is valuable, but beware of overly narrow test coverage. Existing tests passing only means the checked behaviors revealed no problems—it does not equal all requirements being met.

    7. Applying These Practices to Daily Development Workflows

    Developers can set explicit collaboration rules with AI coding tools at the start of a task:

    Check the project baseline before making changes; state the change scope and verification method for each phase; analyze error evidence before responding to build failures; rerun relevant checks after any fix; never present unverified causes as conclusions; in the final report, distinguish completed, verified, and still-blocked items.

    For significant changes, also restrict modifications to unrelated files, keep reviewable diffs, and require human confirmation before deleting data, changing permissions, or touching production environments.

    In enterprise settings, model-generated code must still go through existing quality systems. Code review, automated checks, access control, and release approval should not be bypassed because AI coding is in use. Models can improve execution efficiency, but they cannot replace organizational management of risk boundaries.

    A final delivery report should include at minimum: what was implemented, what scope was modified, which checks actually ran and their results, and what uncertainties remain. Tests that were never executed should be explicitly labeled “not executed”—never blurred with “expected to pass.”

    Closing: What Really Matters Is Handling Failure

    The capability of a coding LLM shows not only in how much code it can generate on the happy path, but in whether, after a failure, it can gather evidence, adjust its hypotheses, implement fixes, and verify again.

    Quickly declaring completion while being unable to explain why the build failed shifts the workload onto developers. Pausing to locate the problem and reporting status honestly is far closer to reliable engineering collaboration.

    So when evaluating AI coding experiences, the most valuable questions are not “how fast did it answer,” but “is its conclusion evidence-backed, was its change verified, and did it genuinely reduce human takeover.” Only by placing code generation inside a complete engineering loop can we tell whether a model delivers surface-level speed or sustainable development efficiency.