Hands-on Evaluation of LLM Code Generation: A Reusable Methodology and Lessons Learned

    This article shares a hands-on evaluation of Large Language Model (LLM) code generation capabilities using real-world projects instead of standard benchmarks. It outlines a reusable testing methodology, covering environment setup, evaluation dimensions, and key findings. The author highlights that while Tier 1 models have reached parity in basic feature completion, the true differentiators lie in code elegance, correction costs, and natural language style. Finally, a practical checklist is provided to help developers assess new LLMs effectively within their own engineering workflows.

    1. Why Hands-on Testing Beats Benchmark Scores

    In recent years, LLMs have evolved rapidly, and vendors always release impressive benchmark scores. However, as frontline developers, what we care about is not “how high it scores on public datasets” but “whether it can do a good job in my project.” There is a huge gap between public benchmarks and real-world engineering: benchmark problems are usually isolated, with clear boundaries and sufficient context; real projects are full of legacy code, implicit conventions, and cross-module dependencies.

    Therefore, when a new flagship model is released, a reliable approach is to integrate it into your ongoing real projects, run it for a week or more, and use it for various tasks ranging from feature development and bug fixing to refactoring. Then, form a judgment based on actual output. This article documents such a comprehensive hands-on evaluation process and its conclusions, abstracting the methodology for readers to reuse.

    2. Testing Environment and Evaluation Dimensions

    2.1 Test Project Characteristics

    The testing vehicle was a medium-complexity front-end engineering project using a Rust toolchain with a Vite-like build solution. The characteristics of this type of project are: the build scripts and tooling layer have strong type constraints and performance requirements, while the application layer is typical component-based development. The alternating tasks of the two styles can comprehensively expose the model’s capability boundaries. The project complexity was “above average”—not enough to challenge the model’s limits, but sufficient to distinguish between Tier 1 and Tier 2 models.

    2.2 Evaluation Dimensions

    Simply looking at “whether it runs” is meaningless because current Tier 1 models can almost all meet functional requirements. What really sets them apart are the following four dimensions:

    1. Code Quality: Architectural soundness, abstraction levels, naming, boundary handling, and whether unnecessary complexity is introduced.
    2. One-time Pass Rate: Whether the generated code compiles, passes tests, and how many rounds of correction are needed.
    3. Instruction Following: Adherence to preset coding standards and style constraints.
    4. Natural Language Expression: The quality and style of explanatory text, comments, and communication.

    2.3 Key Testing Methods

    • Multi-model horizontal comparison: Rotating the same batch of tasks across different models to avoid single-model sample bias.
    • Maintain context consistency: Using the same prompts and project context for each task to control variables.
    • Record correction cost: Tracking the number of dialogue turns and manual edits required from the initial version to a mergeable state.

    3. Hands-on Findings: Tier 1 Models Are Reliable, Differences Lie in Details

    3.1 Feature Completion: Head Models Are Homogenized

    The most intuitive feeling during the test was that at the functional requirement level, several current Tier 1 models (including mainstream flagships) could fully handle all project requirements. None of them failed at “getting the feature done.” This indicates that basic coding capability is no longer the watershed for selection—if your task complexity is medium, any head model can handle it.

    3.2 Code Quality Differentiation Appears in “Elegance”

    What truly widens the gap is the engineering quality of the generated code. In the tests, the code generated by some models was clearly closer to the work of senior engineers in terms of module division, error handling, and interface design; other models tended to produce “AI-style spaghetti code” in the details—the logic worked, but the nesting was too deep, responsibilities were mixed, and there were obvious copy-paste traces.

    Take a typical example. For the same task of “reading a config and using a default value if missing,” a poorer implementation might look like this:

    1. // AI-style spaghetti code: deep nesting, mixed responsibilities
    2. fn get_config(key: &str) -> String {
    3. let cfg = load();
    4. if cfg.contains_key(key) {
    5. let v = cfg.get(key).unwrap();
    6. if !v.is_empty() {
    7. return v.clone();
    8. } else {
    9. return default(key);
    10. }
    11. } else {
    12. return default(key);
    13. }
    14. }

    A higher-quality version would return early, eliminate nesting, and avoid unnecessary unwrap:

    1. fn get_config(key: &str) -> String {
    2. match load().get(key).filter(|v| !v.is_empty()) {
    3. Some(v) => v.clone(),
    4. None => default(key),
    5. }
    6. }

    The good news is that the impact of such issues is usually limited. With an extra round of dialogue and clear improvement instructions, the models can correct them. Therefore, correction cost is the key metric: although “the first draft isn’t good enough,” whether it can be fixed in one round or takes three to converge makes a completely different impact on development efficiency.

    3.3 Text Capability: Unconstrained Style is a Hidden Cost

    Beyond code, the explanatory text output by the models also deserves attention. The tests found that without any preset instructions, some models’ text clearly had an “overly casual IT” vibe, with abbreviations flying everywhere—easy to read but not rigorous. Some had a more natural and restrained style, closer to standard technical documentation. Others tended to use an overly flattering tone in every sentence, diluting the information density.

    The good news is that style issues are intervenable: as long as you explicitly state style requirements in the system prompt (e.g., “avoid abbreviations, use complete sentences, maintain a neutral declarative tone”), models can adjust effectively. This is why it is recommended to hardcode “text style constraints” into your team’s project-level prompt templates rather than making temporary verbal corrections each time.

    4. Abstracting a Reusable Model Evaluation Checklist

    By generalizing the above hands-on experience, we can summarize a checklist for readers to use when evaluating any new model:

    1. Choose real projects, not toy problems. Test with ongoing project tasks so that the problems come with real context, making the evaluation conclusions transferable.
    2. Test for at least a week. Short-term, high-intensity testing can easily lead to survivorship bias. A week or more is needed to cover diverse task types like development, debugging, and refactoring.
    3. Record correction rounds. Beyond feature completion, use “rounds required to converge” as a core quantitative metric.
    4. Audit code maintainability. Focus on naming, abstraction levels, boundary handling, and defensive programming, rather than just whether it runs.
    5. Evaluate default style and controllability. A poor default style doesn’t matter, but you must confirm whether prompts can effectively constrain it.
    6. Mind the sample size. Repeat tests for the same task with at least two or three different phrasings to avoid being misled by accidental single outputs.

    5. Conclusion

    LLM selection is shifting from “chasing the new” to “pragmatism.” Benchmark scores can help filter out obviously lagging candidates, but choosing within Tier 1 relies solely on real-world testing in your own projects. Instead of agonizing over community debates about “which one is stronger,” spend a week letting the candidate models hand in their homework in your codebase—the data will be more convincing than you imagine. Meanwhile, consolidating the prompt templates and style constraints accumulated during the evaluation process will become a long-term engineering asset, regardless of which model you ultimately choose.