Evaluating AI Coding Agents: From Task Success Rate to Engineering Productivity

    This article explains why coding agents need evaluation based on complete development tasks rather than isolated code generation. It covers how to read success rates and composite scores, how to measure correctness, cost, token usage, and latency, how to build realistic task sets and reproducible experiments, how to turn results into selection decisions, and how to set security boundaries for agent evaluation.

    1. Why Coding Agents Need Dedicated Evaluation

    AI coding ability is shifting from generating a piece of code to completing a development task. The former mainly tests whether local code is correct. The latter requires a system to understand requirements, navigate a codebase, locate the problem, modify multiple files, run tests, and adjust based on feedback.

    This means that evaluating a model’s code generation alone is no longer enough to judge its real engineering value. One system may be good at answering algorithm questions but fail to find the right place to make changes in a large codebase. Another may produce incomplete code on its first attempt but gradually fix it using test feedback.

    Coding agent evaluation should therefore use the complete task as its basic unit, covering the entire process from receiving a task to delivering the result. The core questions are:

    • Does the result truly meet the requirements and acceptance criteria?
    • Does it introduce new functional regressions?
    • How many resources did it consume to complete the task?
    • Can it finish the work within the specified time and permission scope?
    • Are the results stable, and can the process be audited?

    The object under evaluation should not be understood simply as a model. It should be defined as a combination of the model, agent orchestration, tool permissions, runtime environment, and resource budget.

    2. Interpreting Scores Correctly: Define What Is Measured Before Discussing High or Low

    2.1 Task success rate is not an absolute scale of general ability

    In evaluations that use binary pass/fail acceptance, task success rate is usually calculated as:

    Task success rate = number of tasks passing acceptance ÷ total number of valid tasks

    This metric is intuitive, but it has clear limits. When a test set focuses on bug fixing, the score mainly reflects repair ability. When it focuses on feature development, the score depends more on requirement understanding, interface design, and cross-file modification.

    Scores from different task sets cannot be compared directly. The same percentage may mean very different things if it reflects different task difficulty, runtime budgets, or acceptance rules. A task success rate from one evaluation should not be read as the probability of successfully handling all real development requirements.

    2.2 Composite indices must disclose their calculation method

    Some evaluation frameworks combine correctness, cost, speed, and other metrics into one composite score. This makes results easier to scan, but it can hide trade-offs.

    For example, a weighting scheme that emphasizes correctness may favor approaches that invest more reasoning and verification resources. A scheme that emphasizes cost may favor shorter, low-consumption approaches. The two results do not contradict each other. They simply optimize for different goals.

    Composite scores should therefore disclose metric definitions, normalization methods, weights, and how missing data is handled. If this information is unclear, readers should not convert a composite score into a task pass rate on their own.

    2.3 Agent environments significantly affect results

    The same underlying model can perform differently under different orchestration approaches. Code search strategy, context trimming, the timing of test execution, retry mechanisms, and the maximum number of execution rounds can all change the final result.

    To avoid misattributing results, evaluation reports should at least describe:

    • The versions of the model and agent configuration;
    • Available tools and permissions;
    • Context and output budgets;
    • Per-task time limits and retry counts;
    • Whether internet access, dependency installation, or human intervention is allowed;
    • The test environment and acceptance rules.

    Without this information, scores are better treated as results of an experiment under specific conditions, not as a permanent ranking of a capability.

    3. From a Single Score to Multidimensional Engineering Evaluation

    3.1 Correctness: more than passing new tests

    Acceptance of a coding task should not only check whether new functionality runs. It should also confirm that existing functionality has not broken.

    A thorough acceptance process usually includes tests for the target feature, related regression tests, build checks, type checks, and necessary static analysis. For high-risk scenarios such as permission control and data processing, add boundary input and exception path checks.

    Acceptance also needs to prevent agents from achieving a superficial pass by deleting assertions, bypassing validation, or modifying test expectations. Acceptance tests should be kept as independent as possible from the workspace the agent can modify. Critical acceptance logic should not be decided by the system under evaluation.

    3.2 Cost: focus on the actual price of successful delivery

    Cost per run is easy to calculate, but it may not reflect business cost. An approach may be cheap per run, but if its failure rate is high, or it requires frequent retries or heavy manual rework, the final cost can still be higher.

    A more informative metric is:

    Cost per successful task = total cost of all evaluated tasks ÷ number of successful tasks

    Total cost can be bounded according to the evaluation goal. It may include model call fees, execution environment fees, retry costs, and manual review costs that can be reliably recorded. Reports should state the cost definition clearly and avoid mixing data with different scopes.

    If no task succeeds, do not report a normal cost-per-success value. Instead, state that the metric cannot produce a finite estimate.

    3.3 Token consumption measures resource use but does not replace cost

    Token consumption helps reveal whether an agent repeatedly reads the same files, produces lengthy analysis, or loops on failure paths.

    However, token count and actual cost are not identical. Input and output may be priced differently, and caching, batch processing, and context reuse can also change costs. Different systems may split text into tokens differently, so cross-system comparisons should explain how tokens were counted.

    Fewer tokens only means lower usage of a certain resource. It does not automatically mean higher delivery quality. A reasonable goal is to reduce wasted reads, repeated reasoning, and retries that yield no benefit, while still meeting correctness requirements.

    3.4 Latency: track both the median and the long tail

    Task completion time should be measured from the start of the task until an acceptable result is produced, not just the time spent generating text. Dependency setup, code search, builds, tests, and retries all affect end-to-end latency.

    Reporting only averages can hide long-tail problems. A few extremely long tasks can significantly affect the real user experience. Track the median, higher percentiles, timeout rate, and time elapsed before failure as well.

    Interactive assisted development prioritizes quick feedback, while offline maintenance tasks can tolerate longer runtimes. The workflow should determine whether latency is acceptable, not a pursuit of the shortest possible time regardless of context.

    4. Building a Task Set That Reflects Real Development

    4.1 Cover real types of work

    A sound task set should include multiple kinds of development activity, such as bug fixes, small feature additions, cross-module changes, test additions, compatibility adjustments, and behavior-preserving refactoring.

    Each task needs a clear starting code state, requirement description, allowed modification scope, and acceptance criteria. Vague task descriptions mix ambiguity in understanding into the capability assessment, which makes failures hard to explain.

    For tasks that admit multiple reasonable implementations, acceptance should focus on observable behavior rather than require a specific internal code structure.

    4.2 Stratify by difficulty and risk

    Task difficulty should not be determined only by the number of lines changed. A small change may involve complex concurrency semantics, while a large volume of mechanical edits may be easy.

    Stratify tasks by requirement clarity, difficulty of locating code, module dependency, verification cost, and business risk. Report results for each layer separately. This reveals whether a system is good at quickly handling simple tasks or can reliably handle complex changes.

    4.3 Prevent test leakage and overfitting

    If tasks and their answers remain public for a long time, evaluation results may be affected by memorization. For internal enterprise evaluation, combine a public practice set, a controlled validation set, and an independent held-out set, and update tasks regularly.

    Restrict access to the held-out set tightly, and never expose acceptance answers to the agent. For tasks extracted from real projects, first remove private and sensitive information, so that keys, personal data, or internal business details do not enter the evaluation environment.

    5. Establishing a Reproduc