Evaluating LLM Software Engineering Capability: A Practical Framework

    This article explains how to evaluate large language models on real software engineering work rather than abstract coding scores. It covers trustworthy task design, zero contamination, a reproducible evaluation workflow, supplementary metrics and failure analysis, common biases, team selection and regression use, and maintenance discipline for evaluation sets.

    The Real Question an Evaluation Must Answer

    The purpose of coding capability evaluation is not to assign a model an abstract score. It is to answer a question engineering teams face every day: given an evolving codebase, an incomplete requirements description, and a set of existing tests, can a model locate the relevant modules within a limited context, make a minimal and correct change, and make the regression tests pass?

    Algorithm puzzles, function completion, and single-file fill-in-the-blank tasks mainly test syntax familiarity and local reasoning. Real software engineering also involves cross-file dependencies, implicit conventions, build and test entry points, backward compatibility constraints, and the risk of fixing one place while breaking another. Evaluation should therefore stay as close as possible to an engineer’s unit of work: read, locate, modify, verify, and revise based on failure information.

    Where Tasks Come From Determines Whether They Are Trustworthy

    High-quality tasks should have three independent properties.

    Authenticity. Tasks should come from defect fixes, small feature increments, or behavior-alignment changes in codebases that are still maintained, not from toy projects invented specifically for a model. The requirements description should preserve the information an engineer can understand while removing commit messages, discussion threads, and final answers that would directly leak the patch.

    Verifiability. Every task must have an automated, deterministic acceptance method. A common approach is a combination of hidden tests, build scripts, and static checks. If a task “looks reasonable” but cannot be distinguished as correct or incorrect by tests, it is not suitable for a leaderboard or regression set.

    Moderate complexity. A very short one-line change cannot measure engineering capability; a problem spanning a dozen subsystems, depending on external environments, and failing to reproduce reliably turns noise into perceived capability differences. A safer range is: the task requires reading multiple files, the changes are concentrated, and acceptance can be completed in an isolated environment.

    The task collection should also cover multiple programming languages and different repository structures, so that a model does not merely appear strong in one ecosystem. Language distribution, domain distribution, and change size should be declared in advance; otherwise, scores are not comparable.

    Why Zero Contamination Is a Prerequisite

    If tasks, reference patches, or test cases have already appeared in public web pages, Q&A sites, or training corpora, the model may be recalling rather than solving. Contamination systematically inflates scores and makes later comparisons meaningless.

    Actionable protections include:

    • Write tasks from scratch or rewrite them thoroughly, rather than directly using original task text that has been widely reposted.
    • Run search-based self-checks on repository snapshots, problem statements, test names, and key identifiers; remove or rewrite tasks with high overlap.
    • Freeze the code version used for evaluation and prevent the model from accessing external discussions that could leak answers while solving.
    • Keep a small, never-published holdout set used only to spot-check whether memorization-based solving occurs.
    • Record the creation date and source type of each task for later auditing.

    Zero contamination is not an absolute state but an ongoing process. After corpora are updated, tasks should be regularly rechecked for secondary distribution.

    How to Run the Evaluation Workflow

    A complete run can be divided into five steps.

    1. Environment preparation. Prepare a clean code snapshot, dependency lockfiles, and test entry points for each task. Dependencies should be installable offline or reproducibly, so network fluctuations are not recorded as model failures.
    2. Information provided. Give the model the problem description, the directory scope it may read, and how to run tests. Do not pre-disclose which files should be modified unless that information was already part of the real ticket.
    3. Solving and iteration. Allow the model to inspect test failure logs and make a limited number of revisions. The number must be specified in advance; otherwise, unlimited retries mix compute budget into capability scores.
    4. Acceptance. In an isolated environment, pull the original snapshot again, apply only the model’s final patch, and then run hidden tests. Judge by the final state, not the model’s self-reported “passed”.
    5. Archiving. Save prompts, patches, logs, elapsed time, and failure categories so others can rerun the evaluation.

    The illustrative acceptance logic can be very simple; the key is clear boundaries:

    1. Prepare a clean working copy
    2. Apply the candidate patch
    3. If the patch cannot be applied -> record as failure
    4. Run the agreed build and tests
    5. If all required checks pass -> record as pass
    6. Otherwise archive by failure stage

    Pass rate can serve as the primary metric, but the number of tasks, language distribution, allowed iteration count, and whether hidden tests are used must also be published. A single percentage without a denominator and protocol cannot be used for model selection.

    What to Look Beyond the Score

    A single pass rate hides structural differences. At minimum, add these slices:

    • By language and repository size. Identify whether the model is only good at a certain style of code organization.
    • By failure stage. Distinguish between failure to locate, patch cannot be applied, compilation failure, public tests pass but hidden tests fail, and unrelated changes introduced.
    • By change scope. Count files and lines changed, and observe whether the model tends to rewrite broadly.
    • Stability. Measure pass variability across repeated runs of the same task. When variability is high, a single leaderboard run is of limited value.
    • Cost. Record context length, iteration count, and total elapsed time. When capability is close, cost often determines whether a model can enter daily engineering workflows.

    Failure analysis has more actionable value than ranking. For example, if many failures concentrate on “patch cannot be applied,” improve diff format and context truncation first; if they concentrate on hidden tests, the model may have overfit visible examples rather than understood the specification.

    Common Biases and Controls

    Prompt leakage. Writing repository-specific conventions or even steps close to the standard answer into the system prompt turns evaluation into a prompt-engineering contest. The protocol should be public, fixed, and as short as possible.

    Inconsistent test visibility. In some runs the model can see all tests; in others it only sees failure summaries. This must be unified before comparison.

    Environment drift. Factors such as dependency versions, system libraries, and time zones can cause the same patch to pass sometimes and fail other times. The base image and lockfiles should be treated as part of the evaluation.

    Selection bias. Keeping only tasks the model finds easy, or choosing only popular repositories in one language, creates inflated conclusions. After adding or removing tasks, recompute the full set rather than carrying over old scores.

    Treating a leaderboard as an upper bound on capability. An evaluation set measures tasks within a protocol; it does not automatically equal architecture design, requirements clarification, or online troubleshooting capability. Conclusions should be limited to “performance on this type of software modification task.”

    How to Use Evaluation for Team Selection and Regression

    It is advisable to divide tasks into a public practice set, a fixed regression set, and a small private audit set. The public set is used to debug prompts and toolchains; the regression set is version-frozen and used to compare models or different configurations of the same model; the audit set is used to detect contamination and overfitting.

    When comparing two candidate models, use the same snapshot, the same iteration limit, and the same scoring script, and report confidence intervals or at least the number of tasks. When the difference is small and the number of tasks is also small, it is not appropriate to claim that one is clearly stronger.

    The evaluation job itself should be reproducibly schedulable: code snapshots in object storage, an isolated container environment for each run, logs and patches sent to a logging service, and failures searchable by task ID. If a team already uses container platforms, object storage, and logging services on Baidu AI Cloud, these artifacts can be integrated into existing pipelines, but evaluation conclusions still depend on task quality and protocol, not on hosting location.

    Whenever the model or prompt changes, rerun the regression set and compare whether failure types shift. Looking only at total score increases without watching for new failures can easily introduce hidden regressions in real repositories.

    Discipline for Writing and Maintaining Evaluation Sets

    • Each task has a unique identifier, language, repository snapshot version, acceptance command, and expected failure mode.
    • Reference solutions are only for author self-testing and must not enter model-visible materials.
    • Regularly retire tasks that cannot be reproduced reliably and add new real changes, so the benchmark does not remain stuck on outdated interfaces.
    • Publish the protocol before publishing rankings. A ranking without a protocol cannot be reviewed.
    • Do not present an unverified single high score as general capability.

    Software engineering capability is a set of decomposable, reproducible behaviors, not a slogan. When task authenticity, zero contamination, automated acceptance, and failure slices are done well, teams get more than a volatile rank: they get evidence that can guide model selection, prompt constraints, and engineering process improvements.