Evaluating LLM Capabilities in Software Development: Methods and Practices

    This article explains how development teams can evaluate large language models for software development work in a systematic way. It covers defining evaluation goals and scope, building a representative task set, designing automatic and human scoring, setting up a reproducible test process, analyzing results with suitable statistics, avoiding common evaluation mistakes, and turning results into model selection and rollout decisions.

    1. Why Systematic Model Capability Evaluation Matters

    Model versions are updated quickly. A new version may improve noticeably on some tasks and regress on others. If a development team relies on a few manual trials to judge a model, the conclusion can be skewed by individual examples, and it is hard to explain to other team members.

    Software development scenarios are also diverse. Common needs include code completion, unit test generation, explaining error messages, turning requirements into code, code review, and API documentation generation. Different tasks place different demands on a model. For example, code completion depends more on context understanding and response speed, while code review depends more on thoroughness and false positive rate. Combining all tasks into one overall score often fails to guide actual model selection.

    Model selection also affects cost, data compliance, and online stability. A single selection decision can shape development efficiency and operating costs for several months. Therefore, the evaluation process needs clear goals, repeatable steps, and traceable records.

    2. Defining Evaluation Goals and Boundaries

    Before testing, break the business scenario into specific tasks. For example, a team’s daily work can be divided into three types: code generation during new feature development, log analysis during production incident troubleshooting, and organizing and answering questions about internal documentation. Each type should be refined further into input format, expected output, and acceptance criteria.

    The evaluation should cover at least the following dimensions:

    • Correctness: Whether the output passes tests, solves the problem, and is free of factual errors.
    • Completeness: Whether it covers all requirements and handles edge cases without omissions.
    • Instruction following: Whether it follows the required format, language, length, and fields.
    • Stability: Whether results vary within an acceptable range across repeated calls with the same input.
    • Latency: The time from sending a request to receiving the complete response. Focus on the median and tail percentiles.
    • Cost per successful task: The average spend for each task that passes, including retries and the hidden cost of manual correction.

    Equally important is stating what the evaluation does not cover. For example, this round does not compare brands or pricing strategies, and it does not assess model performance outside development scenarios. Clear boundaries make the results comparable.

    3. Building a Representative Task Set

    The quality of the task set determines how much the evaluation conclusions can be trusted. The most reliable sources are real team tickets, historical code changes, and production incident records. These samples are close to actual work and reflect real difficulty.

    Stratify tasks by difficulty, for example into easy, medium, and hard tiers. An easy task might be writing a docstring from a function signature. A medium task might be adding unit tests to an existing module. A hard task might be locating a cross-module defect from the call relationships across several files. With tiers, you can observe how model capability declines as difficulty rises, rather than looking only at the average.

    Each category needs enough samples for adequate coverage. A common starting point is at least 30 cases per category, but this is only an empirical reference. Adjust the actual number based on task variance and statistical requirements.

    When building samples, pay attention to the following:

    1. Desensitization: Remove keys, personal information, internal domain names, and customer data. Replace them with placeholders where necessary.
    2. Contamination control: Confirm that test samples do not appear in the model’s likely training sources. If that cannot be confirmed, note the risk in the report.
    3. Keep reference answers: Record a reference answer or acceptance criteria for each sample to support later review.

    A sample can be described with the following structure:

    1. case_id: REFACTOR-017
    2. tier: medium
    3. task: Convert the given synchronous function into an asynchronous implementation while keeping the original return structure
    4. input: Function source code and a caller example
    5. checker: Run the attached unit tests and check whether any blocking calls remain

    4. Designing Scoring Criteria

    Scoring falls into two categories, automatic and human, which complement each other.

    Automatic scoring suits tasks whose results a machine can judge. For example, code generation can be checked by running unit tests, format tasks can be validated with a parser, and static analysis tools can catch obvious syntax and style issues. Automatic scoring is fast and repeatable, which makes it suitable for large-scale runs.

    Human scoring suits tasks that require judging quality, such as whether an explanation is clear or whether code review comments are useful. Human scoring should be blind, so graders do not know which model produced each output. The rubric should describe each score level concretely. For example, 1 means the conclusion is wrong and highly misleading, 3 means the conclusion is broadly correct but omits key conditions, and 5 means the conclusion is correct, complete, and directly usable.

    To check whether human scoring is reliable, have at least two graders score independently and calculate inter-rater agreement, for example Cohen’s kappa. If agreement is low, the scoring criteria are probably ambiguous. Revise the criteria before continuing the evaluation.

    5. Building a Reproducible Test Process

    Reproducibility is a basic requirement of evaluation. The test process should fix the following variables:

    • System prompts and task templates. Record a version number for every change.
    • Sampling parameters. Set a low temperature to reduce randomness, and enable a fixed random seed where the interface supports it.
    • Input preprocessing, including truncation length, file concatenation order, and whitespace handling.
    • Call time windows. Avoid peak and off-peak periods so that network and queuing differences do not skew latency data.

    The test framework should include concurrency control, retries, and failure logging. The example below gives a minimal structure that is independent of any specific service. You implement call_model yourself to wrap the actual API call.

    1. import time
    2. import statistics
    3. from dataclasses import dataclass
    4. from typing import Callable
    5. @dataclass
    6. class Case:
    7. case_id: str
    8. prompt: str
    9. checker: Callable[[str], bool]
    10. tier: str = "medium"
    11. @dataclass
    12. class Result:
    13. case_id: str
    14. passed: bool
    15. latency_s: float
    16. output: str = ""
    17. error: str = ""
    18. def run_suite(call_model: Callable[[str], str],
    19. cases: list[Case],
    20. retries: int = 2) -> list[Result]:
    21. results: list[Result] = []
    22. for case in cases:
    23. last_error = ""
    24. for attempt in range(retries + 1):
    25. start = time.perf_counter()
    26. try:
    27. output = call_model(case.prompt)
    28. latency = time.perf_counter() - start
    29. passed = case.checker(output)
    30. results.append(Result(case.case_id, passed, latency, output))
    31. break
    32. except Exception as exc:
    33. last_error = str(exc)
    34. if attempt < retries:
    35. time.sleep(2 ** attempt)
    36. else:
    37. results.append(Result(case.case_id, False, 0.0, error=last_error))
    38. return results
    39. def summarize(results: list[Result]) -> dict:
    40. succeeded = [r for r in results if not r.error]
    41. latencies = [r.latency_s for r in succeeded]
    42. total = len(results)
    43. return {
    44. "total": total,
    45. "pass_rate": sum(r.passed for r in results) / total if total else 0.0,
    46. "error_rate": (total - len(succeeded)) / total if total else 0.0,
    47. "p50_latency_s": statistics.median(latencies) if latencies else None,
    48. }

    This structure separates execution, judgment, and statistics. That makes it easy to replace the scoring function or add new metrics. Failed requests are counted separately, so they are not recorded as incorrect model answers, and interface stability problems are not hidden.

    6. Analyzing Results

    After collecting raw data, use suitable statistical methods to interpret the results. This prevents random fluctuation from being mistaken for a real difference.

    First, report confidence intervals for proportion metrics such as pass rate. With small samples, a gap of a few percentage points between two models may be entirely random. The Wilson interval gives a more robust estimate of small-sample proportions than a simple normal approximation, so it is a common choice.

    Second, results from two models on the same sample set are paired data. For this comparison, use McNemar’s test. It looks only at the samples where the two models disagree and judges whether the difference is significant. Comparing two pass rates as independent populations ignores the correlation between samples and gives weaker conclusions.

    Third, do not rely on average scores alone. Compute statistics by task category and difficulty tier to see where each model is strong and where it is weak. Two models with similar overall scores may differ greatly on key tasks.

    Fourth, look at latency percentiles rather than single values. The median reflects typical experience, while P95 or P99 reflects tail behavior. Tail behavior matters especially for interactive scenarios.

    Fifth, calculate cost based on effective output. A model with a lower unit price may need more retries or more manual correction, so its actual cost can be higher. Calculate the average spend per successful task and include the time spent on manual correction.

    7. Common Pitfalls

    Several types of problems most often lead to wrong conclusions:

    1. Evaluating with public or possibly trained-on questions. A model may perform unusually well on similar questions, which does not reflect its capability on real business tasks. Prioritize private internal samples and update them regularly.
    2. Testing only once. LLM output is random, so a single result is not enough. Run each sample several times and measure the variation.
    3. Tuning prompts for only one model. If prompts are designed for only one model, the other model is at a disadvantage. Design prompts uniformly. Where necessary, record the tuning process for each model separately and report it fairly.
    4. Using short trial performance to infer long-term stability. Service quality during limited-time access, temporary quotas, or promotional periods may differ from normal conditions. The evaluation report should record test times, and results should be retested under normal conditions before formal procurement.
    5. Treating fluency as correctness. Model output is often smooth and well formatted, but its logic or details may be wrong. Acceptance criteria should focus on functional correctness and verifiability, not surface text quality.
    6. Ignoring failure cost. A single wrong output that causes a production incident costs far more than a few extra seconds of latency. High-risk tasks should have stricter pass thresholds.

    8. From Evaluation to Selection and Rollout

    The final purpose of evaluation is to support decisions. Organize results into a fixed-format report that includes test goals, sample description, scoring criteria, statistical results, key findings, and risk notes. The report should let people who did not take part in the testing understand the scope where the conclusions apply.

    During rollout, a canary strategy works well. Enable the new model first for