How to Scientifically Evaluate the Long-Horizon Coding Ability of Large Language Models

    Benchmark scores alone can't tell you whether an LLM can sustain real engineering work. This article explains why leaderboard metrics fall short, proposes a two-task evaluation design that combines enhancing a legacy codebase with building a product from scratch, identifies the behavioral signals worth watching in long-horizon tasks, analyzes a real case where all tests passed but a P1 permission-isolation flaw slipped through, and offers practical recommendations for dividing work between AI models and human reviewers.

    Why Leaderboard Scores Are Increasingly Insufficient

    Every time a new model is released, benchmark scores are the first thing to circulate. But for working developers, leaderboard results only answer “roughly how good is this model” — they can’t answer the more critical question: can it keep working reliably inside my real project?

    The reason is that benchmark tasks are mostly short-horizon and well-specified, while real engineering work has several characteristics benchmarks struggle to capture:

    • Long time horizons: A single feature change often spans the database, backend services, frontend display, and rendering logic, requiring the model to maintain contextual consistency across tens of minutes or even hours of continuous work.
    • Legacy baggage: Existing codebases are full of implicit conventions, compatibility logic, and historical decisions that any new change must coexist with peacefully.
    • Constraints: Security policies, permission boundaries, and compliance requirements — the “invisible requirements” — are exactly where production environments break most often.

    Therefore, the most valuable way to evaluate a model’s real coding ability is to place it in a real project with real constraints and observe its behavioral patterns over long tasks.

    Designing a Discriminating Set of Hands-On Tasks

    A good evaluation requires tasks with built-in tension. An effective hands-on test can include two complementary task types:

    Task 1: Enhancing an existing project. For example, in a system with a large amount of legacy code, add the capability to “securely import user image assets and reference them in HTML animation scenarios.” This task examines:

    1. Whether the model can understand the existing module boundaries and interface contracts;
    2. Whether it follows established architectural conventions when making changes, rather than starting from scratch;
    3. Whether it proactively handles security details such as upload validation, path isolation, and legality of resource references.

    Task 2: Building a complete product from zero. Provide only domain learning materials and a product requirements document (PRD), and ask the model to independently deliver a complete, verifiable knowledge-learning application. This task examines the full closed-loop capability — from material analysis and requirement decomposition to technology selection and product delivery. With no legacy code to lean on, the model must build the entire skeleton itself.

    The two tasks complement each other: one tests understanding of and restraint toward an old system, the other tests the completeness of greenfield construction. Together, they outline the full picture of a model’s capabilities.

    Behavioral Signals Worth Observing in Long Tasks

    During hands-on testing, the following intermediate signals are more revealing than whether the final result runs:

    1. Sustained understanding of complex context. Strong performance looks like this: the model remembers design decisions established in earlier rounds and doesn’t oscillate on the same question; when facing cross-module changes, it proceeds in dependency order (define data contracts first, then modify the service layer, then wire up the frontend) instead of jumping around randomly.

    2. Pushing the task to a “runnable, testable” state. A key dividing line is whether the model delivers “code that looks finished” or “a complete state that runs and can be verified.” The latter means it proactively handled the tedious but fatal steps: building, launching, and end-to-end integration.

    3. Proactive awareness when facing constraints. In scenarios involving user resource handling, does the model spontaneously consider file type validation, storage path isolation, and reference legality checks? If all of these only get added after human prompting, its security ability is still at the “passive response” stage rather than an internalized engineering instinct.

    A Typical Case: Everything Ran, but Acceptance Failed

    The most instructive results from hands-on testing are often not the success stories. In one legacy project modification, the model completed the feature end to end and all its self-tests passed — yet manual acceptance review exposed a P1-level issue: a gap in permission isolation, where certain resource operations were not strictly bound to the correct user identity boundary.

    This case reveals an important pattern:

    A model’s self-testing can only cover what it “knows to test.” The defining trait of security flaws is precisely that developers (including models) can’t anticipate the attack paths — so “all tests green” does not equal “safe to ship.”

    The deeper reason: test cases come from the model’s understanding of the requirements, while security threats come from outside the requirements. At the current stage, human security review remains a step that cannot be skipped for changes involving permissions, authentication, or data isolation.

    A Sober Conclusion and Practical Recommendations

    Taken together, these hands-on evaluations support a fairly measured judgment: the long-horizon coding ability of new-generation LLMs is genuinely improving fast, and they are worth validating in real projects, performing notably well on cross-module long tasks. But the boundary of human-AI collaboration should be drawn like this:

    1. Safe to delegate: scaffolding feature prototypes, routine cross-module changes, batch generation of test cases, and maintenance of documentation and comments;
    2. Must stay under human control: permission and security design, final delivery acceptance, logic involving money or sensitive data, and irreversible architecture-level decisions;
    3. Recommended process: establish an independent security review checklist for model output, making permission boundaries, input validation, and resource isolation mandatory check items rather than relying on the model’s self-testing.

    For teams, rather than fixating on “whether models can replace engineers,” it’s better to invest in designing a solid acceptance mechanism for human-AI division of labor — let the model carry the long-horizon execution, and let humans carry judgment and the final safety net. That is the most robust way to use these tools today.