How to Evaluate AI Coding Assistants: A Reproducible Benchmark and Cost-Effectiveness Analysis

    This article presents a reproducible method for evaluating AI coding assistants in real engineering workflows. It explains how to fix test conditions such as model version, host environment, network access, and time limits; how to design questions across cognitive levels; and why offline, time-boxed tests change the capability profile. It also introduces a practical cost model based on first-pass acceptance rate and rework hours, a six-step scoring rubric, and common evaluation pitfalls. The goal is to move tool selection from subjective impressions to data-driven measurement.

    1. Why You Need a Reproducible Evaluation Method

    Once AI coding tools become part of the daily development workflow, the question teams ask shifts from “Can we use it?” to “Is it worth using?” The difficulty is that vendor-published benchmark scores often differ significantly from real engineering scenarios, while ad hoc individual trials lack comparability. The first goal of an evaluation, therefore, is not a single overall score but a process that others can follow and re-run.

    A reproducible evaluation should fix at least four variables: model identifier and version, host runtime environment, whether network access is allowed, and the per-question time limit. Putting these four items at the top of the report lets readers judge the scope in which the conclusions apply. The original hands-on record is a good model to follow: it clearly states the model identifier, the host as an agent development framework of a specific AI coding tool, the test time window, network access disabled throughout, a 30-minute limit per question, and a total of about 43 minutes across six questions. This “exam condition sheet” is itself part of the credibility of the conclusions.

    It is worth emphasizing that the test questions should cover different cognitive levels rather than being all algorithm problems. A reasonable distribution is: identity and boundary questions (self-description and knowledge scope), information extraction, code generation, refactoring, debugging, and long-context tasks. The further down this list, the more likely the test is to expose weaknesses that appear in real engineering work.

    2. Identity Questions: Separating “What the Model Says” from “What Is True”

    The first question usually asks about the model’s identity, version, and knowledge cutoff. The value of this type of question lies not in the answer itself but in observing whether the model’s expression is honest and whether it distinguishes “information provided by the environment” from “self-introspection.”

    A mature answer should contain three layers of information: first, the model identifier and host environment; second, a statement that the knowledge cutoff comes from the system prompt of the runtime environment rather than from the model’s self-perception; third, an explanation of how sparse memory is near the time boundary—for example, the closer to the cutoff date, the fewer details can be recalled. In the original record, the model explicitly states that “the above information comes from the system prompt of the runtime environment and is not introspected,” and adds that memories near the cutoff are fragmentary. This is exactly the kind of phrasing an evaluation hopes to see.

    The engineering takeaway is clear: any conclusion that depends on timeliness should not be based on the model’s self-description, but should be obtained through retrieval augmentation, an external knowledge base, or tool calls, with the information source and effective time explicitly declared in the system prompt. An illustrative constraint is shown below:

    1. Rules:
    2. 1. For time-sensitive facts, you must call the retrieval tool; answering from memory is prohibited.
    3. 2. Label the information source and retrieval time in the answer.
    4. 3. If the tool is unavailable, reply explicitly "Cannot confirm"; do not speculate.

    3. No Network and Time Limits: How Two Constraints Change the Capability Profile

    Disabling network access removes the shortcut of “falling back on search,” so the model must rely on parameterized knowledge and reasoning to complete tasks. Three common phenomena appear in this setting: biased memory of parameters for obscure APIs, insensitivity to version differences, and a tendency to produce call patterns that “look reasonable.” Offline testing is therefore better suited to assessing code skeleton capability and logical reasoning than to assessing the accuracy of ecosystem details.

    Time limits turn the evaluation from a single quality metric into a dual quality-latency metric. The distribution of 30 minutes per question and about 43 minutes total across six questions shows that the model converges quickly on simple questions, with most of the time spent on questions requiring multi-step reasoning and self-verification. In practice, it is recommended to record three time measurements: time to first token, time to the first runnable version, and time to the final version. Only the third measurement is directly related to labor cost.

    4. The Right Way to Calculate Cost-Effectiveness: From “Unit Price” to “Cost per Unit of Effective Output”

    Cost-effectiveness is often simplified to price per million tokens, which is nearly unusable in engineering. A model closer to reality is as follows:

    1. Cost per unit of effective output = (API cost + rework hours × labor rate) / accepted output
    2. Accepted output = number of generation tasks × first-pass acceptance rate

    Here, “first-pass acceptance rate” refers to the proportion of outputs that pass compilation, unit tests, and review without manual modification. If a solution has a lower unit price but a significantly lower first-pass acceptance rate, rework hours will often swallow the entire price advantage. It is recommended that teams use 20 to 50 real existing tickets for small-scale calibration to obtain their own first-pass acceptance rate and average rework time, then plug them into the calculation.

    A risk cost item should also be introduced: outputs involving permissions, data deletion, or production changes carry far higher error costs than ordinary business code and should be weighted in scoring rather than treated the same as front-end styling code.

    5. A Practical Evaluation Process and Scoring Sheet

    A recommended five-step process: select questions (by cognitive-level ratio), freeze the environment (version, no network, time limit), have two people score independently, review disputed questions, and archive the conclusions. The scoring dimensions should be fixed at six: functional correctness, runnability, boundary handling, readability, security, and latency. Each item uses a 0–3 scale, with a veto rule that “if a security anti-pattern exists, that item is scored zero directly.”

    When archiving, retain the original conversations, time distribution, and failure samples. Failure samples are more valuable than success samples because they usually point to three types of systemic problems: forgetting key constraints due to overly long context, misjudging priorities when instructions conflict, and low-level errors caused by the absence of a self-check step.

    6. Common Pitfalls

    First, treating demo performance as production capability and ignoring stability under long context and multi-round revisions. Second, looking only at generation speed while ignoring review and rework costs. Third, evaluating ecosystem details under no-network conditions and drawing the overgeneralized conclusion of “insufficient capability.” Fourth, lacking version freezing, which makes conclusions impossible to re-run. Fifth, treating the model’s self-description as a source of truth.

    7. Conclusion

    Evaluating AI coding assistants should be treated as an engineering measurement task: first fix the conditions, then design questions by cognitive level, then convert real cost using “first-pass acceptance rate + rework hours,” and finally turn failure samples into inputs for improvement. In related engineering practice at Baidu AI Cloud, this method can be combined with general cloud product capabilities such as log services, monitoring and alerting, and container platforms to continuously collect evaluation data as observable metrics, moving tool selection from subjective experience toward data-driven decisions.