Testing LLM Frontend Code Generation: Strong Page Scaffolding, Weak Complex Interactions

    This article explores the capabilities of Large Language Models (LLMs) in generating frontend code from requirement documents. Based on a hands-on test of a typical admin system, we evaluate the performance of LLMs across login, list, and form pages. The findings reveal that while LLMs excel at scaffolding standard pages, they struggle with complex interactions and detailed validations. We provide actionable checklists for code review and enterprise integration to help teams safely leverage AI coding tools.

    Large Language Models (LLMs) can now generate complete frontend projects from requirement documents. However, developers often ask: Can they handle complex pages? How should enterprises evaluate these tools? Which tasks can be delegated to the model, and which require human oversight? This article addresses these questions by summarizing the results of a hands-on test and providing ready-to-use checklists.

    1. Test Scope and Information Disclosure
    The test selected a typical middle-office and backend admin system, including a login page, a list page, and a form page. The requirement document described the page structure, carousels, multi-condition filtering, cascading filters, form field mapping, and validation rules. It is important to note that the original test did not disclose the model name and version, frontend framework and dependency versions, running environment, the full requirement document, scoring dimensions, or pass criteria. Therefore, the conclusions below only represent observations from this specific test and cannot be generalized to all models or projects. Readers looking to reproduce the test should fill in these information gaps first.

    2. Login Page: High Usability, but Pre-launch Verification Required
    The login page was the best-performing scenario in the test. The model read the carousel requirements and implemented them, producing a complete page structure, clear component division, and an accessible project URL. The generated content was close to a usable state, requiring only minor modifications.

    However, “minor modifications” must be backed by clear acceptance criteria. Before adopting the generated results, confirm the following four points:

    1. Manual effort: Record the number of modified files and lines of code, distinguishing between style and logic modifications.
    2. Verified features: List functions manually tested, such as login, form submission, and carousel switching.
    3. Uncovered boundaries: For example, limits on failed login attempts, token expiration handling, and retries under weak network conditions.
    4. Security review: Check password transmission methods, sensitive information stored on the frontend, and known vulnerabilities in third-party dependencies.

    Only after confirming these four points should the login page be moved to a testing or staging environment. Pages involving accounts and identity authentication should not be pushed directly to production by default.

    3. List Page: Multi-condition and Cascading Filters are the Main Shortcomings
    The list page exhibited more obvious issues than the login page. The requirement document defined multi-condition and cascading filters, but the generated code only completed basic table rendering, failing to implement the filter interactions as documented. This issue repeatedly appeared in similar pages.

    List pages rely heavily on state management and asynchronous requests. For instance, selecting a “Department” should reload the “Employee” options; changing filter conditions should reset pagination to the first page; and during rapid consecutive operations, the returned results of older requests should not overwrite newer ones. While the model understands the concept of a “list,” it struggles to translate these dynamic processes into complete code.

    When reviewing list pages, focus on these five areas:

    • Whether cascading fields are correctly cleared and reloaded.
    • Whether filter conditions sync to URL parameters and are preserved after a page refresh.
    • Whether the total number of items and current page number remain consistent when pagination and filters are used together.
    • Whether race conditions for concurrent requests are handled (e.g., using request cancellation or ignoring stale responses).
    • Whether the page provides clear prompts for empty results and API errors.

    4. Form Page: Validation Rules Require the Most Human Review
    Form pages demand the highest level of detail, covering field type mapping, required and format validation, cascading validation, asynchronous validation, and error prompts. In this test, the model generated a functional form, but its field accuracy, validation rigor, and interaction details deviated significantly from the requirements. The model tends to generate generic form structures, ignoring custom rules defined in the document for specific business needs.

    It is recommended to compile the validation rules into a checklist for item-by-item review:

    • Field types: Whether numbers, dates, and enums use the correct controls and formats.
    • Required rules: Whether submission is intercepted and whether pure whitespace strings are detected.
    • Boundary values: Whether minimum, maximum, and length limits match the document.
    • Cascading validation: Whether dependent fields are re-validated when a field changes.
    • Asynchronous validation: For example, username duplication checks—whether debouncing and loading states are implemented.
    • Error prompts: Whether error messages point to specific fields and whether the wording aligns with requirements.

    5. Code Style: Good for Scaffolding, User-facing UIs Still Need Design
    The generated code leans toward pragmatism. The UI is slightly better than a standard prototype but falls behind mature enterprise component libraries in terms of visual consistency and detailed layout. For internal backends, this level is usually sufficient for scaffolding the basic structure. For end-user-facing products, designers and frontend engineers still need to be deeply involved.

    6. Horizontal Comparison: Lack of Verifiable Data
    The original article compared an emerging model with an industry-standard closed-source model, concluding that: the login page completion was similar; the benchmark model performed better on complex logic in list and form pages; and the benchmark model took several minutes. However, the original text did not provide comparison tables, test conditions, task complexity, timing methodologies, or failure items. Therefore, the following points remain unverified observations:

    • Login page: Both types of models showed similar completion rates, requiring further confirmation.
    • List and form pages: The benchmark model might perform better, but testing needs to be repeated under identical requirements and scoring criteria.
    • Time consumption: There needs to be a distinction between model inference time, queuing time, network time, and manual modification time.

    It is recommended to test using the same requirement document and record each model’s version, API parameters, completion score, and modification time to create a comparable table.

    7. Enterprise Adoption: Risks and Acceptance Checklist
    The key to integrating LLM coding tools into an enterprise lies in incorporating the generated results into existing R&D pipelines. Regardless of the model used, the following five tasks should be performed:

    1. Security scanning: Perform static analysis on generated code to check for injection vulnerabilities, cross-site scripting (XSS), and sensitive information leaks.
    2. Dependency audit: Review third-party packages introduced by the generated code, confirming versions, licenses, and known vulnerabilities.
    3. Data masking: Remove real user information, API keys, and internal addresses from prompts and test data.
    4. Permission isolation: Use least privilege for model API calls and code execution environments; do not allow direct access to production databases.
    5. Human review: Pages involving transactions, payments, or privacy data must undergo manual code review.

    Scenarios involving core transactions, personal privacy, or financial security should not rely directly on generated code for production deployment.
    Enterprises can use existing cloud platforms or private deployment solutions to host model services, and integrate internal component library standards and business rules through fine-tuning or prompt templates. The decision to fine-tune or select a platform should be based on data compliance requirements, budget, and team capabilities.

    8. Conclusion: Unverified Questions Outweigh Established Conclusions
    This test indicates that LLMs can provide a practical starting point for standardizing pages, but complex interactions and form details still require substantial human review. The sample size, model versions, and scoring criteria of the original test are incomplete, limiting the applicability of the conclusions. Future steps should include adding reproducible test setups and answering questions such as: How much variance exists between different models for the same requirement? Does the defect rate drop after one round of modifications to the generated code? Can efficiency improvements be sustained with long-term team usage?