Evaluating Long-Horizon Coding Ability in LLMs: Practical Methods and Human Review Essentials
This article explains how to evaluate whether large language models can complete long-running software development tasks in real projects, beyond standardized test scores. It covers three core abilities: understanding context in existing codebases, carrying changes across multiple modules, and delivering code that builds, runs, and passes tests. It also describes two representative task types, a reproducible evaluation workflow with acceptance checklists, security checks for permissions and untrusted input, and a practical division of work between models and human reviewers.
1. Why Evaluate Coding Models Differently
Standardized test scores show how a model performs on fixed problems, but they do not answer a more practical question: can a model independently complete a real project task that runs for several hours? Real development work usually spans multiple modules. The model first needs to understand existing code, then modify data structures, interfaces, the UI, and tests, and finally make sure the system runs. Failures in such tasks rarely come from a single function. They tend to come from lost context, uncontrolled change scope, or a missed implicit constraint.
So evaluation should shift its focus from “Did the model get the answer right?” to three questions:
- Can the model understand complex context and find the correct place in code that carries historical baggage?
- Can the model keep changes consistent across multiple modules, avoiding new breakage at every step?
- Does the delivered result run and pass tests, and does it leave enough information for a human to review?
2. Three Core Abilities in Long-Horizon Coding Tasks
2.1 Context Understanding
Existing projects often contain naming conventions, shared utility functions, layered structures, and configuration files. If a model does not read this information, it may reinvent existing utilities or place new logic in a location that does not match the current architecture.
A typical problem: to implement a date formatting feature, the model creates a new utility function, even though the project already has a module with the same functionality. The code runs, but maintenance costs rise, and later changes can leave two conflicting standards in place.
Evaluation method: Check whether the changes reuse existing modules, whether new files follow the directory conventions, and whether unnecessary shared code was modified.
2.2 Sustained Progress Across Modules
A seemingly simple requirement, such as “add a new asset type,” usually affects the database schema, data migration scripts, API definitions, background jobs, frontend display, and test cases at the same time. Every layer must be updated, and the update order must follow the dependency relationships.
The difficulty of long tasks is that by the fifth step, the model still needs to remember the field names and status values it set in the first step. If one layer uses different naming, the problem usually surfaces only at runtime.
Evaluation method: Ask the model to output a change map before starting, listing the place in each layer that needs modification. After completion, check each item against the map. The gap between the change map and the actual changes is a direct measure of the quality of progress.
2.3 Bringing Results to a Runnable, Testable State
“Code has been generated” and “the feature has been verified” are different things. The first only shows that files were written. The second requires that services start, tests pass, and key paths work end to end.
A reliable delivery usually includes these steps:
- Run the build and fix compilation or type errors;
- Start the relevant services and confirm there are no runtime exceptions;
- Run unit tests and end-to-end scripts;
- Locate and fix failing test cases, and explain the cause.
Evaluation method: Keep reproducible commands and logs. A verification record is only useful if someone can re-run it and get the same results.
3. Designing Two Types of Representative Tasks
The choice of evaluation tasks determines how far the conclusions apply. The two task types below each cover different failure modes.
3.1 Incremental Requirements in an Existing System
Adding features to existing code tests the model’s ability to understand a legacy system. Take “allow users to import image assets and reference them in animated page scenes” as an example. This requirement must satisfy several constraints at once: only assets the current user has permission to access can be used, uploaded files must be validated for type and size, and embedded content in scenes must be sanitized so scripts cannot run directly.
Most of these constraints are not written in a one-off prompt. They are scattered across existing code, configuration, and documentation. Whether the model can discover and follow them on its own is the key focus of the evaluation.
3.2 Complete Delivery from Source Material to Product
The other task type gives the model reference material and a requirements document, then asks it to build a small application from scratch that users can fully experience. For example, a knowledge-learning mini game requires the model to extract key points from the material, design levels and progression rules, implement answer checking, and ensure a player can get from start to finish.
This type of task tests information extraction, product breakdown, and end-to-end completeness. Evaluation should check requirement coverage, whether the main flow is reachable, and whether the content itself is accurate. Content accuracy is often overlooked, but it directly affects the usability of learning products.
4. Building a Reproducible Evaluation Workflow
A reproducible workflow usually includes five steps:
- Write the task description and acceptance criteria as items that can be checked one by one.
- Fix the starting code version and record the runtime environment.
- Let the model execute autonomously, while recording the files it modifies, the commands it runs, and the number of failures.
- Run automated checks, including the build, unit tests, and end-to-end scripts.
- Have a human check each acceptance item, with particular attention to security and boundary conditions.
The acceptance checklist can be organized as follows:
task: image-import-with-embedded-sceneacceptance:- id: F-01 Users can upload an image and reference it in a scene- id: F-02 The referenced scene renders correctly- id: S-01 Unauthorized users cannot access assets uploaded by others- id: S-02 Uploaded files are validated for type and size- id: S-03 Embedded content is sanitized before rendering, so scripts are not executed directly- id: R-01 All automated tests pass- id: M-01 The change notes list modified files and uncovered risksmanual_review_required: [S-01, S-02, S-03]
Security items should be marked for manual review, even when all automated tests pass.
5. Permissions and Security: What to Do After Tests Pass
Automated tests usually cover normal paths, while security problems mostly appear in error paths. Common issues include:
- Reading data directly by resource ID without checking ownership, which allows unauthorized access;
- Determining file type only by extension without inspecting the file content;
- Outputting rich text or embedded content to the page without sanitization;
- Writing access tokens or other sensitive fields to logs.
The basic principles for addressing these issues include default deny, least privilege, validating input at trust boundaries, and storing secrets in environment variables or a dedicated secrets management service.
For resource access, the permission check can be written in pseudocode as follows:
function get_asset(request, asset_id):asset = repository.find_asset(asset_id)if asset is null:return not_found()# Default deny: the request must satisfy either ownership or the admin roleif asset.owner_id != request.user_id and not request.user.has_role("admin"):return forbidden()return ok(asset.metadata)
Negative tests should cover three cases: requests for another user’s resource ID are denied, unauthenticated requests cannot access the resource, and unauthorized requests do not leak any visible fragment of data. Permission code generated by models often checks only whether the user is logged in and misses whether the resource belongs to that user, so negative tests are necessary.
6. Practical Boundaries of Human-AI Division of Work
Models work efficiently on repetitive tasks with clear rules. Decisions about permissions and releases require a person to take responsibility. The table below shows one common division of labor:
| Task Type | Suitable for Model | Requires Human Review |
|---|---|---|
| Boilerplate code and API skeletons | Yes | Spot-check |
| First draft of cross-file refactoring | Yes, with tests | Verify the impact scope |
| Adding test cases | Yes | Check whether assertions are meaningful |
| Permission models and data isolation | Can provide a draft | Must be decided and reviewed by a human |
| Handling of external input | Can assist with implementation | Must be reviewed by a human |
| Release and rollback decisions | Provide risk notes | Decided separately by a human |
7. Common Misconceptions
Misconception 1: Passing tests means the work is ready to ship. Tests only verify the expectations that someone wrote down. A constraint that no test covers will not be caught just because the tests pass.
Misconception 2: Deliver the complete requirement in one pass. Splitting a large task into small steps and checking each one makes problems easier to locate and keeps the rollback scope smaller. For database schema changes, make a backup before each step.
Misconception 3: Look only at the final output, not the process. Change records and command logs show whether the model understood the constraints or simply passed a check by chance. Process records are an important basis for judging reliability.
8. Suggested Rollout Pace
A team can start with a lower-risk existing module. Design three to five acceptance items that include negative paths, then have the model execute the task and record the results. After several rounds of consistent validation, gradually expand the scope of tasks. Changes involving permissions, data isolation, and external input should keep a separate manual review step, and every change should remain reversible.
