Testing LLM Code Generation: Capabilities, Limits, and Engineering Integration for Front-End Projects
This article evaluates how general-purpose large language models perform on document-driven front-end project generation, using a real test project with login, product list, and form pages. It summarizes observed gaps in requirement fidelity, filtering logic, field validation, and long-context constraint retention, then explains the causes and proposes a reusable four-dimension scoring method, structured requirements, layered generation, and automated acceptance gates for engineering teams.
1. Background: From Generating Code to Delivering a Project
Over the past two years, code generation has evolved from completing a few lines to producing a runnable project from a single requirement statement. When a new general-purpose LLM capability appears, the community often describes it as “matching a leading international model” or “able to replace mature templates.” Such judgments usually come from scattered samples and lack a reproducible evaluation standard. This article does not review any specific product. Instead, it frames the problem as a general technical question: where are the capability boundaries of general-purpose LLMs in document-driven front-end project generation, and how should engineering teams evaluate and integrate them?
I selected a real project as the test vehicle. The requirements resembled everyday business work: three typical page types (login, product list, and form), plus a structured requirements document that explicitly specified carousels, filter conditions, field validation, and interaction logic. The test focused on four dimensions: functional completeness, requirement fidelity, visual and engineering standards, and end-to-end time.
2. Test Observations: Capability Distribution Is Uneven
1. Entry Barrier and Output Format
The first issue in actual use was capacity limits: during peak periods, access required queuing or a paid channel, and only repeated attempts succeeded. This suggests that interactive generation capabilities must account for quotas, rate limiting, and fallback strategies in production, and critical paths should not depend on a single entry point.
The format of the output itself is a positive: it was not an isolated code snippet but a directly accessible project address containing a runnable project structure. The model chose the tech stack on its own and settled on a mainstream front-end framework. For developers, this significantly compresses the path from requirement to previewable output.
2. Login Page: Clear Structure, High Completeness
The login page is a relatively standardized scenario. The model implemented the carousel, form inputs, and basic layout with no obvious functional gaps, reaching a level that is runnable and close to launch with minor adjustments. The reason is that requirement patterns for such pages are highly convergent and training samples are dense, making alignment easier for the model.
3. List Page: Understanding Starts to Degrade
Problems concentrated on the list page. The requirements document clearly described the filter items and their linkage logic, but the filters were missing from the generated result. Notably, this was not a one-off omission: multiple list pages showed the same pattern — the page skeleton was correct, but functional semantics were lost. This indicates that the model tends to reproduce the “common appearance of a page” and is insufficiently sensitive to business constraints explicitly stated in the document.
4. Form Page: Incomplete Restoration of Fields and Validation
The form page was runnable overall, but the field set, validation rules, and interaction details deviated from the document. A complex form is essentially a high-coupling combination of “data model + constraints + state machine.” When requirements are described in natural language, the model often captures only field names and ignores implicit constraints such as required fields, linkage, and timing of error messages.
5. Visual Style and Efficiency
Visually, the result is “engineering-usable rather than product-impressive”: cleaner than a rough prototype, but still behind finished output based on a mature design system or component library, with an engineering-oriented design language. In terms of efficiency, complete generation took on the order of half an hour, while similar tasks take only a few minutes on some leading international models. The gap lies mainly in depth of understanding and iteration speed, not in whether the result runs.
3. Gap Analysis: Three Technical Explanations
First, the semantic gap between requirement expression and code. A “filter condition” in a natural-language document is a business concept; in code it becomes state variables, query parameters, request timing, and result merging strategies. Without an explicit intermediate representation, the model easily loses information during translation.
Second, constraint decay in long contexts. Project-level generation requires maintaining dozens of constraints within a single session. As the context grows, the weight of details declared early declines, showing up as “the later the page, the more it deviates from the document.”
Third, the lack of an executable acceptance loop. Generation usually has no enforced gates for unit tests or type checking, so the model cannot discover on its own that “the filter is not implemented” and must rely on manual comparison.
4. A Reusable Evaluation Method
Teams should build a four-dimension scorecard to avoid subjective impression-based judgments:
| Dimension | Observation Point | How to Judge |
|---|---|---|
| Functional completeness | Whether all items declared in the document are implemented | Checklist item by item |
| Requirement fidelity | Whether fields, validation, and linkage are consistent | Test case comparison |
| Engineering standards | Directory structure, types, testability | Static checks |
| Delivery efficiency | End-to-end time and number of rework rounds | Timing statistics |
When scoring, treat “document items” as the single source of truth: any function that is implemented but not declared earns no positive score, and any function that is declared but not implemented earns a negative score. This effectively suppresses the illusion that “it looks very similar.”
5. Engineering Integration Recommendations
1. Structure the Requirements Document
Rewrite natural language into a machine-verifiable structure, for example:
{"page": "product-list","components": ["filter-bar", "table", "pagination"],"constraints": [{"id": "F1", "type": "filter", "fields": ["category", "priceRange"], "linkage": "category->priceRange"},{"id": "V1", "type": "validation", "field": "priceRange", "rule": "min<=max"}],"acceptance": ["F1 rendered", "V1 enforced"]}
Structured items can be mapped directly to an acceptance checklist and used as a hard-constraint section in prompts.
2. Adopt a Layered Generation Strategy
Do not generate the entire project at once. Proceed step by step in the order “data model -> page skeleton -> interaction and validation -> style system,” feeding acceptance results back at each step. Example flow:
structure requirements -> generate data model -> generate page skeleton -> complete interaction constraints -> static checks -> manual spot check
3. Build Automated Gates
Run type checks, static scans, and basic test cases on the generated output as mandatory steps. Write assertions such as “whether the filter exists” and “whether required-field validation takes effect” so that unqualified output cannot move to the next stage.
4. Keep the Human-Machine Division Clear
The model is good at building skeletons and boilerplate code; humans are responsible for final decisions on business constraints and experience polish. Concentrating rework on “understanding deviations” rather than “syntax errors” yields the best overall efficiency.
6. Implications for the Open-Source Ecosystem and Industry Evolution
The significance of this capability for open source and AI development lies not in any single benchmark run but in three points. First, evaluation is moving from leaderboards to reproducible engineering tasks, and the community needs a unified task set and acceptance scripts. Second, the focus of capability competition is shifting from generation to understanding and constraint following, with instruction retention in long contexts, structured output, and verifiability becoming key metrics. Third, engineering integration paradigms are becoming standardized: structured requirements, automated gates, and layered generation will become common practices, with the model being only one part of the pipeline. General cloud-side support can include containerized runtime environments, object storage, logging services, and monitoring and alerting, used to support generation, evaluation, and canary releases.
7. Conclusion
The test shows that current general-purpose LLMs can already cover standardized pages in project-level front-end generation, but still have clear shortcomings in complex filtering, field validation, and long-document constraint retention, with efficiency and depth of understanding being the main sources of the gap. For developers, the right approach is not to wait for an “all-capable model” but to use structured requirements, layered generation, and automated acceptance to converge uncertainty into a controllable range.
