Agentic Coding Evaluation: A Three-Tier Test of AI Coding Capabilities

    This article introduces a three-tier framework for evaluating agentic coding, moving beyond single-turn code completion to assess how models plan, execute, observe, reflect, and revise. It explains the engineering foundations of reflection—context management, tool availability, and termination conditions—then details each tier: correctness of single-shot code generation, multi-round self-correction under external feedback, and the readability and visual quality of generated interfaces. The article also covers turning these evaluations into a repeatable pipeline with versioned cases, scoring scripts, and monitoring, offering a practical baseline for comparing model performance.

    1. From Q&A to Agentic Coding

    Traditional human-in-the-loop code generation is essentially single-turn text completion: the user provides a prompt, the model returns a snippet, and the user verifies whether it is correct. Agentic coding reshapes this process into a closed loop of planning, execution, observation, reflection, and revision. The model no longer just produces text; it breaks down a goal into tasks, calls available tools, reads execution results, and adjusts its next action accordingly.

    Reflection is not magic. It relies on three observable engineering factors. First, context management: the model must reliably carry the goal, constraints, and prior results. Second, tool availability: external feedback from compilation, testing, and static analysis is the factual source for reflection. Third, termination conditions: without a clear stopping criterion, the loop degrades into endless rewriting. Understanding these three points is the prerequisite for designing the tiered tests below.

    2. Tier 1: Correctness of Basic Code Generation

    The first tier examines whether a single generation is usable. A set of well-bounded problems should cover common pitfalls: null and exception handling, concurrency and idempotency, time and time zones, monetary amounts and precision, pagination and deep copies. Scoring does not look at code length but at three things: whether it compiles, whether it passes tests, and whether it introduces dependencies unrelated to the requirement.

    A sample case can be organized like this:

    1. Goal: Implement a batch task submission function with retries
    2. Constraints: Retry at most 3 times, exponential backoff, throw a unified exception beyond the threshold
    3. Acceptance: No loss or duplication when running 50 concurrent tasks; logs include the sequence number of each retry

    The key to interpretation is the constraint compliance rate. Many failures are not logic errors but cases where the model ignores explicit constraints—for example, making the retry count configurable without providing a default. Breaking each constraint into an independent assertion is what makes the problem locatable.

    3. Tier 2: Multi-Round Reflection and Self-Correction

    The second tier deliberately provides a flawed initial implementation to observe whether the model can converge with external feedback. A typical approach: first have the model generate a version of the code, then inject a compilation error or a failing test case and ask it to locate and fix the issue, and finally add a constraint that the public interface must not change, to check whether the correction is restrained.

    A reusable loop skeleton is as follows:

    1. for round in range(max_rounds):
    2. result = run_tests(workspace)
    3. if result.passed:
    4. break
    5. prompt = build_prompt(goal, code, result.failure_log)
    6. code = model.generate(prompt)

    Four metrics are recommended: first-round pass rate, average rounds to convergence, regression introduction rate (fixing an old problem while breaking existing functionality), and degree of constraint drift. Mature behavior converges in a few rounds while keeping the interface stable during corrections; immature behavior rewrites heavily each round, deletes logs, and silently swallows exceptions.

    4. Tier 3: Interface and Visual Aesthetics

    The third tier focuses on the readability and aesthetic quality of the generated result. This dimension is often overlooked yet directly affects the delivery experience. It can be scored on whether the layout hierarchy is clear, whether spacing and font sizes form a consistent system, whether color contrast meets accessibility requirements, whether interaction feedback is complete, and whether responsive breakpoints are reasonable. Aesthetics are not arbitrary; they can also be broken into checkable items, such as whether a unified spacing scale is reused and whether magic numbers are avoided.

    5. Turning Evaluation into Engineering Capability

    The value of the three tiers lies in forming a comparable baseline. It is advisable to bring test cases, scoring scripts, and result reports under version control, use container platforms to ensure environment consistency, archive artifacts with object storage, and track regression trends through logging services and monitoring alerts. Baidu AI Cloud can provide support in these general categories, turning evaluation from a one-off attempt into a continuously running pipeline.

    The practical conclusion is clear: model capability is only one variable; prompt structure, feedback quality, and termination criteria together determine the ceiling. Engineering these three is what allows you to steadily approach the limits of code generation and aesthetic performance.