A Practical Evaluation Methodology for Long-Horizon Software Engineering Agents
Long-horizon software engineering requires much more than code completion. Agents must work across files, respect existing architecture and tests, stay within release constraints, and recover from mistakes over many steps. This article presents a repeatable, explainable evaluation methodology based on four questions: whether an agent can satisfy acceptance criteria from an incomplete specification, fix root causes rather than symptoms, represent uncertainty truthfully, and use tools with appropriate discipline. It covers observable task design, scoring beyond final pass rates, defect-repair criteria, separate tracking of hallucinations and interface quality, process and outcome metrics, cautious interpretation of public leaderboards, internal regression suites, and integration into development workflows with isolation, logging, least privilege, and human review.
Long-horizon software engineering is no longer a matter of completing a single function. Requirements evolve across multiple files, constraints come from existing architecture, tests, and release windows, and failures often appear at step ten rather than step one. Treating a general-purpose chat model as a coding assistant can easily overstate fluency and understate deliverability. Building a repeatable, explainable evaluation method is more valuable than chasing a particular leaderboard position.
What the Evaluation Must Answer
When selecting a system, four practical questions matter:
- Given an incomplete specification, can the agent make tests and acceptance conditions pass after multiple rounds of modification?
- When given a known defect, does the fix eliminate the root cause rather than mask the symptom?
- Does the generated content present uncertainty as certainty?
- When the agent needs to read a repository, run commands, or inspect logs, does it know when to stop and when to ask for help?
Fluency and visual polish are supporting signals only. These dimensions correspond to different risks. Failure to complete a task delays delivery. Introducing regressions while fixing a defect can amplify production incidents. Hallucinations can lead reviewers to believe in interfaces and configurations that do not exist. Runaway tool use can consume budget, pollute the environment, and even execute destructive operations in the wrong directory. Evaluation design should first state the cost of failure, then determine samples and weights.
Task Design: Turn “Can Write Code” into Observable Behavior
Long-horizon tasks should have the following properties rather than merely difficult-sounding labels:
- Existing repository history and constraints: directory structure, dependency locks, and existing tests cannot be overridden at will.
- Automatically determinable goals: rely primarily on tests, static checks, build results, or acceptance scripts; use humans only for parts that cannot be scripted.
- Progressive information release: begin with the observable symptom, then allow access to logs and relevant modules; avoid putting the answer in the prompt.
- Bounded steps: for example, limit tool calls and wall-clock time, and observe completion within budget rather than allow unlimited retries until the agent passes by chance.
- Realistic distractors: stale comments, duplicate function names, and failed historical patches test retrieval ability and the ability to abandon a wrong path.
Do not score only the final pass or fail result. Record the steps required to produce the first runnable patch, the rate of ineffective modifications, whether unrelated tests are broken, and whether the specified interface is respected. Two systems with the same pass rate can have very different engineering meaning if one locates the issue in three steps while the other randomly edits files for thirty steps.
A neutral evaluation record can be kept independent of any specific vendor:
task_id: repo-change-017budget: 40 tool calls / 25 mingates: build, unit, integration, lintresult: passregressions: 0unjustified_claims: 2human_review: needs interface note
Field definitions should be fixed in the evaluation specification. For example, an “unjustified claim” means that the output contains a function, configuration option, or version behavior that does not exist in the repository and is not corrected by later evidence.
Defect Repair: Judge the Root Cause, Not the Surface Patch
For repairs related to security and stability, use defects that have already been publicly disclosed, reproduced, and covered by regression tests, and isolate the environment from production networks. The evaluation should focus on repair quality, not on discovering new attack paths.
Useful criteria include:
- The test case associated with the defect changes from failing to passing.
- Existing security-related tests are not weakened.
- The patch scope is limited to the responsible module.
- A test or check is added to prevent recurrence.
- The explanation separates “possible cause” from “verified cause.”
If a model only broadens exception handling, swallows error codes, or disables checks, it should receive a failure or low score even if the surface-level test turns green.
For side-by-side comparisons, use the same defect set, the same time budget, and the same allowed tool set. Do not equate “explains vulnerability mechanics well” with “produces a mergeable patch.” Explanation can be a readability bonus, but it cannot replace the gates.
Hallucinations, Text, and Interfaces: Score Them Separately
Reducing hallucinations generally raises an overall score, but it should not be a single number. At minimum, track these categories separately:
- Invented APIs or configuration options
- Incorrect file or line references
- Claiming that checks were passed when they were never run
- Giving a single definitive conclusion while uncertainty remains
During spot checks, compare against the repository and command output, not against another model response.
Text quality is suitable for blind review: clarity, structure, whether the response provides a concrete next step, and whether it overpromises. For interface or frontend tasks, examine accessibility, completeness of states, whether error messages are understandable, and whether business logic outside the visual system is changed without justification. Ranking fluctuations often come from task distribution, so a single change in rank should not be interpreted as a leap in capability. Keep the task set fixed and report confidence intervals or at least the sample size.
Agent Capability: Look at Process and Outcome Together
Agent improvements should primarily appear in planning, tool selection, and self-correction, not in longer monologues. Process metrics can include:
- Whether the agent locates the problem before modifying code
- Whether failure logs are used to form the next hypothesis
- The number of repeated calls to the same ineffective command
- Whether the agent stops before permission changes or destructive operations and requests confirmation
- Whether long context is summarized in a way that remains traceable to the source
Outcome metrics should still be governed by the gates. A good-looking process with failing tests is not an engineering success. Conversely, if tests pass but the process shows large amounts of generated code that were not reviewed, the proportion of human review should increase. Keep a human in the loop for critical paths: before merging, a maintainer should confirm interface compatibility and the rollback plan.
How to Read Leaderboards Without Being Misled
Public leaderboards often differ in task sets, temperature settings, whether multiple samples are allowed, and whether hidden tests are used. Close scores may not represent a stable statistical difference. When reading a leaderboard, ask first:
- Are the tasks close to your language, frameworks, and repository scale?
- Is the scoring reproducible?
- Are failure examples public enough to support a postmortem?
Treating the first-place system as a procurement conclusion confuses a marketing signal with engineering evidence.
A safer internal approach is to build a small, hard regression set. Extract anonymized defect, refactoring, and documentation tasks from real tickets. Update the set quarterly without replacing it wholesale, so that progress or regression in the same system version can be observed. Before a new model or strategy enters production, compare it with the current baseline on the same regression set. Move a change into the default path only when it consistently beats the baseline and its failure modes are acceptable.
Putting It into Practice: Integrate Evaluation into Development
Evaluation environments should use isolated builds and dependency caches. Secrets and production data must not enter prompts or logs. Logs and traces should retain at least:
- The input task ID
- A summary of tool calls
- Gate results
- Human conclusions
Monitor timeout rates, repeated failures, and abnormally high token consumption. Alerts should target the evaluation jobs themselves, not business users.
If object storage is used to save samples and traces, a container platform to run isolated builds, a message queue to schedule evaluation jobs, and logging and monitoring to inspect failure distribution, design permissions and retention periods for these capabilities as general infrastructure. Do not tie the design narrative to one vendor’s proprietary interfaces. When teams deploy on Baidu AI Cloud or another compliant environment, the priorities remain network isolation, least-privilege identity and access, and audit retention, not leaderboard slogans.
A three-layer workflow works well:
- A fast subset before submission: identify obvious regressions.
- A nightly full regression: compare candidate strategies.
- Human spot checks before release: cover security fixes and cross-module changes.
When adjusting strategy, prompts, retrieval, or tool allowlists, change one variable at a time. Otherwise, attribution becomes impossible.
Conclusion
Long-horizon software engineering capability is a combination of completion rate, regression control, factual constraint, and tool discipline. It cannot be represented by a single text score or interface impression. Turn observations from public comparisons into your own gates: decidable tasks, a process with clear budgets, penalties for hallucinations and ineffective patches, and a reproducible baseline. Only conclusions built this way can guide whether agents belong in day-to-day development, rather than merely explaining why a leaderboard moved up or down.
