Evaluating Engineering Execution Capability of Large Models in Terminal Environments
As code-model evaluation shifts from local function generation to end-to-end engineering execution, teams need methods that reflect real repository work. This article explains why the evaluation focus is changing, what terminal-environment tasks should test, and how to build a custom evaluation set with isolated execution, acceptance tests, and practical metrics.
For years, a common way to evaluate code models was to check whether they could write a correct function from a description. That kind of test measures local generation capability. In real engineering, developers care more about whether a model can complete a full piece of work in a real code repository. Evaluation is therefore shifting from code generation to engineering execution.
Why the evaluation focus is changing
Early benchmarks usually targeted a single function or script: the input was a problem statement, the output was code, and the usual criterion was whether unit tests passed. This approach is well suited to testing syntax knowledge and algorithm understanding.
Real development tasks involve more steps:
- understanding an existing repository’s directory structure, module dependencies, and naming conventions;
- keeping interfaces consistent across multiple files;
- running tests, reading failure logs, and locating root causes;
- calling tools in sequence, such as viewing files, running builds, and changing configuration;
- confirming after changes that existing functionality has not been affected.
Together, these steps make up engineering execution capability. It determines whether a model is only a code-completion tool or an agent that can take on part of a development task.
What terminal-environment tasks should assess
A terminal task is characterized by the model interacting with the environment only through command-line commands. It must read command output, decide the next operation, and handle errors. A complete task usually includes the following steps:
- Parse the requirement and break it into executable steps.
- Find relevant files and build the necessary context.
- Modify code or configuration.
- Run builds or tests.
- Continue correcting based on results until acceptance criteria are met.
Each step can fail. Whether a model can extract useful clues from error messages and adjust its strategy accordingly is a key capability that distinguishes different systems.
The pseudo-code below shows this loop:
task = read_requirement()history = []while not_done and round < limit:action = model_decide_next_step(task, history)observation = execute_in_isolated_env(action)history.append(observation)if acceptance_test_passes():mark_complete
In this loop, three factors most often create differences: whether context management is clear, whether tool invocation is stable, and whether error recovery is effective.
How to design your own evaluation method
Public benchmark scores can only serve as a reference. If a team wants to judge whether a model fits its own code repository, it needs to build a custom evaluation set.
Build the evaluation set
- Extract real tasks from historical tickets, bug reports, and code review records.
- Provide each task with an acceptance test that can be judged automatically.
- Layer tasks by difficulty, covering single-file changes, cross-module refactoring, dependency upgrades, and other types.
- Pin code versions and environment images so that each run has consistent conditions.
Isolate the execution environment
The evaluation process executes commands, so it must run in containers or virtual machines, with network and file-system permissions restricted. Commands should be passed as argument lists to avoid injection risks caused by string concatenation.
import subprocessfrom dataclasses import dataclass@dataclassclass StepResult:command: list[str]returncode: intstdout: strstderr: strdef run_step(command: list[str], cwd: str, timeout: int = 60) -> StepResult:"""Execute a single command in the specified directory and raise a timeout exception if the limit is exceeded."""proc = subprocess.run(command,cwd=cwd,capture_output=True,text=True,timeout=timeout,)return StepResult(command, proc.returncode, proc.stdout, proc.stderr)
Judging and metrics
Judging should rely on test results, not on the model’s description of its own results. The following metrics are recommended:
- Task pass rate: the share of tasks whose acceptance tests pass.
- Average rounds: the number of tool calls required to complete a task.
- Regression rate: the share of tasks in which existing tests fail after changes.
- Per-task cost and latency.
- Number of human interventions: the number of times a human hint is required before the task can continue.
Below is an example of an acceptance function:
def evaluate_task(repo_dir: str, test_cmd: list[str]) -> dict:
