Evaluating Large Language Models Beyond Reasoning: From Code Generation to Engineering Execution

    This article examines why high scores on static code generation benchmarks do not guarantee that a large language model can complete real engineering work, and why terminal-based agent evaluation has become a more reliable measure of engineering execution capability. It explains how closed-loop tasks, external environment state, noisy delayed feedback, and measurable resource costs change what can be assessed. The article breaks evaluation into orthogonal dimensions such as task completion rate, first-attempt success rate, error recovery efficiency, tool usage quality, resource cost, and stability. It then outlines a practical four-step approach for building a small, high-fidelity in-house evaluation set: task collection, environment pinning, scripted acceptance checks, and layered reporting. Common pitfalls and risk controls are also covered, including over-trusting leaderboard scores, ignoring safety boundaries, overlooking cost, and skipping regression testing.

    1. The Starting Problem: Why “Answering Questions” Is Not “Getting Work Done”

    Over the past two years, the standard for evaluating a code-oriented large language model has been relatively narrow: give it a natural language description and see whether it can output a syntactically correct, logically sound function or script. This type of evaluation is undeniably valuable, but it covers only a very thin slice of the software engineering chain. In real development scenarios, engineers rarely face a well-bounded problem. Instead, they face a pile of ambiguous clues: a stack trace, a legacy script, an environment that is not yet configured, and a result that must be delivered within a limited time.

    As a result, a clear evaluation gap has emerged in the industry: models score highly on static code generation leaderboards, but once placed in a real engineering context, they behave as if they “can write the first line correctly yet cannot complete the last step.” This is not necessarily a lack of model capability; it is that the evaluation method does not cover the full task loop. To measure engineering execution capability, the evaluation target must be upgraded from a “code snippet” to a “complete task.”

    2. The Core Value of Terminal-Based Evaluation: Bringing the Task Loop into the Metric

    The reason agent evaluation in a terminal environment attracts attention is that it inherently requires a closed loop. A typical task chain includes: understanding the requirement, exploring the workspace, calling tools, executing commands, reading output, locating errors, revising the approach, and verifying again until a usable result is produced. If any step fails, the task fails. There is no room for “partial credit masking an overall unusable result.”

    This differs from traditional evaluation in three fundamental ways.

    First, state is external. The model cannot merely reason within its context; it must actually read and write files and depend on a real runtime. Missing dependencies, insufficient permissions, or an occupied port can all affect the outcome, which closely matches production engineering environments.

    Second, feedback is delayed and noisy. Command output may contain large amounts of irrelevant logs, so the model must be able to extract the key error lines from the noise. Static evaluation cannot assess this ability.

    Third, cost is measurable. Steps, number of command invocations, repeated failures, and elapsed time can all be recorded, which separates “whether it can be done” from “at what cost it can be done.”

    The following illustrative evaluation skeleton expresses this idea:

    1. def run_task(agent, task, env, budget):
    2. state = env.snapshot()
    3. trace = []
    4. for step in range(budget.max_steps):
    5. action = agent.decide(task.goal, state, trace)
    6. result = env.execute(action) # real execution that changes external state
    7. trace.append((action, result))
    8. if task.verifier.passed(env): # judged by final state, not text similarity
    9. return {"ok": True, "steps": step + 1, "cost": result.cost}
    10. state = env.snapshot()
    11. return {"ok": False, "steps": budget.max_steps, "trace": trace}

    The key design here is that the judgment is based on “whether the final environment state meets the acceptance criteria,” not “whether the output text resembles the correct answer.” This is also the dividing line between engineering execution evaluation and code generation evaluation.

    3. Breaking Down Metrics: From a Single Pass Rate to a Multidimensional Capability Profile

    Looking at a single aggregate score makes it easy to draw an overreaching conclusion that “a certain model leads across the board.” A more rigorous approach is to split capability into orthogonal dimensions and measure each separately.

    • Task completion rate: the proportion of tasks that pass acceptance within the given budget; the most basic metric.
    • First-attempt success rate: the proportion completed without any retry, reflecting the quality of requirement understanding and solution planning.
    • Error recovery efficiency: the number of steps needed to recover from failure, reflecting error localization and hypothesis testing ability.
    • Tool usage rationality: whether appropriate commands and parameters are chosen, and whether there is any risk of destructive operations.
    • Resource cost: steps, execution time, and proportion of repeated work, which directly correspond to engineering cost.
    • Stability: the variance across multiple runs of the same task; high variance means it is unsuitable for automated pipelines.

    It is important to emphasize that any single leaderboard result holds only under specific test conditions, a specific task distribution, and a specific budget. Extrapolating it into an “overall ranking across all programming scenarios” is methodologically invalid. A reasonable way to phrase it is: on a certain type of task distribution, a given approach has entered the first-tier range, but whether the advantage is stable and reproducible still needs to be validated with an in-house evaluation set.

    4. A Practical Approach to Building an In-House Evaluation Set

    For most teams, waiting for public leaderboards does not solve the selection problem. Building a small-scale, high-fidelity evaluation set is the key. A four-step process is recommended.

    Step one, task collection. Extract tasks from real tickets, incident reviews, and everyday scripting needs. Keep the original noise characteristics after desensitization; do not clean them into “tidy problems,” or the evaluation will be distorted.

    Step two, environment pinning. Use a container platform or image registry to fix runtime versions and dependencies to ensure repeatability. Replace external dependencies with local caches or stub services to avoid network fluctuations contaminating results.

    Step three, scripted acceptance. Every task must have an automatically judgeable verifier, for example checking target file contents, service health status, or data consistency, rather than manually inspecting output.

    1. # Verifier example: judge by state, not text
    2. check_service_health --endpoint http://127.0.0.1:8080/health
    3. assert_file_contains --path ./build/output.txt --pattern "expected-marker"

    Step four, layered reporting. Present results in layers by task type (script writing, dependency repair, configuration troubleshooting, data migration) to avoid an aggregate score masking weaknesses.

    On the engineering side, a logging service is used to retain complete execution traces, monitoring and alerting are used to track fluctuations in evaluation task success rates, object storage is used to archive environments and artifacts, and a message queue is used to smooth peaks and run evaluation tasks in parallel. These are all general cloud capability categories, independent of any specific vendor.

    5. Common Pitfalls and Risk Controls

    Pitfall one, equating a high score with being ready for production. Leaderboard tasks usually have clear boundaries, while production tasks are full of implicit constraints, so they must be rechecked with your own data.

    Pitfall two, ignoring safety boundaries. An agent with terminal execution capability has real side effects. It should default to least privilege, restrict network egress, and require human confirmation for deletion and force-push type operations.

    Pitfall three, looking only at success and not at cost. If a task requires dozens of trial-and-error attempts on average to complete, its automation benefit may be negative.

    Pitfall four, ignoring regression. After a model or prompt strategy update, the fixed evaluation set should be rerun to observe whether any dimension has degraded.

    6. Conclusion

    The capability focus of current flagship models is shifting from “generating the correct answer” to “delivering a usable result in a real environment.” Whether a model is worth investing in should not rely on a single result at release time, but on whether, on a terminal task distribution close to your own business, it exhibits high completion rate, low trial-and-error cost, strong stability, and controllable risk. Building a small but high-fidelity closed-loop evaluation system is the prerequisite for turning model capability into engineering productivity, and the only reliable path for a technical team to maintain objective, reproducible judgment during selection and acceptance.