Large Language Models for Long-Horizon Coding: How to Evaluate Them Systematically

    This article explains how to evaluate large language models on long-horizon software engineering tasks. It argues that one-shot code generation does not prove full development ability. It covers evaluation dimensions, a legacy-project case and a from-scratch learning game case, security acceptance checks, and a four-layer acceptance process.

    When evaluating a large language model for software engineering, the most common mistake is equating one-shot code generation with complete development capability. A model that produces syntactically correct code does not necessarily understand the history of an existing project, follow its established architecture, or handle exception paths. It certainly does not mean the final deliverable is reliably secure.

    A more useful evaluation places the model in an environment close to real work. It then observes whether the model can continuously read code, analyze requirements, break down tasks, modify multiple modules, run tests, locate problems, and advance the system to a runnable state after several rounds of feedback. By this standard, current next-generation large models have made clear progress on long-horizon programming tasks. However, a significant gap remains between “being able to complete a task” and “being able to go live without human review.”

    1. Shift the Evaluation Focus from Single-Point Generation to Complete Delivery

    Traditional code benchmarks usually focus on local metrics, such as accuracy on algorithm problems, code completion accuracy, or unit test pass rate. These metrics reflect basic model capability, but they are not enough to show whether a model is suitable for real projects.

    Production development typically includes the following stages:

    1. Understanding context: Reading the directory structure, data models, interface conventions, existing tests, and historical implementations.
    2. Clarifying requirement boundaries: Identifying what must be implemented, what is optional optimization, and what may carry security risks.
    3. Designing the change plan: Determining the scope of changes, dependencies, data flows, and rollback methods.
    4. Implementing across modules: Adjusting backend logic, database schemas, task workflows, frontend interactions, and documentation together.
    5. Running and verifying: Executing builds, tests, static checks, and browser or API verification.
    6. Handling feedback: Continuing to revise based on error logs and acceptance comments, rather than stopping at the first generated result.

    When evaluating a model, therefore, focus on whether it can maintain task state, keep a consistent design goal over a long period, and proactively detect deviations between the implementation and the requirements.

    2. Complex Legacy Projects Best Test a Model’s Engineering Ability

    The first typical scenario is adding user image asset import to an existing project with historical code, and letting HTML animation scenarios reference those assets. On the surface, this requirement only adds an upload entry and display logic. In practice, it often involves several layers:

    • Where assets are stored and how long they live;
    • File type, size, and content validation;
    • User identity and resource ownership;
    • Database records and task status;
    • Frontend and backend interface contracts;
    • Resource access during animation rendering;
    • Retry, deletion, and cleanup mechanisms;
    • Audit logs and exception handling.

    If a model only modifies a page and one interface, it may produce a result that looks usable but misses problems such as unauthorized resource access, path traversal, arbitrary file access, or cross-user references. Valuable behavior means the model first builds an overview of the whole system, then determines which boundaries the feature should sit within.

    For this type of task, the model’s performance can be assessed from four observation points.

    1. Whether it can accurately locate the scope of changes

    A strong model does not start by rewriting large parts of the codebase. Instead, it looks for the domain model, interface entry points, task scheduling, resource access, and rendering pipeline. It should explain why each change point is needed and keep changes minimal and consistent with the existing project style.

    If a model frequently creates duplicate data structures, bypasses the existing service layer, or modifies low-level logic without understanding its dependencies, its overall understanding of the project is still insufficient.

    2. Whether it can maintain cross-module consistency

    A feature typically passes through several layers, from the database to the page. A gap in any layer can cause runtime failures. For example, the backend may return a resource identifier while the frontend still uses an old field. A new task state may be added while the worker process does not handle it. A database record may be deleted while the actual file remains in storage indefinitely.

    The key to long-horizon programming ability is not simply how many files were changed. It is whether the model keeps interfaces, states, and data flows consistent. After making changes, the model should recheck upstream and downstream components rather than judging completion only from local test results.

    3. Whether it can cover exception paths

    A file import feature should handle at least the following cases:

    • The user uploads a file type that is not allowed;
    • The file extension does not match the actual content;
    • The file exceeds the size limit;
    • The upload is interrupted;
    • Storage succeeds but the database write fails;
    • The database write succeeds but later processing fails;
    • The user accesses an asset that does not belong to them;
    • An asset is deleted while historical tasks still try to reference it.

    These cases rarely appear in the simplest demo flow, yet they are where production incidents most often occur. A model that proactively lists and verifies these paths usually demonstrates more engineering maturity than one that only generates more code.

    3. Security Issues Cannot Be Hidden by Passing Tests

    In practical validation, one of the most important warning signs is this: the project starts, all automated tests pass, but manual acceptance still finds high-severity authorization isolation issues.

    This is not a contradiction. Automated tests usually verify whether legitimate users can complete an operation. Security acceptance must verify whether unauthorized users are absolutely unable to complete it. The two focus on different directions.

    For example, a resource access interface may accept only a resource ID and return the file based on that ID. If tests always use IDs created by the resource owner, the tests will pass. But if an attacker replaces the ID and the interface still returns another user’s resource, this is a typical case of missing object-level authorization.

    Security checks should cover at least the following:

    • Whether the server re-verifies resource ownership;
    • Whether the system avoids relying only on hidden frontend buttons;
    • Whether every read, update, and delete operation is checked for permission;
    • Whether internal storage paths are kept away from the client;
    • Whether accessible file types and directories are restricted;
    • Whether key resource operations are logged;
    • Whether cross-tenant, cross-user, and expired resources are tested for isolation.

    A more robust design separates “resource identifier” from “access permission.” After the client submits a resource identifier, the server should query the resource based on the current identity, business space, and resource status. It should also include the ownership constraint directly in the query condition, instead of fetching the resource first and adding checks afterward. This reduces the chance of omissions and makes auditing easier.

    4. From Materials to Product: Testing Requirement Implementation

    The second typical scenario gives the model only a set of Agent learning materials and a product requirements document. The model must then implement, from scratch, a knowledge learning game that can be completed from start to finish.

    This task differs from modifying a legacy project. It does not require the model to adapt to many historical constraints. Instead, it requires the model to handle the full process, from understanding the materials to product design, interaction implementation, and content organization.

    The model needs to address the following problems:

    • Extracting core concepts from the materials;
    • Turning concepts into levels, tasks, and feedback;
    • Designing a clear learning path;
    • Building a mechanism that can be replayed;
    • Determining whether the user has actually mastered the knowledge;
    • Designing failure, hint, retry, and completion states;
    • Keeping the pages, state management, and game rules consistent.

    Many models can quickly generate a visually complete page, but a page that looks like a game is not the same as a game that can be completed. A complete implementation should have clear start conditions, task objectives, operation rules, pass criteria, and end states. After the user completes key actions, the system should give explanatory feedback rather than simply showing a success message.

    For knowledge learning products, content accuracy and the learning loop also need separate checks. For example, does the system explain why an answer is wrong? Does it allow retries? Can later tasks test concepts learned earlier? Is there a loophole that lets users finish by clicking at random?

    5. Strengths and Weaknesses in Long-Horizon Tasks

    Across these two types of tasks, the strengths of next-generation large models fall into three areas.

    First, context handling has improved. Models can read more files and documentation, understand relationships between modules, and no longer depend only on the current editing window.

    Second, sustained progress has improved. In longer tasks, models can complete repeated cycles of analyzing, modifying, running, and fixing, instead of restarting from scratch in each round.

    Third, productization awareness has grown. When building an application from scratch, models not only generate core logic. They also add pages, state handling, hints, and basic validation, so the result is closer to an application users can actually try.

    The weaknesses are equally clear.

    First, models tend to mistake “the feature works” for “the solution is reliable.” They may focus on the main flow and overlook permissions, concurrency, data cleanup, and exception recovery.

    Second, a model’s understanding of implicit business rules still depends on human explanation. A model may not correctly infer constraints that the requirements document does not state explicitly.

    Third, models show test bias. If test cases provide poor coverage, the model may optimize against the existing tests rather than verify the system’s real boundaries.

    Finally, models remain inconsistent in how carefully they handle high-risk changes. For modifications involving authentication, authorization, file access, and data deletion, model self-checks alone are not sufficient.

    6. Adopt a Layered Acceptance Mechanism

    To evaluate models more objectively, teams can establish a four-layer acceptance process.

    Layer 1 is build acceptance. Check whether the project can install, compile, and start, and whether the interfaces and pages show obvious errors.

    Layer 2 is functional acceptance. Follow the requirements document through the main flow. Confirm that data is saved correctly, states transition properly, and the frontend and backend remain consistent.

    Layer 3 is exception acceptance. Deliberately submit invalid parameters, repeated operations, expired data, and boundary values, and observe whether the system handles them stably.

    Layer 4 is security acceptance. Access resources with different identities and resource combinations. Focus on unauthorized access, information leakage, file access, and protection of sensitive operations.

    In addition, require the model to output a change summary, a risk list, and a list of unverified items. A mature development assistant should not only submit code. It should also tell the user what was changed, what was verified, and which parts still need human confirmation.

    Conclusion: Capable of Long Tasks, but Not a Replacement for Final Responsibility

    Overall, current large language models can handle real long-horizon programming tasks. They are especially suited to code reading, cross-module refactoring, test repair, prototype building, and materials-driven development. When assessing them, the more important questions are whether they can maintain context over time, whether they can advance a task to a runnable state, and whether they can correct their work reliably after feedback. Leaderboard scores matter less.

    However, running is not the same as delivering. Permission isolation, security boundaries, data consistency, and exception recovery still require independent verification by developers. For low-risk prototypes, models can be given more autonomy. For systems involving user data, identity authentication, and resource access, human review, automated testing, and security acceptance should be maintained in parallel.

    A more accurate question is not whether a model can replace developers. It is how much of the engineering work the model can take on, and which steps still require human judgment. By this measure, large models have evolved from code generation tools into long-horizon development collaborators. They are still short of fully unsupervised production delivery, which requires more complete evaluation systems and stricter engineering processes.