Evaluating Coding LLMs: A Practical Framework for Reliability and Model Selection

    This article presents a hands-on framework for evaluating and selecting large language models for software engineering. It covers defining "done" as a verifiable contract, treating failure disclosure as an independent quality metric, measuring cost per agentic loop rather than per call, assessing code maintainability, building internal evaluation sets that resist benchmark gaming, and governing production rollout with guardrails and human gates. Readers will get actionable checklists and criteria for turning benchmark scores into engineering-ready decisions.

    Evaluation Goals Should Come Before Benchmark Scores

    Choosing a coding LLM is, at its core, buying deliverable code changes under constraints—not buying a fluent explanation. Two camps dominate discussions: one emphasizes faster responses, lower unit prices, and improving patch quality; the other points out that models self-block on complex tasks, give vague explanations, mismanage priorities, and get abandoned once release hype fades. These observations are not contradictory. Benchmark scores measure average performance on controlled problems; real engineering environments measure whether failures are visible, whether changes can be merged, and whether cost balloons with context.

    Evaluation should therefore be split into four independent axes rather than combined into a single score:

    • Whether the task is genuinely completed, rather than “a lot of code was written.”
    • Whether known blockers are explicitly disclosed, rather than hidden behind plausible-looking patches.
    • Whether the combined cost of single calls and multi-turn agent loops is predictable.
    • Whether the output is maintainable: clear naming, boundaries, tests, and rollback paths.

    If you optimize only one axis, the other three will erupt collectively at merge time.

    Define “Done” as a Verifiable Contract

    Coding task failures usually don’t stem from a model being unable to write code, but from it producing complete-looking answers with insufficient information. The contract should be written on both the prompt side and the acceptance side.

    A task description should include at minimum: target behavior, non-goals, allowed modification paths, forbidden modules, checks that must pass, and stop conditions when ambiguity arises. Stop conditions matter most. An agent without stop conditions treats “try again” as progress, showing up as extended reasoning loops, repeatedly reading the same files, and producing nearly identical scaffolding across environments.

    Acceptance should not look only at the final diff. Record:

    1. Whether the plan identifies key risks and things it will not do.
    2. Whether the change stays within the agreed scope.
    3. Whether new or modified tests actually target this behavior, rather than empty assertions.
    4. Whether failures list blockers, attempted paths, and questions requiring human decisions.
    5. Whether the solution structure remains explainable under slight prompt rewrites, rather than collapsing into a fixed template.

    An illustrative acceptance record needs no specific platform—a plain structure suffices:

    1. task_id: invoice-rounding
    2. done: false
    3. blockers:
    4. - Missing business confirmation of rounding rules
    5. - Existing test fixtures lack cross-timezone samples
    6. changed_paths:
    7. - billing/round.py
    8. checks:
    9. - unit: fail (2)
    10. disclosure: explicit
    11. human_decision_needed: true

    “Not done but explicitly disclosed” should be valued above “claims done but hides gaps.” The former can enter a human queue; the latter ships defects into main.

    Failure Disclosure Is an Independent Quality Metric

    A frequently overlooked dimension in coding evaluation: does the model stay silent even when it already knows about a blocker? A better-looking patch with a higher underreporting rate is a net increase in risk. Typical forms of silent failure include: skipping infeasible branches while pretending requirements are met, swallowing errors with broad exceptions, deleting failing test cases to get a pass, and writing “optimize later” in comments without surfacing it in the result summary.

    If mitigations exist only in one interaction shell, teams calling the raw inference API will not automatically inherit the same protection. Disclosure capability must be re-tested on your own call chain, without assuming the upstream interface has it covered. A practical approach: construct a set of guaranteed-unsolvable tasks—missing credentials, dependencies on nonexistent internal APIs, contradictory specs, test data inconsistent with rules. Passing behavior is not fabricating a runnable fake implementation, but refusing to wrap up and identifying the minimum additional information needed.

    Track three ratios separately: explicit failure, silent failure, and false claims of success. Looking only at pass rates systematically rewards the second. In sampling reviews, have engineers who were not involved in prompt design judge task status based solely on the model’s final statement, then compare against the actual repository result; any mismatch counts as a disclosure defect.

    Cost Is Measured per Loop, Not per Call Quote

    Falling prices for input, output, and cache hits do not automatically lower project cost. A coding agent’s bill is determined by turn count, context length, repeated reads, and failed retries. The common high-start-low-finish trajectory: launch demos showcase speed on short tasks, then in real repositories the context fills with logs, dependencies, and historical patches; the model self-checks repeatedly without converging, and cost per effective change quickly exceeds what the price list implied.

    When evaluating cost, fix three workload types instead of running a single demo:

    • Short fixes: single file, tests already exist, expected one to three turns.
    • Cross-module defects: require tracing call chains, allow limited subtask decomposition.
    • Ambiguous requirements: insufficient information; correct behavior is asking questions or stopping, not generating endlessly.

    For each type, record effective change cost: total input and output volume divided by accepted changed lines or closed defects. If a model keeps spinning on the third type, its “low price” is meaningless. Cache hits only pay off when repeated prefixes are stable; frequent system prompt rewrites or indiscriminately stuffing the whole repository into context eliminates cache benefits.

    Control measures should be written into runtime policy rather than relying on model discipline: maximum turns, maximum repeated reads, circuit breaking after consecutive identical errors, and subtasks required to return verifiable artifacts. Subtask prompts themselves need review. Writing only “please check carefully” leaves downstream steps without boundaries; specify inputs, output formats, prohibitions, and fields to return after timeout.

    Code Quality Is More Than “Catching What Others Miss”

    Some models excel at spotting edge-case defects or occasionally proposing creative structures. This is useful, but it cannot replace sound judgment of the whole. In review, separate one-off brilliance from sustained collaboration.

    Local capability signals include: discovering states not covered by tests, preserving event ordering in state-dense scenarios like 3D graphics, interaction logic, or desktop automation, and consolidating repeated boilerplate into clean modules. Global capability shows in: articulating trade-offs among multiple viable approaches, knowing which parts should not be touched, refusing refactors unrelated to the current iteration, and explaining decisions well enough for future maintainers to reproduce them.

    Output convergence is another warning sign. If, after substantially changing the game rules, prompt tone, and runtime environment, the directory structure, naming, and state machines remain almost identical, the model is applying memorized templates instead of reading the constraints. Templates accelerate prototyping but create parallel architectures inside existing codebases—hard to remove after merge.

    Maintainability checks can be concrete: whether public interfaces narrowed, whether error types are distinguishable, whether configuration is externalized, whether untestable global state was introduced, and whether commit messages correspond to actual behavior changes. Poor explanation shows up as lengthy code restatement without stating why a smaller alternative was rejected. Requiring a decision record of no more than a few lines before the patch is usually more effective than a long explanation afterward.

    Evaluation Sets Must Resist “Only Solving Problems”

    Public benchmarks are a suitable floor, not a selection conclusion. Once problems circulate, models or training data may have seen similar forms in various ways. Internal evaluation sets should come from historical defects in your own repositories, de-identified: strip recognizable customer data, credentials, and internal domains. Keep, for each problem, the failure reproduction, post-fix tests, and review comments from the time.

    Group coverage should include: concurrency and timezones, permission boundaries, migration scripts, boundaries between generated and hand-written code, and non-compliant requirements that should be refused. Do not treat “ability to produce inappropriate content” as a capability bonus; enterprise scenarios should verify that refusal, filtering, and auditing are stable. For office document and slide generation, don’t judge only whether the layout looks busy—check whether data comes from given materials, whether conclusions exceed the evidence, and whether chart numbers are traceable.

    When comparing candidates, fix decoding parameters, tool permissions, retry limits, and reviewers. Allow each model its own short system prompt, but publish prompt lengths and tool lists to avoid crediting engineering scaffolding differences to the model. Blind-review patches with model identities hidden, scoring only against the contract. The window from five days to two weeks after release—when hype fades and real tickets appear—is when retesting should be scheduled, rather than locking in a vendor on launch day.

    Production Governance: Shells, Interfaces, and Human Gates

    The same model may behave differently in a chat product, a coding plugin, and the raw API. If one layer adds failure reminders, citation constraints, or retry circuit breakers and another does not, the safety boundary is defined by the weakest call path. Governance recommendations:

    • Default to read-only retrieval and restricted writes, with write scope enforced by path allowlists.
    • Merge requests must pass model-independent tests and human review; model self-assessment cannot serve as a gate.
    • Sample silent failures in production; alert on the rate of “claimed success but failed checks,” not just latency and error codes.
    • Retain minimal audit fields for prompts, tool calls, and final statements to distinguish spec problems from model problems afterward.
    • Re-run the three internal workload types on price or version changes; do not reuse old conclusions.

    Separate team roles as well. Those using the model to speed up should not be the sole reviewers. Review checklists should emphasize whether blockers were written out, whether tests target this change, and whether unrelated refactors were rejected. On systemic issues, first tighten tool permissions and turn limits before considering a model switch; much of “the model got dumber” is actually context pollution and missing stop conditions.

    An Actionable Selection Conclusion

    Distill these practices into conclusions a decision meeting can use, not slogans. Keep one page per candidate: completion rates across the three workload types, silent failure rate, effective change cost, top review rejection reasons, and whether circuit breakers triggered as expected. If a candidate refuses to stop on ambiguous tasks or frequently claims success on guaranteed-failure problems, it should not enter unattended write-permission workflows—even with higher benchmark scores.

    Scores, speed, and price are screening thresholds, not acceptance criteria. The ability to catch hidden defects or occasionally propose better structures justifies use on controlled tasks; if the same model also self-loops, cannot explain its decisions, or homogenizes output across different requirements, restrict it to assisted diagnosis and draft generation, keeping merge authority with humans and automated checks. Only by enclosing capabilities in auditable boundaries—contracts, disclosure metrics, and circuit-breaker policies—do coding models graduate from demo hype to stable engineering tools.