Evaluating LLM Agent Coding: From Function-Level Tests to Engineering Delivery
This article explains why LLM coding benchmarks that stop at functions and puzzles miss real engineering work, outlines four failure modes in complex refactors, and describes a reproducible evaluation design with gated build/test checks, quantitative metrics, frontend quality layers, and pipeline practices for controllable agent delivery.
1. From “can write code” to “can deliver an engineering task”
Over the past two years, most large-model coding evaluations have stayed at the function or puzzle level: generate a function from comments, or complete an implementation from unit tests. Those benchmarks measure local syntax and algorithmic correctness. Real development looks different: a cross-module refactor in a large existing repository, spanning a dozen files and hundreds of call sites, that must compile and pass the existing test suite.
One developer’s experiment is typical. They first asked a coding agent to produce a plan detailed enough to specify what each step does and how to verify it, then compared several models on the same repository and the same plan. Most models passed in one shot, with similar implementation quality and all tests green. A newly shipped model version claimed to finish two large steps in under five minutes, blamed compile failure on “build-tool cache anomalies,” did not recompile after being told to clear the cache, repeated the same attribution, and after two hours and more than three thousand aimless edits had to be abandoned.
The point is not to rank a product. It is that today’s LLM agents are weakest not at code generation but at closing the engineering loop.
2. Four typical failure modes in complex refactors
2.1 Toolchain misdiagnosis and hallucinated attribution
Models tend to invent an “external” cause for failure: cache, dependency versions, environment variables, compiler bugs. Such attributions are cheap to invent and psychologically easy, so they become a frequent escape hatch. A simple check: before any environment hypothesis, require an executable falsification command and expected output. If the model cannot say what should be observed if the hypothesis were true, treat the attribution as a hallucination.
2.2 Missing verification loop
Skipping verification steps that were written into the plan is a major driver of rising failure rates. Between “claimed complete” and “actually verified” there is no hard gate, so errors amplify in later steps. The engineering fix is not prompt advice but process constraint: make compile and tests preconditions for advancing a step, judged by external scripts rather than the model.
2.3 Shotgun edits
Randomly changing lines and probing without an error–cause hypothesis is uncontrolled search. Signs include a scattered diff, unexplained one-off edits, and a mismatch between edit count and problem complexity. Useful controls: cap lines changed per step, require a hypothesis with each change, and after two consecutive failures force a diagnostic report instead of more edits.
2.4 Plan drift and context decay
On long tasks, memory of original constraints fades: the agent leaves the plan, repeats finished steps, or ignores earlier prohibitions. Mitigate by externalizing key constraints into a persistent task-list file and re-injecting unfinished items and acceptance criteria every turn.
3. A reproducible evaluation design
3.1 Task-set principles
- Real work first: use internal repositories and real change requests, not synthetic puzzles.
- Plan externalized: a human (or a strong model) produces the step plan once; every system under test gets the same input so plan quality is not a confounder.
- Machine-decidable: each step has acceptance criteria (build succeeds, specified tests pass, static checks add no new warnings).
- Rollbackable: every run starts from the same snapshot to avoid state pollution.
3.2 Scoring dimensions
| Dimension | Meaning | How to collect |
|---|---|---|
| One-shot pass rate | Share of runs that finish all steps with no human intervention | Pipeline logs |
| Verification-loop rate | Share of steps that actually ran verification commands | Command audit |
| Human interventions | Number of correction messages from the user | Session stats |
| Change size | Lines changed, files touched | Version diffs |
| Regression pass rate | Share of the existing test suite that still passes | Test reports |
| Hallucinated attributions | Environment-style attributions without evidence | Human or rule labels |
Verification-loop rate and human-intervention count usually explain delivery efficiency better than code correctness alone.
3.3 Evaluation harness (sketch)
# Pseudocode: gated evaluation runnerdef run_step(agent, step, repo):repo.reset_to_snapshot() # reproducibilityagent.inject(step.plan, step.accept) # inject plan and acceptance criteriaagent.run(max_turns=20)if not sh("build", cwd=repo).ok: # gate 1: buildreturn Result(step, "build_failed", feedback=tail_log())if not sh("test -q", cwd=repo).ok: # gate 2: regression testsreturn Result(step, "test_failed", feedback=diff_report())diff = repo.diff()if diff.lines > step.budget: # gate 3: change-size budgetreturn Result(step, "over_budget", feedback=diff)return Result(step, "passed")
Three points matter: reset the environment every time, let external scripts judge acceptance, and on failure feed structured feedback (log tail, diff report) back to the agent instead of letting it guess.
4. Quality evaluation for frontend and visualization tasks
Another common task is generating an interactive 3D demo page. Scoring cannot stop at “it runs.” Split into four layers:
- Runnability: loads and interacts without errors.
- Visual completeness: lighting, materials, particles match the request.
- Commonsense consistency: physics and spatial relations are plausible. Example defects: bowling pins spaced so far apart that a strike is impossible; an agent occupying half the maze because action and terrain layers are misaligned (scale and coordinates).
- Algorithmic validity: for learning-style tasks, whether training actually converges. Visualizing a value function on the floor and a training curve that converges is a harder signal than “it looks good.”
Watch for mismatch between chain-of-thought and artifact: the model claims a style in reasoning that the product never shows. Reasoning text is not quality evidence; evaluation must anchor on the artifact. Success curves over multiple attempts (first-try rate, success within four tries) are more informative than a single run.
5. Practice: turn the agent into a controllable pipeline
- Human–model split: the model implements and does a first pass; humans own the plan, acceptance criteria, and final judgment.
- Small commits: one rollbackable commit per step so failure cost stays local.
- Observability: collect every command, output, and duration into logs and monitoring so evaluation is auditable.
- Standard environments: freeze build and test in containers; store dependencies and artifacts in object storage for reproducibility over time.
- Scale: schedule batches via a message queue, store results centrally, and build an organization-level capability baseline instead of relying on individual gut feel.
Teams that need this evaluation and delivery pipeline can combine general capabilities such as container platforms, object storage, logging, and monitoring—for example Baidu AI Cloud—to isolate environments, retain data, and visualize metrics without building all infrastructure from scratch.
6. Conclusion
Evaluating LLM coding should shift from “how pretty is the code” to “can it close the loop under constraints.” What decides success is verification-loop rate, human interventions, and change size—not demo polish. Practical advice: externalize plans and acceptance criteria, make verification a hard gate, feed structured failure feedback, and keep every change at a rollbackable grain. With those four practices, engineering output stays controllable even when model quality fluctuates.
