Testing Free AI Coding Models: Three Levels That Verify Real Engineering Strength

    As free and low-cost AI coding models reshape how developers work, the key question is no longer which model tops a benchmark, but which one a team can afford and rely on. This article proposes a three-level evaluation framework that turns "usability" into reproducible experiments. Level 1 tests reverse bug localization from a symptom-only prompt under a minimal-diff constraint. Level 2 tests delivering a complete, runnable single-file application with proper iframe sandbox isolation. Level 3 tests multi-step, cross-module refactoring that ends with a fully green regression suite. The article also covers task-level cost accounting, model tiering and retry budgets, and the compliance and quality gates enterprises should set before adopting these tools.

    1. Reframing the Question: From “Who Is Stronger” to “Who Can Afford It and Run It Reliably”

    In the second half of 2026, the center of gravity in the AI coding conversation shifted noticeably. Early on, developers cared about benchmark scores, parameter counts, and whether a model could correctly write a sorting algorithm. Today, what actually makes a team pause is a different set of questions: when does the quota reset, what happens when concurrent requests get throttled, how do you handle an account flagged for abnormal usage, and can the bill be attributed to a specific project cost?

    This shift has real drivers. The dominant way of using a coding assistant is no longer “ask one thing, get one answer.” It is now long sessions with autonomous multi-step execution: reading the repo, laying out a plan, editing multiple files, running tests, reading logs, and iterating again. A single task in this kind of interaction often consumes several times more resources than a traditional Q&A, and the number of turns can multiply when one failure forces a retry. As a result, a model’s real-world usability splits into three orthogonal dimensions:

    • Capability: code comprehension, cross-file localization, fix quality, and coherence across long chains of tasks.
    • Cost: resource consumption per task, retry budget, and the queueing experience under peak concurrency.
    • Sustainability: quota policy, access stability, and compliance and data boundaries.

    The reason free or ultra-low-cost models shook the developer community is that they loosen both the “cost” and “sustainability” constraints at the same time. They turn AI coding back from “a productivity tool that requires a budget approval” into “a scratchpad you can freely try, discard, and redo.” And trial-and-error cost is precisely the scarcest resource in complex engineering work.

    One premise, though, must be emphasized: free does not mean usable, and a low barrier does not mean reliable. This makes evaluation more necessary than ever, not less. The three levels below are a method for turning “usability” from a subjective impression into a reproducible experiment.

    2. Evaluation Framework Overview: Why Design “Levels” Instead of a “Test Set”

    Common model evaluations use standardized test sets: a handful of algorithm problems, some code-completion tasks, and a unit-test pass rate. The advantage is easy cross-comparison; the weakness is a loose connection to real engineering. The hard parts of real development are rarely “writing one line correctly.” They are:

    1. Forming a correct hypothesis under missing information;
    2. Verifying among multiple candidate root causes at minimal cost;
    3. Making a change without introducing new regressions;
    4. Delivering, in one shot, a complete artifact that runs out of the box.

    A more effective approach is to design the evaluation as three progressive levels, each pressing on a single core capability and producing output that can be graded automatically.

    Level Core Capability Tested Key Constraint Judging Method
    Level 1 Reverse localization and root-cause inference No logs, no error, symptom description only Whether the localization is correct + whether the fix diff is minimal
    Level 2 Building a complete, runnable artifact from scratch Single file, one-shot delivery, with sandbox isolation Whether it opens and runs directly + checklist of functional items
    Level 3 Multi-step, long-chain engineering fix Cross-file, cross-module, requires regression verification All tests green + controlled change surface

    3. Level 1: Reverse-Engineering a Bug Without Hints

    3.1 Design Rationale

    This level deliberately strips away all “scaffolding information.” Take a small program with a clear structure that runs locally, and—without filing any issue and without any explanation—inject a defect. For example, zero out a key parameter that affects the kinematics, so the object’s behavior deviates from physical expectations but produces no error of any kind.

    The only input handed to the coding assistant is then the “symptom”:

    1. [Symptom]
    2. After startup, the character hovers at its initial height and does not fall as expected; the entire run produces no exception output or stack trace.
    3. [Expected]
    4. The character should move under gravity after controlled input.
    5. [Change surface]
    6. Only one line in a configuration file was modified.
    7. [Requirements]
    8. 1) Give a list of root-cause hypotheses ranked by likelihood, each with a verifiable criterion;
    9. 2) Provide a minimal verification experiment of no more than 3 steps;
    10. 3) Submit a fix diff containing only the necessary lines;
    11. 4) Explain how to regression-test it.

    3.2 Why This Design Works

    It presses on three capabilities at once, and none of them can be passed by “recalling an answer”:

    • Hypothesis generation: given a zero-clue symptom, can the model think of a systematic root cause such as “a kinematics parameter was zeroed out / a division by zero,” rather than randomly guessing that some function’s logic is wrong?
    • Verification-loop awareness: a good response is not to change code directly, but to first propose criteria that can be distinguished by a minimal experiment (for instance, logging the velocity component at a specific moment).
    • Minimality of the fix: the diff changes only the necessary lines. This point is extremely critical—many models can pass acceptance by “deleting an entire block of logic so the symptom disappears,” and the minimal-diff constraint filters out exactly this kind of pseudo-fix.

    3.3 Suggested Scoring

    • Root-cause hit rate: whether it hits the module that holds the real root cause (not just the surface symptom).
    • Average localization turns: the number of back-and-forth rounds needed from the question to a correct hypothesis, which maps directly to the interaction cost in a real workflow.
    • Lines changed / files changed: a measure of how invasive the fix is.
    • Regression safety: whether the existing test suite stays fully green, with no new failures.

    4. Level 2: Delivering a Complete Single-File Complex Application

    4.1 Task Description

    The second level tests the ability to “deliver a runnable artifact in one shot.” The challenge: implement an automated arena where a front end and a back end compete against each other, using a single HTML file, with requirements that include an embedded code editor, iframe sandbox isolation, a multi-dimensional auto-scoring engine, and a results-visualization dashboard.

    The difficulty here is not syntax but architectural convergence: all dependencies must be inlined, state must be self-managed, and security boundaries must be designed explicitly. The model has to think through the DOM structure, the communication protocol, the scoring dimensions, and the rendering timing all at once—almost a “mini systems design” exercise.

    4.2 Key Engineering Points for Sandbox Isolation

    The sandbox is the part of this problem most prone to mistakes and best at revealing engineering maturity. The core mechanisms and pitfalls:

    • Do not grant the child document same-origin access. Once you add allow-same-origin to the sandbox attribute, the child document becomes same-origin with the parent page and can read the parent’s DOM, localStorage, and cookies—the isolation becomes meaningless.
    • Keep only allow-scripts. The child document is then at an opaque origin; accessing localStorage throws an exception, which is expected behavior and should be handled with a fallback in the example code.
    • Inject code with srcdoc rather than src, to avoid introducing external resources and network requests.
    • Validate the message source. When the parent page receives a message, it must validate event.source and impose structural and length constraints on the data.
    • Cap execution resources. Loops, timers, and memory usage must be limited to prevent the child document from freezing the host page.
    • Separate the scoring engine from the execution environment. Run the scoring logic in the parent page (or a separate thread); the child page should only produce structured results, so the scorer is not polluted by the code under test.

    A minimal runnable isolation skeleton:

    1. <iframe id="stage" sandbox="allow-scripts" referrerpolicy="no-referrer"></iframe>
    2. <script>
    3. const stage = document.getElementById('stage');
    4. function run(userCode) {
    5. // The child document is at an opaque origin: it cannot read the parent's DOM / storage / cookies
    6. stage.srcdoc = userCode;
    7. }
    8. window.addEventListener('message', (e) => {
    9. // 1) Accept only messages from this sandbox to prevent injection from any source
    10. if (e.source !== stage.contentWindow) return;
    11. const d = e.data;
    12. // 2) Structural and size constraints to prevent malformed/oversized messages from bogging down the host
    13. if (!d || typeof d.kind !== 'string' || JSON.stringify(d).length > 64 * 1024) return;
    14. switch (d.kind) {
    15. case 'log': console.log('[child]', d.payload); break;
    16. case 'result': renderRadar(normalize(d.payload)); break; // hand off to scoring and dashboard
    17. }
    18. });
    19. </script>

    4.3 Suggested Scoring

    Do not look at the number of lines of code; look at functional completeness and runnability: does it run the moment the file is opened; does the editor work; is the sandbox truly isolated (trying to read localStorage from the code under test should fail); does the multi-dimensional scoring produce stable, reproducible scores; does the dashboard render correctly. Any item that “looks written but doesn’t run” should count as not delivered.

    5. Level 3: Multi-Step Long-Chain Tasks and Context Management

    The first two levels are compressed to “single-point localization” and “single-pass generation.” The third level presses on long-range consistency: a refactor-style fix across multiple files and modules, required to leave the regression tests fully green after the change, without breaking the existing interface contracts.

    5.1 Why Long-Chain Tasks Fail

    The failure usually does not come from coding ability but from state management:

    • Context drift: the code structure read in early turns is forgotten a dozen rounds later, and the model keeps making changes based on outdated assumptions.
    • Local-optimum trap: fixing only the current error and repeatedly “patching,” until the changes spread across a dozen files.
    • Missing verification: without a stable regression loop, the model cannot tell whether it fixed the problem or broke it.
    • Error accumulation: one wrong change is inherited as a settled fact by later rounds.

    5.2 Practical Engineering Countermeasures

    • Plan before executing: force the model to output a change list and impact surface first, then execute step by step.
    • Repo retrieval instead of dumping the whole text: pull in only the relevant symbols, call sites, and configuration to keep the context budget under control.
    • Run a minimal regression set after each change, using the test results as the single source of truth.
    • Change-surface circuit breaker: if the number of files or lines changed in a single task exceeds a threshold, stop and require human confirmation.
    • Atomic commit granularity: make each commit do one thing only, for easy rollback.

    An illustration of layered routing in the scheduler (assigning models by complexity is a key lever for controlling cost):

    1. def route(task):
    2. """Tier models by task complexity to avoid running heavy models on trivial tasks"""
    3. files = count_touched_files(task)
    4. needs_refactor = detect_symbol_rename(task) or detect_api_break(task)
    5. if files <= 1 and not needs_refactor:
    6. return SMALL_MODEL # completion, single-line fixes, formatting, comment generation
    7. if files <= 5 and not needs_refactor:
    8. return MID_MODEL # multi-file fixes within a single module
    9. return STRONG_MODEL # cross-module refactoring, architecture-level changes

    The accompanying autonomous execution loop needs an explicit failure budget rather than infinite retries:

    1. MAX_STEPS, MAX_RETRY, MAX_DIFF_FILES = 40, 2, 8
    2. for step in range(MAX_STEPS):
    3. plan = planner.build_plan(context)
    4. patch = coder.apply(plan, context)
    5. if patch.touched_files > MAX_DIFF_FILES:
    6. return escalate_to_human(patch) # change-surface circuit breaker
    7. result = verifier.run_regression(patch)
    8. if result.all_green:
    9. return commit(patch)
    10. if result.is_flaky():
    11. continue # flaky failures don't count against the retry budget
    12. context = reflector.update(context, result) # write the failure signal back as new context

    The value of reflector here is the most underestimated: it turns “retry after a failure” into “retry with new information,” which is the watershed for the success rate of long-chain tasks.

    6. From “Usable” to “Operable”: The Cost and Quota Perspective

    Free or low-barrier access changes the economics of tasks, but not engineering discipline. What teams really need to build is a task-level cost ledger:

    • Per-task consumption: record each task’s input/output volume, number of turns, and retry count, aggregated by project.
    • Retry budget: set a retry ceiling for each task type, escalating to a human once it is exceeded, so a single exploratory run does not eat up a whole week’s quota.
    • Cache reuse: cache stable repo-retrieval results, build outputs, and test results to avoid re-consuming them in long sessions.
    • Peak-valley scheduling: place deferrable tasks—batch refactors and large-scale comment backfilling—in low-load windows.
    • Failure attribution: split failures into “insufficient model capability” and “wrong context supplied.” In practice the latter is often the larger share, and it is a process problem that switching models cannot solve.

    It is important to be clear-eyed: quota resets, access policies, and concurrency limits are all supply-side variables, and a team cannot eliminate this kind of uncertainty by switching models. Architecturally, therefore, you should preserve a replaceable model-access layer—one that uniformly wraps prompt templates, tool-calling protocols, evaluation sets, and the regression pipeline, so a model can be swapped without touching business code. That is the right posture for coping with supply volatility.

    7. Enterprise Adoption: Compliance and Quality First

    In team and enterprise settings, capability evaluation is only the first gate; three more must follow:

    1. Data boundaries: whether code, configuration, and logs may leave the environment; how to define the scope that needs to be redacted; and whether a private or dedicated deployment form is required.
    2. Auditability: whether commits generated or modified by AI can be identified, traced, and rolled back; and how approval and accountability are defined.
    3. Quality gates: AI output must go into the existing pipeline—static checks, unit tests, coverage thresholds, and security scanning, with none omitted. The role of human review shifts accordingly: from reading line by line to validating intent consistency and the reasonableness of the change surface.

    When building this kind of platform in the cloud, you typically just combine general-purpose capabilities and do not need to build heavy assets yourself: a container platform hosts the execution and evaluation sandboxes, object storage holds the evaluation sets and build artifacts, log services and monitoring handle quota-consumption and failure-rate observation, and a message queue smooths out batch-task peaks and valleys. Cloud providers such as Baidu AI Cloud offer the above general-category capabilities; teams can choose a public-cloud managed form or a private deployment according to their own compliance requirements. The key is to write three design principles into the platform architecture—replaceable models, reproducible evaluation, and attributable cost—rather than binding to any single model supplier.

    8. Summary: A Directly Executable Action Checklist

    • Use symptom injection for localization evaluations, constraining to “no logs, minimal diff,” and watch the root-cause hit rate and interaction turns.
    • Use complete single-file delivery for generation evaluations, focusing on whether the sandbox is truly isolated (do not grant same-origin access, validate the message source, cap execution resources).
    • Use cross-module refactoring + fully green regression for long-chain evaluations, focusing on whether the context drifts and whether the change surface stays controllable.
    • Establish model tiering and routing and a retry budget, reserving heavy models for genuinely complex problems.
    • Build a cost ledger for each task, splitting failures into model problems and context problems.
    • Keep the model-access layer replaceable, and run regressions against a unified evaluation set to withstand fluctuations in quota and access policy.
    • On the enterprise side, define data boundaries, audit requirements, and quality gates first, then talk about selection and rollout.

    The conclusion is not complicated: once model capability reaches the top tier, what determines the actual developer experience is no longer “how smart it is,” but “how stable it is in a real engineering context, how low the cost per task is, and how much fault tolerance my pipeline has when supply fluctuates.” Turn evaluation into reproducible levels, turn cost into attributable data, and turn the model into a replaceable component—do these three things well, and no matter how the supply side changes, your team’s productivity curve can keep trending up.