Frontend Code Generation with LLMs: A Practical Test of Strengths and Weaknesses
This article tests how large language models generate frontend code from a real requirements document covering login, list, and form pages. It explains where the generated code met the requirements and where it fell short, describes the four evaluation dimensions, compares the results with a leading closed-source model, and outlines how to deploy generated frontend assets to cloud storage and container services. The findings reflect one test sample and should be verified before they are applied to other models.
Benchmark scores published by model vendors are usually based on general-purpose benchmarks, which can differ from real business work. This article uses a real frontend requirements document as the baseline and examines how a model performs on login, list, and form pages. It also explains how to reproduce a similar evaluation.
First, the limits of this test need to be stated. The original record does not disclose the model name and version, the frontend framework version, the exact prompts, or how time was measured. The conclusions below therefore apply only to this sample and cannot be generalized to all models. Before citing these conclusions, confirm that this information is available.
1. Evaluation Dimensions
The evaluation covers four dimensions. The first is requirement fidelity, which checks whether business fields, filtering logic, and validation rules are implemented as specified in the document. The second is interaction completeness, which checks whether page navigation and form submission form complete workflows. The third is interface quality, which judges whether the pages reach a level suitable for delivery. The fourth is generation efficiency, which records the time from issuing the instruction to obtaining a runnable project.
Each dimension should have a clear scoring standard. For example, requirement fidelity can be measured by the rate of missing fields, and interaction completeness can be judged by whether each key path works end to end. Without defined standards, scoring becomes a matter of subjective impression, and results are hard to compare across runs.
2. Login Page: Stable Basic Capability
The login page was the most complete result in this test. The requirements document called for a carousel and a basic login form. The generated code included form inputs, submission logic, and a basic carousel transition animation. With minor adjustments, the page could be used for an internal system or a pre-production environment. The login page has a standard structure and uses common components, so the model performed consistently on this type of task.
3. List Page: Multi-Condition Filters Were Often Missing
The list page revealed a clearer problem. The requirements document specified multiple filter conditions, including status, time range, and category, along with the linkage rules between them. The generated page rendered its layout and data table correctly, but the filter controls were missing entirely. Similar gaps appeared in several list scenarios, so this should not be treated as an isolated error.
This suggests that the model correctly understood the surface-level requirement that a list page should display data. It did not fully handle deeper logic, including dynamic filter components, multi-state management, and combined conditions. When using this kind of tool for list pages, treat filtering, sorting, and pagination as priority checks, and verify each one.
4. Form Page: The Largest Gap in Detail Fidelity
Form pages demand the most rigorous logic. The generated form ran, but its details deviated noticeably from the specification. The document defined field dependencies, such as a second field becoming required after a certain option is selected. The generated code did not implement this fully. Complex regular expression validation and the way error messages were displayed also deviated from the requirements.
This pattern appears to relate to long instructions. The longer the requirements document, the more likely local constraints are to be overlooked. In practice, validation rules can be split into separate items and implemented one at a time. Prepare one passing test case and one failing test case for each rule to reduce omissions.
5. Interface Quality and Comparison
The visual quality of the generated pages was slightly better than hand-drawn prototypes, but it still lagged behind mature enterprise component libraries. The overall style was simple and direct, which suits internal tools and prototype validation. Products aimed at end users still need designer involvement.
The test also compared the output with a leading closed-source model. The two models produced login pages of similar completeness. On the list and form pages, the closed-source model reproduced filter conditions, field relationships, and validation logic more accurately. In terms of time, the closed-source model finished project setup in about three minutes, while the model in this test took more than half an hour. The original record does not describe concurrency, network conditions, or the start and end points of the timing. The time gap may therefore partly reflect queuing, so it should not be attributed entirely to the model itself.
Based on this comparison, the main differences in frontend tasks come from how deeply the model understands business logic and how precisely it follows instructions.
6. Deploying Generated Frontend Assets to the Cloud
Generated frontend static assets usually go through four stages: build, upload, release, and monitoring. The following process uses Baidu Object Storage (BOS) and Cloud Container Engine (CCE) from Baidu AI Cloud as examples. Other providers, such as Alibaba Cloud and Tencent Cloud, offer comparable services. When choosing a provider, consider your existing infrastructure, compliance requirements, and pricing.
- Generate and build: Generate the code on a separate branch, install dependencies, and run the build. Confirm that the output runs locally.
- Upload static assets: Upload the build output to object storage. Before uploading, check the bucket permissions to avoid accidentally granting write access or exposing private data.
- Deploy the service: If the page needs dynamic capabilities, deploy it to a managed container platform. Assign the service account the minimum required permissions, and set resource limits.
- Monitor and roll back: Connect logging and alerting, and record the version number of each release. If a release fails or alerts behave abnormally, switch back to the previous version quickly.
- Control costs: Object storage is billed by capacity and traffic. Container clusters are billed by node count and running time. Set budget alerts for test environments, and release resources promptly after testing ends.
7. The Value of Open-Source Models
The value of open-source models comes mainly from three areas. First, enterprises can deploy models locally or in a private cloud, which keeps business code and requirements documents inside the internal environment and lowers the risk of data leakage. Second, publicly available model weights let the community fine-tune models for specific weaknesses, such as building training samples for form field dependencies and list filtering logic. Third, open projects can publish evaluation results and failure cases, which helps users judge model capabilities more accurately.
Whether these benefits materialize depends on the quality of community maintenance, the transparency of training data, and how openly evaluations are published. This test showed that, for complex forms and list pages with multiple conditions, open-source models still need stronger engineering constraints and manual review. Progress in these areas is needed before the gap with leading closed-source models can narrow.
8. Recommendations for Teams
If you plan to evaluate a code generation tool, prepare requirements documents for three to five representative pages first. Fix the model version and prompts, and record the missing items, timing, and runtime environment for each page. Write down the scope of the sample with the conclusions, and attach screenshots and logs so others can verify the results.
