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

    This article examines how to evaluate the code generation capabilities of large language models (LLMs) against real frontend requirements and turn the findings into reusable engineering practices. Using a multi-page business requirement document covering login, list, and form pages, it shows where current models perform well and where they fall short, then traces the gaps to instruction dilution in long contexts, missing explicit constraints, and the lack of verifiable acceptance criteria. It closes with practical recommendations on structuring requirements, generating in stages, and building machine-checkable validation loops.

    1. Introduction: From Impressive Demos to Engineering-Ready Output

    Over the past year, the code generation capabilities of large language models have evolved rapidly, and discussions about their performance on real projects keep heating up. Social platforms are full of claims like “matching top international models” or “the rise of domestic models,” but most of these conclusions come from single-point demos. For developers and enterprise users, the real question is not a leaderboard score. It is whether a model can reliably produce a well-structured, interactive, and maintainable project when there are no language constraints, the requirements document is long, and the number of pages is large.

    Setting aside specific product attributes, this article frames the topic as a general technical question: how to evaluate the code generation capabilities of large language models against real frontend requirements, and convert the evaluation findings into reusable engineering practices.

    2. Evaluation Method: Real Requirements Instead of Toy Examples

    The validity of an evaluation depends on sample quality. Toy-level examples, such as a single-page to-do list, cannot expose a model’s weaknesses in requirement understanding. This evaluation therefore uses a real business requirement document containing three types of pages: login, list, and form. Its characteristics are as follows:

    • Requirements are provided as a natural-language document, including field definitions, validation rules, and interaction descriptions.
    • No tech stack is specified; the model chooses on its own.
    • Pages are linked through shared data and state, testing cross-page consistency.
    • The output must be a complete, accessible project rather than isolated code snippets.

    The evaluation uses four dimensions: requirement coverage, interaction fidelity, visual and engineering standards, and generation efficiency.

    3. Observed Results: The Capability Boundary Shows Up in “Depth of Understanding”

    3.1 Login Page: High Completion

    Requirements such as the carousel, form validation, and submission feedback were all implemented. The page is functionally complete with no obvious gaps, at a level of “ready to ship after minor adjustments.” This type of page has a mature structure and fixed patterns, which is where current models perform best.

    3.2 List Page: Missing Filtering and Linkage Logic

    The page skeleton is correct, but the filter options explicitly stated in the document were not implemented. Notably, this problem recurred across multiple list pages, indicating that this is not an occasional fluctuation but a capability gap in overall coverage of complex interaction requirements.

    3.3 Form Page: Distorted Field Relationships and Validation Rules

    The page runs, but details such as field linkage, validation timing, and error messages deviate from the document. Forms are the most business-semantics-dense part, and the model’s fidelity here directly determines usability.

    3.4 Style and Efficiency

    The visual style is engineered and tidy but lacks design sense, still trailing mature component templates. Generation time is noticeably longer than top international solutions, and queueing and concurrency limits also affect the experience. The positioning can be summarized as: engineering-usable > product-polished.

    4. Root-Cause Analysis: Not “Can It Write Code” but “Did It Understand”

    Comparing the three page types side by side reveals a clear pattern: the more standard the structure, the better the performance; the more complex the semantics, the more noticeable the degradation. The causes can be summarized in three points:

    1. Instruction dilution in long contexts: The longer the requirements document, the more easily constraints in later sections are weakened. Non-core descriptions like filter conditions are the first to be lost.
    2. Implicit constraints lack explicit expression: “The list must refresh in linkage after filtering” is cross-component state management. If the document provides no data contract, the model can only guess.
    3. No verifiable acceptance criteria: Without an acceptance checklist, the model tends to ensure “the page renders” first, rather than “the rules are satisfied.”

    5. Engineering Recommendations: Turning Model Capability into Delivery Quality

    5.1 Structure the Requirements Document

    Rewriting natural-language descriptions into structured fragments can significantly improve coverage:

    1. ## Page: Product List
    2. - Filters: category (single-select), price range (numeric), listing status (toggle)
    3. - Interaction: any filter change -> reset pagination -> re-request -> update list
    4. - Empty state: show placeholder and a "Clear filters" entry when there is no data
    5. - Acceptance: all three filters are visible and effective

    5.2 Generate by Page and in Batches

    Split tasks by page. First produce the data contract and type definitions, then generate the UI, and finally complete the interactions. This avoids long one-shot output that causes later instructions to fail.

    5.3 Establish a Machine-Verifiable Acceptance Step

    Write “acceptance” as executable assertions (component existence, required fields, number of linkage triggers), and combine them with automated testing and general cloud capabilities such as logging services and monitoring alerts to form a regression loop.

    5.4 Human-Machine Division of Labor and Selection Judgment

    Models are suited to scaffolding, boilerplate code, and first-draft pages; architecture decisions, complex state design, and performance optimization should still be led by developers. For selection, it is recommended to run a small-scale side-by-side comparison on your own requirement set, focusing on coverage and rework cost rather than a single leaderboard.

    6. Conclusion

    LLM code generation has crossed the threshold of “can it run,” and the focus of competition is shifting to depth of requirement understanding and engineering consistency. For teams, the key to improving delivery quality is not waiting for a stronger model, but upgrading the way requirements are expressed, the task-splitting strategy, and the acceptance system in parallel. The returns from these three investments are often more stable than switching to any single tool.