How to Test and Evaluate LLMs for End-to-End Frontend Project Generation
Generating a complete, runnable frontend project from a requirements document is a fundamentally different challenge from producing a single code snippet. This article presents a reproducible method for testing and evaluating how large language models handle this end-to-end task: fixed inputs and a fixed baseline, requirements that cover verifiable complexity, and tiered observations across page types. It shows where models excel (mature single-page patterns), where they systematically fall short (multi-condition filtering, complex form validation, cross-page consistency), and why. It then proposes five practical improvements—structured requirements, contract-first generation, per-page task decomposition, an automated validation loop, and internal component-library alignment—alongside an auto-collectable metrics framework, selection guidance for open-weight models, and a risk checklist.
1. The Problem: From “Generating Code” to “Delivering a Project”
LLMs writing code is long past the “can it even do it” stage. The real question worth debating is this: given a requirements document, can a model independently produce a structurally complete, runnable, and directly accessible full frontend project?
These two tasks are nowhere near the same difficulty level. Generating a sort function, a pagination component, or a set of form-validation rules is local reasoning with a standard answer—the model’s training distribution is saturated with similar patterns, so performance is usually stable. Going from a requirements document to a complete project, however, forces the model to do four kinds of work simultaneously:
- Requirement parsing: turning natural-language descriptions into structured definitions of pages, components, state, and interactions;
- Consistency maintenance: keeping field names, state management, and routing structures from conflicting across pages;
- Filling in implicit constraints: edge cases the document never states but that engineers assume by default (empty states, loading states, error states, overly long text, unauthorized-access prompts);
- Long-horizon planning: keeping the architecture from drifting across dozens of file writes.
If any single one of these links breaks, the final output shows the classic symptom of “correct skeleton, distorted details”—and this is exactly the failure mode most worth watching in practice. It is harder to spot than something that “simply won’t run,” and it is more easily mistaken for a usable result.
2. Evaluation Method: Turning Subjective Impressions into Reproducible Measurements
The reason online model comparisons contradict each other is usually not that the models differ much—it is that the experiments are not reproducible. To make conclusions trustworthy, an evaluation has to set ground rules first.
2.1 Fixed Task + Fixed Control Baseline
A valid controlled experiment needs three constraints:
- The same requirements document goes to every model under test, with no wording adjustments;
- The same set of prompt constraints (whether the tech stack is fixed, whether multi-turn follow-ups are allowed, the cap on generation rounds);
- The same acceptance checklist, checked off item by item by a human rather than relying on the model’s self-assessment.
The key precondition is that this requirements set must have already been implemented end-to-end once by a strong baseline model, with a runnable result to show for it. Without that baseline, all that remains is subjective impression—you cannot tell “the model is weak” apart from “the requirements were written vaguely.”
2.2 Requirements Must Cover “Verifiable Complexity”
For an evaluation to be meaningful, the requirements document should contain at least the following, none of which can be skipped:
- More than 3 pages, plus their routing relationships;
- At least 1 list page with multi-condition combined filtering;
- At least 1 form page with field linkage + multi-level validation;
- Explicit visual specifications (primary color, border radius, spacing, responsive breakpoints);
- Explicit state requirements (loading, empty data, failure-and-retry).
Testing only a low-complexity task like “a login page + a card wall” won’t reveal any differentiation—nearly every mainstream model will pass.
3. Practical Observations and Tiered Conclusions
In a controlled test (tech stack left unconstrained, with the model choosing a mainstream component-based frontend framework on its own), capability clearly stratified by page type.
3.1 High-Completion Zone: Mature Single-Page Patterns
Login pages, hero sections with auto-rotating carousels, and static display pages all reached roughly comparable completion. What these pages share is: strong patterns, few states, and short interaction paths. The model only has to reproduce a pattern that appears repeatedly in its training data; fields, buttons, and navigation logic come out essentially complete—at a “tweak it slightly and it’s usable” level.
Conclusion: this category of page can already be replaced by automated generation, and the human investment-to-return ratio is clearly low.
3.2 The Breakdown Zone: Multi-Condition Filtering and List Interactions
Problems surface starting with list pages. Typical symptoms are:
- The page structure is correct (table/cards, paginator, and search box all present);
- But filter conditions explicitly stated in the requirements are missing entirely, or only a single condition is implemented;
- The linkage between filtering and pagination is broken—changing a filter doesn’t reset the page number;
- Filter state is not synced to the URL, so a refresh loses it.
More importantly, this is not a one-off. When the same kind of omission appears across multiple list pages, it indicates a systematic capability gap rather than sampling randomness. This matters enormously for engineering adoption: random defects can be solved by retrying, but systematic defects can only be solved by reworking the input and the process.
3.3 Complex Forms: Field Relationships and Validation Chains Distort Most Easily
Form pages are the dividing line. They run, but fidelity drops noticeably:
- Field-level validation rules get simplified (for example, “required + length” is implemented while regex rules are lost);
- Linkage logic is missing (the rule “show B only after selecting A” is ignored);
- Cross-field validation and asynchronous uniqueness checks at submit time are almost never added proactively;
- The position and wording style of error messages is inconsistent.
The cause isn’t hard to understand: a form is a state machine plus a constraint network, and the number of rules grows non-linearly with the number of fields. In the requirements document these rules are usually scattered across different sections, making it hard for the model to converge on them globally.
3.4 Visuals and Engineering Standards: Usable First, Not Impressive
On the visual side, output generally shows “engineering-usable > product-polished”: spacing is basically orderly and hierarchy has no obvious errors, but compared with a finished result from a mature component library or a mature atomic-styling approach, the design sense is clearly plain—lacking branded detail work (micro-interactions, gradient layering, empty-state illustrations, responsive reflow strategies).
Engineering standards also need a human backstop: directory structure is arbitrary, component granularity is inconsistent, styles are duplicated, and accessibility attributes (semantic tags, focus management, contrast, form label association) are essentially absent.
3.5 Delivery Form and Latency: Easily Overlooked Practical Metrics
Two non-capability dimensions equally determine real-world value:
- Delivery form: whether it provides only code snippets or an online preview URL that can be accessed directly. The former still requires a human to set up the environment, install dependencies, and get the build working; the latter can go straight into acceptance, an enormous difference in efficiency.
- Generation latency and stability: a full project generation can take tens of minutes, and if it fails midway the whole thing must restart, which is very costly. Add peak-hour rate limiting and queues plus free-tier quotas, and actual usability ends up well below the on-paper capability.
4. Root-Cause Analysis of the Capability Gaps
Attributing the phenomena above, they roughly fall into four layers:
- Context dilution: the longer the requirements document, the lower the attention weight of constraints in the middle-to-late sections. List-page filter conditions are usually written in the middle of the document—exactly where they’re most likely to be “summarized away.”
- No feedback loop: the model produces output in one shot, with no one correcting it. Human engineers converge on correctness through a “write–run–look–fix” cycle; pure forward generation removes that cycle entirely.
- Training distribution biased toward local code: high-quality code snippets vastly outnumber “complete project + requirements document” pairs in public corpora, so models are good at snippet reproduction but weak at cross-file architectural consistency.
- Implicit knowledge is inexpressible: a convention like “the page number resets after filtering” is something document authors often assume goes without saying. The model can’t read minds, so the omission is inevitable.
5. Actionable Improvement Plan
The conclusion is: at the current stage, the more effective approach is to rework the input and the process rather than wait for the model to get stronger. The following five changes deliver the most direct gains.
5.1 Structured Requirements: Turn Prose into Verifiable Configuration
Rewrite natural-language requirements into numbered, acceptance-conditioned structure. Both readability and verifiability improve at once:
page: product_listroute: /productsfilters:- id: categorytype: selectoptions_source: api://categorieson_change: [reset_page, refetch]- id: price_rangetype: number_rangevalidate: min <= max- id: keywordtype: textdebounce_ms: 300pagination:default_page_size: 20reset_on: [filters.changed]states: [loading, empty, error, partial]acceptance:- "After any filter changes, the page number resets to 1"- "Filter state syncs to the URL query and persists after refresh"
The key change is that every requirement now carries a true-or-false acceptance condition of its own. This turns “the filter wasn’t implemented” from a subjective impression into a failure that a single automated check can catch.
5.2 Contract-First: Make Type Definitions the Single Source of Truth
Have the model produce the data models, API contracts, and validation schemas first, then generate page code only after a human reviews and confirms them. This way field relationships, required-ness, and validation rules are defined in exactly one place and referenced during page generation rather than reimagined—significantly suppressing form-related fidelity loss.
5.3 Task Decomposition: Split by Page, Not by Code
Generate serially with “one page per task” as the unit, where each task inherits the same contract and design tokens. Compared with generating the whole project at once, cross-page naming conflicts and architectural drift drop sharply, and the cost of a failed retry falls from “start over entirely” to “redo a single page.”
5.4 Automated Validation Loop: Move Human Acceptance Forward into Machine Acceptance
for attempt in range(MAX_ATTEMPTS):patch = model.generate(task_spec, contract, design_tokens)report = run_checks(patch) # type checks / lint / unit tests / accessibility / visual regressionif report.failed_count == 0:return patchpatch = model.fix(patch, report.failures) # feed the failure info back to the modelraise GenerationBudgetExceeded(report)
This loop addresses the “no feedback loop” problem from Section 4. Machine feedback converges far faster than a human pointing out issues one by one, and it can run unattended inside a pipeline.
5.5 Align with the Internal Component Library
Provide an internal component inventory with usage examples as reference input, so the model composes from existing components rather than inventing styles out of thin air. This addresses both visual consistency and engineering standards at once—far cheaper than refactoring after the fact.
6. Evaluation Metrics
For an evaluation to stay useful over the long term, its metrics must be auto-collectable:
| Dimension | Metric | Collection method |
|---|---|---|
| Functional completeness | Acceptance-item pass rate | Automated check against a structured acceptance list |
| Field fidelity | Proportion of contract fields and validation rules matched | Contract comparison |
| Interaction correctness | Pass rate of linkage/reset/sync test cases | End-to-end tests |
| Engineering quality | Lint and type-check failure count, test coverage | Pipeline |
| Accessibility | Semantic-tag coverage rate, contrast-warning count | Static scanning |
| Latency and stability | End-to-end duration, first-pass rate, retry count | Call logs and monitoring alerts |
| Cost | Inference cost per successful delivery | Usage-billing attribution |
Among these, the first-pass rate and the cost per successful delivery are the most easily overlooked, yet they most directly determine whether the approach can enter a production workflow.
7. The Significance of Open-Weight Models and Selection Guidance
Open-weight models (downloadable weights, deployable on private infrastructure) offer several irreplaceable advantages for these long-chain tasks:
- Data stays in-domain: requirements documents often contain business-sensitive information, and private deployment is a hard constraint in many industries;
- Tunable: internal component usage, coding standards, and past acceptance feedback can be turned into training or retrieval corpora, targeting systematic gaps directly;
- Reproducible evaluation: with fixed weights and controllable versions, results on the same evaluation set are comparable and traceable—whereas silent upgrades to closed services invalidate historical baselines;
- Controllable cost: high-frequency, patterned page generation can be pushed down to smaller models.
A pragmatic selection principle is to layer the models: use a flagship model for reasoning-heavy steps like architecture planning, contract design, and complex forms; use small models or a template engine for patterned pages like list and detail pages; and keep high-risk pages (payment, permissions, compliance-related) out of the automated generation flow entirely.
As for engineering support, the full loop—model invocation, evaluation sets and artifact storage, inference-service hosting, and logging and monitoring—can be built on general-purpose capabilities available in public clouds. Baidu AI Cloud’s general service categories, such as its large-model platform services, object storage, log services, and monitoring and alerting, can cover the chain from experiment records to production observation; consult the official documentation for specific integration methods and quotas.
8. Risk Checklist
- Hallucinated dependencies: importing libraries that don’t exist or are deprecated must be intercepted at the build stage, with dependency versions locked;
- Security gaps: generated API calls missing input validation, or secrets hardcoded into the frontend artifact—enforce static scanning;
- Silent regression: model version updates changing the output for the same requirements—freeze the evaluation set and version baseline;
- Maintainability debt: generated code lacking tests and documentation is usable in the short term but hard to maintain in the long term—make test generation part of the delivery standard.
9. Conclusion
On the task of “generating a complete frontend project from a requirements document,” the current capability distribution of mainstream models is uneven: mature-pattern pages are already close to replacing human work, while multi-condition filtering, complex form validation, and cross-page consistency remain clear systematic gaps; visuals and engineering quality generally stay at “usable” rather than “impressive”; and latency and rate limiting further degrade the real experience.
The point of benchmarking against a flagship model isn’t the ranking—it’s what it reveals: the current bottleneck lies mainly on the engineering side, not the model side. The four changes—structured requirements, contract-first, task decomposition, and an automated validation loop—can lift delivery quality a full notch under existing model capabilities. Models will keep getting stronger, but designing “verifiability” into the process pays off regardless of how the models iterate.
