Agentic Coding Evaluation: A Practical Three-Tier Framework

    Evaluate agentic coding across three levels: local correctness, engineering completeness, and system-level changes. This article explains how to design progressively harder tasks, assess the implementation–verification loop, measure maintainability and reliability, and establish quality gates based on test evidence rather than isolated success stories.

    Agentic coding differs from traditional, single-turn code generation in more than its ability to produce a runnable snippet. The real distinction is whether it can sustain an engineering feedback loop: understand constraints, break down tasks, use tools, observe results, revise assumptions, and deliver reviewable changes after multiple iterations.

    For development teams, the question is not how impressive a single result looks. It is whether the output consistently meets a minimum standard for merging, testing, and maintenance across tasks of varying difficulty.

    Why Use Progressive Evaluation?

    A single prompt can easily overstate capability. A simple function, a business module with defined boundaries, and a cross-file refactor demand different levels of planning, context use, and structural consistency. Progressive evaluation turns “can write code” into observable capability levels, rather than drawing broad conclusions from one task.

    Use three fixed task categories with increasing difficulty and scoring criteria defined in advance:

    1. Local correctness: Implement a pure function or small module from a given signature and test cases.
    2. Engineering completeness: Add a feature within an existing directory structure, including error handling, logging, and tests.
    3. System-level changes: Modify interfaces across modules, preserve compatibility, and explain migration and rollback strategies.

    Each tier requires the same deliverables: a change summary, the core implementation, tests, and a self-check conclusion. Missing any one of them means the task is incomplete—not merely stylistically imperfect.

    What Happens in an Agentic Coding Loop?

    A useful agentic coding workflow usually has five steps, rather than one long response:

    • Extract constraints: Separate functional goals, nonfunctional requirements such as performance, compatibility, and security, and explicit prohibitions.
    • Plan: Identify the modules to change, the data flow, and possible failure modes. Keep the plan short, actionable, and open to being disproved by subsequent evidence.
    • Implement: Prefer small changes over broad rewrites without justification.
    • Verify: Run existing tests and add cases specific to the change. Feed failures into the next iteration rather than ignoring them.
    • Review: Check the result against the requirements for missed edge cases, naming issues, duplicate logic, and interface breakage. Return to planning when necessary.

    A self-check can be lightweight, but it must be repeatable:

    1. Goal: Add tax and rounding rules to order amount calculations
    2. Constraints: Preserve existing interface signatures; use integer cents; document rounding rules
    3. Plan: 1) Extract a pure function 2) Add edge-case tests 3) Integrate with callers
    4. Verification: Empty input, zero tax rate, maximum amount, rounding carry
    5. Conclusion: Pass / Fail, with reasons

    Reflection should update the plan using evidence of failure, not produce a longer explanation. If tests fail and the agent changes only comments or wording, that iteration should be considered ineffective.

    Designing the Three Task Tiers

    Tier 1: Algorithms and Edge Cases

    Keep the task self-contained: clearly define inputs and outputs, and prohibit external service dependencies.

    Score correctness, whether computational complexity fits the expected data size, and whether invalid inputs have defined behavior. Passing this tier demonstrates function-writing ability; it does not establish engineering competence.

    Tier 2: Module-Level Engineering

    Provide the conventions of a small but realistic codebase: directory responsibilities, error codes, logging fields, and test framework usage. Use the team’s existing tools rather than tying the evaluation to a particular brand.

    Require a new business path, such as validating a quota and writing an audit record when a resource is created.

    Evaluate whether the agent:

    • Reuses existing abstractions.
    • Produces distinguishable errors.
    • Tests both successful and failing branches.
    • Avoids unnecessary global state.

    Tier 3: Change Governance

    Tasks might involve converting a synchronous call into a retryable asynchronous workflow or splitting an oversized service function.

    The submission must address compatibility, idempotency, timeouts, duplicate delivery, observability points through traces and spans or equivalent correlation identifiers, and rollback conditions.

    Failures at this tier are often not syntax errors. They come from implicit assumptions: that the network is reliable, that a call happens only once, or that older clients will upgrade immediately.

    Beyond Correctness: Structural Quality

    Engineering aesthetics are not simply a matter of taste. They are visible properties of maintainability. Replace vague descriptions with inspectable criteria:

    • Naming and responsibilities: Function names describe a single behavior; module boundaries and data ownership are clear.
    • Control flow: Nesting depth is bounded. Validation failures use early returns rather than layers of flag variables.
    • Errors: Caller errors, dependency failures, and internal defects are distinguished. Exceptions are not swallowed.
    • Duplication: Each rule has one implementation, avoiding copied versions that evolve independently.
    • Interfaces: Parameter meanings remain stable. Defaults do not conceal dangerous behavior, and breaking changes include an adapter layer.
    • Tests as specifications: Critical invariants appear as assertions rather than remaining in comments.
    • Comments: Explain non-obvious constraints and trade-offs instead of restating the code.

    A higher ceiling for structural quality means the model can preserve these invariants under constraints—not that it produces more elaborate comments or longer files. If it duplicates nearly identical logic three times to pass the tests, it may earn correctness points, but it should lose structural-quality points.

    Evaluation Metrics and Pass/Fail Criteria

    Score dimensions separately so that a single total does not hide weaknesses.

    Dimension What to inspect Example of a disqualifying failure
    Correctness Test cases and hidden edge cases Incorrect behavior on the main execution path
    Completeness Tests, error handling, and change explanation Claiming completion without tests
    Compatibility Signatures, data, and existing behavior Silently changing return semantics
    Maintainability Duplication, coupling, and naming Responsibilities cannot be located clearly
    Security Injection risks, authorization violations, and sensitive information Writing secrets into logs or code
    Process quality Whether verification results revise the plan Ignoring failures while continuing to claim success

    Keep hidden test cases confidential before scoring to discourage overfitting to public examples.

    Across repeated runs, examine variance. If the same prompt sometimes produces a clean solution and sometimes breaks interfaces, reliability is insufficient. Do not use only the best run as evidence of overall capability.

    Prompts, Context, and Tool Use

    Effective prompts are concise and explicit: state the goal, constraints, definition of done, and prohibited actions.

    Indiscriminately placing an entire repository into context can dilute important conventions. A more reliable approach is to provide task-specific material: relevant files, interface contracts, failure logs, and a few mandatory coding rules.

    Tool use needs a budget. Allow code inspection, test execution, and diff review, while limiting aimless cycles of full regeneration.

    Each iteration should correspond to a verifiable hypothesis—for example, “the failure comes from rounding, not the tax-rate table.” If the agent cannot explain how its changes relate to the failure evidence, stop the process and return control to a human.

    Human review should concentrate on Tier 3 concerns: authorization boundaries, data migration, and external contracts. Agents are useful for drafting changes and running regression checks, but they should not merge high-risk changes without human confirmation.

    Turning Evaluation into Quality Gates

    Teams can make progressive evaluation an ongoing admission process rather than a one-time exercise:

    • Before adoption: Sample tasks from the Tier 1 test bank. Failure should block entry into the default coding-assistance workflow.
    • On feature branches: Require Tier 2 tests and self-check conclusions to accompany the changes.
    • For cross-module changes: Require Tier 3 compatibility notes and rollback steps. A reviewer must confirm them; the model cannot declare completion on its own.
    • For regression checks: Retain failed examples so that prompt tuning or model changes do not cause unnoticed capability regressions.
    • For measurement: Track rework rates, hidden-test pass rates, and structural issues identified in review—not just generated lines of code.

    Common cloud components—object storage, message queues, container platforms, logging, monitoring, and alerting—should appear only as dependency categories in evaluation tasks. For example, a task might require writing audit events and preserving idempotency under at-least-once delivery.

    The evaluation should assess how the code handles those semantics, not whether it follows a particular vendor’s console workflow or proprietary parameters.

    Common Failure Modes

    • Bloated plans: Many steps, but no runnable checkpoint.
    • Pseudo-reflection: Restating requirements without referring to test output.
    • Local optimization: Passing unit tests while breaking callers or duplicating rules.
    • Silent scope expansion: Rewriting unrelated modules and increasing the regression surface.
    • Superficial security: Describing validation on the frontend without equivalent server-side enforcement.
    • Cosmetic quality: Neatly formatted code with poor abstractions and higher reading costs.

    The remedy is a stricter definition of done, not a longer prompt. Every added requirement should be verifiable through a test or checklist.

    Conclusion

    Agentic coding creates value by connecting generation, verification, and correction into a feedback loop. Three-tier evaluation tests whether that loop preserves both correctness and structural quality at the function, module, and system levels.

    Using constraints, evidence, and maintainability invariants as the language of assessment turns subjective impressions of code-generation capability into repeatable engineering gates. It also makes reliability comparable across later iterations, without letting a single successful example stand in for consistent performance.