Long-Horizon Code Generation: How to Evaluate LLM Capabilities

    Benchmark scores alone cannot tell teams whether an LLM can complete a multi-module task in a real codebase. This article describes two contrasting hands-on tests—adding a capability to a legacy system and building a complete product from a PRD—and summarizes observed strengths and gaps in long-horizon coding. It then provides a reusable acceptance checklist covering functional validation, automated tests, security review, code walkthrough, and manual acceptance, concluding that LLMs are worth testing on real projects but human review remains essential for permissions, security, compliance, and final delivery.

    1. Why Benchmark Scores Are No Longer the Only Criterion

    In recent years, large language models have continued to improve their scores on programming benchmarks. Many models claim leading positions among open-source or closed-source models on terminal tasks and software engineering evaluations. But for practicing developers, leaderboard scores only reflect average performance on a certain class of problems. They cannot answer a more practical question: Can the model persistently complete a task that spans multiple modules in my real project and bring it to a runnable, testable state?

    This is the core of long-horizon coding capability. The difficulty is not writing a short function. It lies in:

    1. Context understanding: Reading an existing system with a large amount of historical code and understanding established conventions, implicit dependencies, and legacy constraints.
    2. Task decomposition and sustained progress: Breaking a large requirement into ordered steps, coordinating changes across databases, backend APIs, workers, frontend, and other modules, and staying on course throughout.
    3. Delivery state: Producing code that compiles, runs tests, and can enter manual acceptance—not code that looks correct but does not run.

    Therefore, instead of chasing benchmark scores, teams should build a hands-on evaluation method based on real projects. The two very different hands-on tasks below show how to systematically evaluate the upper bound of a model’s long-horizon coding capability.

    2. Designing Two Representative Test Tasks

    To evaluate the boundaries of model capability, test tasks should cover two extremes:

    Task 1: Add a new capability to an existing legacy system. For example, in a project with a large existing codebase, add the secure import of user image assets and their use in HTML animation scenarios. This task tests:

    • Adaptability to the existing architecture: New code must follow the project’s existing layering, naming, and error-handling conventions.
    • Handling of security constraints: File upload involves type validation, size limits, storage isolation, and access control. A gap in any one of these areas is a risk.
    • Completeness of cross-module changes: The full path from data models and API definitions to the frontend rendering pipeline must be connected.

    Task 2: Build a complete product from scratch. For example, provide only a product requirements document (PRD) and a set of domain learning materials, and ask the model to build from scratch a knowledge-learning game that can truly be played through to completion. This task tests completeness from material analysis and solution design to product delivery—whether the model truly understands the requirements rather than generating a demo with only a shell.

    These two tasks—one legacy and one greenfield, one tightly constrained and one open-ended—can effectively expose differences in model capability across scenarios.

    3. What the Tests Reveal

    Across common results from this type of hands-on testing, several representative observations emerge:

    1. Long-task progress capability has improved significantly

    Newer models can generally work continuously for hours in a monorepo. In the first round, they complete the main implementation; in the second, they independently perform browser-based verification, locate defects, and fix them. Throughout the process, they can remember what has been done and what remains, and they can usually connect the full frontend-backend functional path in one pass. This suggests that introducing large-scale long-horizon task environments during post-training is effective: repeated practice on many tasks that simulate real engineering environments improves engineering capability more than simply scaling parameters.

    2. “It runs” does not mean “it is deliverable”

    The most cautionary conclusion is that even when functional validation and basic tests pass, delivery quality may still have hidden risks. In Task 1, for example, the functionality worked at the feature level, but manual acceptance could still expose a P1-level permission isolation issue—for example, data boundaries between different users were not strictly validated. These are exactly the kinds of issues models are most likely to miss. They are not explicitly described in the requirements document and depend on an engineer’s long-term sensitivity to security boundaries.

    3. The boundaries of security capability

    Some newer models are beginning to demonstrate white-box code review and vulnerability reasoning capabilities, and they perform near the frontier on basic security tasks. However, in scenarios such as full vulnerability exploitation and complex attack-chain construction, they still lag behind the most advanced closed-source models. This is a reminder that a model’s security review capability can serve as an aid, but it cannot replace professional security testing and manual audits.

    4. A Reusable Acceptance Checklist

    Based on these observations, teams should formalize the process after the model finishes writing code into the following checklist:

    1. 1. Functional validation: run the core path end to end, covering normal and boundary inputs
    2. 2. Automated tests: unit tests + integration tests all green, covering key branches
    3. 3. Security review:
    4. - Input validation and file type/size limits
    5. - Permissions and data isolation (check every read and write path individually)
    6. - Storage paths, access control, and sensitive data redaction
    7. 4. Code walkthrough: check compliance with existing project conventions and look for hidden global side effects
    8. 5. Manual acceptance: a person familiar with the business makes the final judgment on security boundaries

    Steps 3 and 5 should not be skipped in particular. Models can efficiently build structure and logic, but for questions such as whether this code could cross permission boundaries in a multi-tenant scenario, humans still need to provide the final safeguard at the current stage.

    5. Conclusion: Worth Testing, But Humans Must Stay in the Loop

    For the long-horizon coding capability of the current generation of models, the following judgment is reasonable:

    • The ceiling has risen significantly: Models can already take on cross-module, long-cycle development tasks and bring features to a runnable and testable state. They are worth evaluating on real projects rather than only toy demos.
    • Delivery responsibility remains with humans: Human review gates must be retained for permissions, security, compliance, and final acceptance. All functional tests passing is only the starting point for acceptance, not the end point for delivery.

    For teams, a more pragmatic approach is to position the model as a highly productive junior collaborator that requires supervision: let it handle the implementation and validation workload, while keeping security boundaries and architectural decisions firmly in human hands. This allows teams to capture the efficiency gains from models while keeping risk within an acceptable range.