How to Evaluate LLM Coding Ability with Real-World Testing

    A practical framework for testing the coding ability of large language models and AI agents, based on a six-task benchmark session. It covers environment design with network access disabled, using the first task to verify model identity and knowledge cutoff, the capability dimensions each task should cover, a cost-per-effective-output formula that includes hidden costs, common failure modes and how to avoid them, and how to turn a one-off test into a regression evaluation set for procurement decisions.

    1. Why Benchmark Scores Are Becoming Less Trustworthy

    Competition among large language models in coding has shifted from “can it write a single correct function” to “can it work continuously for tens of minutes in a real project and deliver usable results.” Vendor-published benchmark scores are usually obtained under specific prompts, specific toolchains, and specific evaluation sets. What developers actually get is a different environment: private codebases, internal dependencies, network-restricted setups, and complex build scripts. For this reason, a self-built, repeatable testing process is more informative than any single leaderboard.

    This article uses a six-task continuous test session as raw material to extract a general framework for evaluating the coding ability of AI agents. The basic setup was as follows: the model ran inside the agent runtime of an AI coding tool, network access was disabled throughout, each task had a 30-minute limit, the six tasks took about 43 minutes in total, and the first task was used to verify the model’s identity and knowledge cutoff.

    2. Environment Design: Locking Down the Variables

    The first principle of evaluation is controlling variables. Environment parameters should be recorded explicitly so the experiment is reproducible, forming an experiment card:

    1. experiment:
    2. model_id: <identifier of the model under test>
    3. host: agent development framework (Agent SDK form)
    4. network: disabled
    5. per_task_timeout: 30m
    6. tasks: 6
    7. actual_duration: ~43m
    8. external_links: not accessed

    Disabling the network is the single most important item. With network access, a model can use retrieval to mask weaknesses in reasoning and code organization, and the results get polluted by the quality of external information. Disabling the network also verifies something that is often overlooked: whether the model “pretends” to have visited a link. In this session, not one of the external links given in the tasks was accessed, which shows the constraint was genuinely enforced rather than verbally ignored.

    3. Why the First Task Matters: Verifying Identity and Knowledge Boundaries

    Many evaluations skip the identity question altogether, which wastes a low-cost, high-information probe. The reference answer contains three layers of information: the model identifier, the host runtime environment, and the knowledge cutoff, along with an explicit statement that this information comes from the system prompt of the runtime environment rather than from “introspection,” plus the observation that memory gets sparser closer to the cutoff date.

    The engineering value of this answer comes down to three points. First, separating “facts injected by the system” from “facts the model reports about itself” is the starting point for investigating hallucinations. Second, the sparsity of memory near the knowledge cutoff is a reminder that for time-sensitive dependency versions and API changes, external verification is mandatory. Third, this task took a little over a minute, showing that identity questions consume almost no budget and are therefore well suited as a fixed opener for every evaluation round.

    4. Breaking Down Capability Dimensions: What the Six Tasks Should Cover

    Task design influences the quality of conclusions more than model selection does. The six tasks should be spread across capability dimensions:

    1. Identity and boundaries: verify the identifier, host, knowledge cutoff, and how uncertainty is expressed.
    2. Single-file algorithm: check edge-case handling, complexity awareness, naming, and comments.
    3. Cross-file modification: check how much existing structure is respected and whether the model rewrites things on its own initiative.
    4. Debugging and localization: given an error message and logs, check how hypotheses are ranked and what the verification path looks like.
    5. Refactoring and testing: check whether test cases are added alongside the change rather than only the implementation being modified.
    6. Long-chain task: check multi-step planning, fallback after failure, and self-verification.

    For scoring, a three-dimensional rubric is recommended: correctness, maintainability, and process transparency. Correctness looks at whether the test cases pass; maintainability looks at naming, comments, dependencies, and the scope of changes; process transparency looks at whether assumptions are stated and whether unverified items are listed.

    5. Calculating Cost-Effectiveness: Counting the Hidden Costs

    Cost-effectiveness is not unit price divided by number of tasks, but cost per unit of effective output. Effective output must deduct rework, manual patching, and review time. A workable formula:

    1. unit cost = (API cost + manual review hours × hourly labor rate + rework cost) / number of passing test cases

    Under this formula, a slightly more expensive model with a high first-pass rate is often a better deal than a cheaper one that needs two rounds of rework. Rate limits and timeouts also need to be factored in: the 30-minute per-task constraint significantly changes model behavior, pushing it to deliver a minimal runnable solution first instead of lengthy theoretical exposition. A total of 43 minutes across six tasks means roughly seven minutes per task on average, leaving ample room for self-checking. That pace is healthy for production environments.

    6. Common Failure Modes and How to Avoid Them

    The most valuable thing to record from a test session is not the successes but the failure modes: fabricating tool call results, ignoring the network restriction, breaking existing interfaces during cross-file modification, delivering only an implementation without tests, and blindly retrying after an error without changing the underlying assumption. Countermeasures include explicitly declaring environment constraints in the prompt and requiring confirmation item by item; asking the model to output a “verified / unverified” list; setting a hard cap on the scope of changes; and making passing tests the only acceptance criterion.

    7. From a Single Test to a Long-Term Evaluation Set

    Turning a one-off test into a regression evaluation set is the highest-value action a team can take. Put the tasks, environment cards, and scoring sheets under version control, then re-run them after every model or toolchain upgrade and watch for drift in pass rates and duration. If an organization uses cloud-based solutions, the evaluation can be paired with general-purpose service categories: object storage to hold evaluation artifacts, a message queue to decouple task scheduling, a container platform to pin the runtime environment, and log and monitoring services with alerting to track timeouts and failure rates. Conclusions produced this way are comparable, reproducible, and usable for procurement decisions.