Evaluating LLM Code Generation and Engineering Practices for Real-World Projects

    This article presents a practical framework for evaluating and improving the code generation completeness of large language models in real development projects. Instead of relying on demo-level impressions, it breaks acceptance into five checkable layers—requirement coverage, interaction completeness, validation and boundaries, engineering usability, and generation efficiency—and shares a real front-end test showing that entry-level pages are nearly usable while complex interactions remain the dividing line. It also analyzes why constraints decay across long contexts and recommends structured inputs, executable acceptance cases, and automated validation loops to turn one-shot generation into sustainable iteration.

    1. Background: Why “It Runs” Does Not Mean “It Ships”

    Over the past year, general-purpose large language models with long-context and tool-calling capabilities have been widely used to generate complete application skeletons, covering everything from front-end pages to API-layer code. Discussions in the community often claim that a model “matches top-tier closed-source models,” but this kind of buzz usually stays at the demo level. Real development scenarios care about something different: given a requirements document, can the model reliably reproduce field relationships, validation rules, and interaction details, and output artifacts that can go straight into an engineering workflow?

    This article strips away specific product attributes and frames the problem as a general technical question: how to evaluate and improve the code generation completeness of large language models in real projects. The evaluation target is a front-end project generated by an AI coding tool, with the baseline being another round of generation for the same requirements. The focus is not on “which one is stronger,” but on extracting reusable evaluation methods and engineering constraints.

    2. Evaluation Method: Turning Subjective Feelings into Checkable Metrics

    To avoid “feels pretty good” conclusions, it helps to split acceptance into five layers, each with checkable items.

    1. Requirement coverage: whether all pages, modules, and fields listed in the document appear.
    2. Interaction completeness: whether filtering, pagination, sorting, dialogs, and linkage are actually implemented rather than just static placeholders.
    3. Validation and boundaries: required fields, format, length, uniqueness, error messages, and exception-state handling.
    4. Engineering usability: whether the directory structure, dependency declarations, environment variables, build scripts, and an accessible preview URL are all in place.
    5. Generation efficiency: the time from submission to a runnable artifact and the cost of retries on failure.

    A sample acceptance checklist can be expressed as structured data so it can be plugged into an automated pipeline:

    1. acceptance:
    2. coverage: {pages_total: 6, pages_done: 6}
    3. interaction: {filters: false, pagination: true, linkage: false}
    4. validation: {required: true, format: partial, unique: false}
    5. engineering: {build_pass: true, preview_url: true, env_file: false}
    6. latency_minutes: 35

    3. Test Recap: A Capability Gradient Across Three Page Types

    In a real front-end requirements test, the document specified the page list, filter conditions, and form field relationships, without constraining the tech stack, so the tool chose a mainstream front-end framework on its own.

    • Login-type pages: carousels, forms, and basic validation were all present, at a “ship after minor tweaks” level.
    • List-type pages: the structure was correct, but filter conditions were missing, and the same problem recurred across multiple list pages, indicating a capability gap rather than an occasional slip.
    • Form-type pages: runnable, but field linkage, validation order, and message wording deviated from the document, showing insufficient reproduction of complex relationships.
    • Visual style: clean and engineering-oriented, better than common prototypes, but still short of mature component templates in completeness, positioned as “engineering usability first.”
    • Efficiency: the whole round took more than half an hour, clearly slower than the baseline (on the order of minutes), and queuing plus rate limiting under the free tier further amplified the waiting cost.

    The conclusion is clear: entry-level pages are close to usable, while pages with complex interactions and dense constraints remain the dividing line. Depth of understanding, not volume of code, determines delivery quality.

    4. Gap Analysis: “Constraint Decay” in Long Contexts

    Similar problems are common across the industry and can be summarized in three points. First, constraint decay: the longer the document, the more easily rules appearing later are weakened, and “fine-grained rules” like filtering and validation are the first to be lost. Second, insufficient implicit reasoning: field linkage and state-machine-style interactions require multi-step reasoning, and the model tends to produce implementations that are structurally correct but behaviorally incomplete. Third, lack of an external validation loop: the generation process has no feedback from compilation, testing, or rule checking, so errors cannot self-correct.

    5. Improvement Strategy: Structured Inputs and Automated Validation

    Rewriting the requirements document into a machine-checkable structure is the most economical way to improve completeness.

    1. {
    2. "page": "product_list",
    3. "filters": [{"key":"status","type":"enum","required":false}],
    4. "columns": ["name","price","updated_at"],
    5. "form": {"fields":[{"key":"price","rules":["required","number","min:0"]}]},
    6. "acceptance": ["filter_bar_visible","empty_state_shown"]
    7. }

    Recommended engineering constraints include: specifying the tech stack and directory conventions; requiring an implementation plan before writing code; expressing acceptance items as executable test cases; adding static checks, unit tests, and end-to-end smoke tests to the pipeline; and automatically feeding failed items back into the prompt for a second generation pass. If relying on general cloud capabilities, artifacts can be hosted on object storage for preview, builds can run on a container platform, and log services plus monitoring alerts can track anomalies during generation and runtime—turning “one-shot generation” into “sustainable iteration.”

    6. Selection and Adoption Recommendations

    When selecting tools, teams should not look only at demo results but run layered evaluations on their own requirement sets: coverage for simple pages, constraint reproduction and regression stability for complex pages, while recording time and retry costs. For high-value modules, a hybrid mode of “model-generated skeleton + manual completion of key logic + automated validation as a safety net” is more reliable. In terms of open-source attributes and industry significance, open weights and open toolchains lower the barrier to trial, ease private deployment and fine-tuning, but ecosystem maturity still takes time to accumulate. The rational approach is to let evaluation data drive decisions rather than substituting buzz for validation.