Frontend Testing for Chinese LLMs: A Three-Tier Framework to Evaluate Code Quality and Design Skills
In recent years, large language models have made rapid progress in code generation, but a significant gap remains between "generating code" and "delivering a usable product." This article presents a three-tier testing framework for evaluating the frontend capabilities of Chinese LLMs—covering basic component generation, complex interaction logic, and full-page visual design—along with a practical prompt framework and a human review checklist you can apply in real development workflows.
In recent years, large language models have rapidly improved at code generation, yet a clear gap remains between “generating code” and “delivering a usable product.” In frontend development especially, a model must understand business requirements while also handling component structure, state management, responsive layout, visual hierarchy, motion design, and error feedback.
In the past, many models could quickly output a page skeleton but often produced messy structures, broken interactions, homogeneous styling, and poor mobile adaptation. Worse, when the page threw runtime errors, the model was not always able to pinpoint the cause, leaving developers to spend significant time on manual debugging.
For this reason, evaluating a model’s frontend ability should not rely on a single generation result, nor on code length or page screenshots alone. A more reasonable approach is a tiered testing framework: start with isolated components, then progressively add logic complexity, visual requirements, and engineering constraints, and observe whether the model can sustain understanding, proactively verify its output, and iteratively fix issues.
This article breaks testing into three tiers and concludes with a high-level prompt framework suitable for real-world development.
1. Define the Testing Goals First: Code Generation Is Not Product Delivery
Before testing begins, “capability” should be broken down into observable indicators.
1. Code Correctness
Generated code must run first—no obvious syntax errors, undefined variables, missing component references, or broken state updates.
2. Requirement Comprehension
A single requirement often contains both explicit asks and implicit goals. For example, “build a data dashboard” implies not just a few cards, but also data hierarchy, key metrics, empty states, loading states, and responsive layout.
3. Visual Design Ability
Page quality is not determined by functionality alone. Color contrast, spacing systems, typographic hierarchy, card structure, button states, and information density all directly shape how professional a product feels to users.
4. Interaction Loop Completeness
Does a button show a loading state? Does a failed submission produce feedback? Does data restore correctly after a modal closes? Are touch targets large enough on mobile? These details determine whether a page is genuinely “usable.”
5. Self-Verification and Fixing Ability
Ideally, the model should not just output code. It should inspect its own results, analyze error causes, adjust its implementation, and explain the differences before and after a fix.
2. Tier 1: Basic Component Generation
The goal of the first tier is not to test complex business logic, but to determine whether the model can reliably produce common UI elements.
Choose a component with clear visual requirements as the task, for example:
Create a login card component containing an email input, a password input, a show-password toggle, a submit button, and error messages. Use a clean dark visual theme with soft shadows and rounded corners on the card. Inputs need visible focus states, the submit button should show a loading state on submit, validation failures should produce clear messages, and the layout must work on narrow screens.
The task looks simple but contains multiple checkpoints.
1. Does the Model Decompose Structure Sensibly?
A good implementation organizes the form, input fields, error messages, and action buttons into clear layers rather than piling all logic into one giant component.
If the model produces hard-to-maintain code directly, the page may render, but this signals “one-shot output” thinking rather than an engineering mindset.
2. Does It Cover the Full Set of States?
At minimum, input components should handle the following states:
- Default state
- Focus state
- Input error state
- Disabled state
- Submit loading state
- Submit success or failure state
Many outputs implement only the default style and ignore state transitions. In a real product, such a page feels unresponsive—or worse, makes users think the system is broken.
3. Does It Include Basic Accessibility?
Inputs need clearly associated labels, buttons need explicit text, and error messages must not rely on color alone. For keyboard users and users with different visual abilities, sensible focus styles and semantic structure matter just as much.
4. How to Verify Tier 1 Results
Check four things:
- Does the page render correctly?
- Do typed inputs update state correctly?
- Do error states clear as the user corrects input?
- Do narrow screens produce horizontal scrolling or clipped content?
The point of this tier is not complexity but completeness: can the model do a simple task thoroughly? If basic components already show many omissions, asking the model to generate a full application will usually amplify the problems.
3. Tier 2: Complex Logic and Closed Interaction Loops
The second tier introduces state changes common in real business scenarios. Design a task management board, an order filtering page, or a data list page, and require the model to handle filtering, pagination, modals, delete confirmation, and empty states simultaneously.
Example task:
Create a responsive task management page containing a task list, keyword search, status filters, a create-task modal, task editing, and a delete confirmation flow. Use locally mocked data, and support loading states, empty states, form validation, success notifications, and a mobile layout.
At this stage, the focus is whether the model can handle “relationships between states.”
1. Is State Management Clear?
A list page typically needs to track at least:
- Raw data
- Current search keyword
- Current filter conditions
- Current page number
- Modal open/close state
- Current item being edited
- Form data
- Form errors
- Loading state
- Notification messages
Without clear boundaries between these states, later modifications become very difficult. For example, closing the edit modal without resetting the form, or changing filters while the page number stays on the last page, both create poor experiences.
2. Are Operation Chains Complete?
A delete action should never execute immediately. A sensible interaction chain looks like this:
- The user clicks delete.
- The page shows a confirmation message.
- After confirmation, the operation enters a processing state.
- On success, the list updates and a notification appears.
- On failure, the original data is preserved and the error reason is shown.
Flows like this reveal whether the model truly understands user behavior, or merely builds a button that “looks clickable.”
3. Can It Handle Edge Cases?
Real-world problems tend to surface at the edges:
- Search returns no results
- The list has no data at all
- The user deletes the last record on the current page
- The form is submitted repeatedly
- Input exceeds the length limit
- The modal is closed immediately after opening
- Width changes cause the table to overflow
A model focused only on the happy path will produce pages that look great in demos but are unstable in actual use.
4. How to Evaluate Tier 2
Use “follow-up probing” to keep testing. After the first generation, do not fix the code for the model—instead, append the following requirement:
Check whether the current implementation covers loading, empty, error, duplicate-submit, and mobile overflow scenarios, and list potential issues. Do not just describe the problems—provide the complete corrected implementation directly.
This step tests the model’s capacity for self-reflection. A strong result identifies risks first and then makes targeted fixes, rather than indiscriminately rewriting everything.
4. Tier 3: Full Pages and Visual Aesthetics
The third tier is closest to a real project: the model must complete a visually distinctive page—such as a product landing page, an analytics dashboard, or a content workspace—within a single pass.
Describe the task like this:
Design a modern data analytics workspace. The page includes top navigation, key metric cards, a trends section, a to-do list, and a quick-actions area. The overall style should be restrained, clear, and layered—avoid default template layouts. The background may use low-contrast gradients or soft lighting, but must not hurt text readability. Add moderate entrance animations, hover feedback, and responsive adaptation.
The key here is no longer “does it have components,” but whether the page forms a unified design language.
1. Is the Visual Hierarchy Clear?
A mature page establishes multiple levels of information:
- The page title sets the context
- Key metrics capture primary attention
- Supporting text explains the data
- Action buttons guide behavior
- Secondary information stays visually quiet
If every font size, color, and spacing value is roughly the same, users cannot quickly identify what matters.
2. Does Color Serve Information?
Color is not decoration. Primary colors emphasize main actions, warning colors signal risk, accent colors distinguish categories, and background colors separate regions.
Avoid flooding the page with large areas of saturated color, and avoid low contrast between light text and its background. For designs using gradients, glows, or transparency, readability always comes first.
3. Are Animations Restrained?
The value of motion is to explain change, provide feedback, and improve continuity—not to show off. Reasonable examples include:
- A fade-in on initial page load
- A slight translate when cards appear
- Color or shadow shifts on button hover
- Smooth transitions when lists update
- Scale or fade effects as modals open and close
Duration and frequency must be controlled. Too fast feels jarring; too slow hurts efficiency.
4. Does the Page Escape the Template Feel?
Model-generated pages tend to fall into a few fixed patterns: top navigation, three-column cards, uniform border radius, purple-blue gradients, and large swaths of whitespace. Without a real content structure and design rationale, even a “pretty” page can feel interchangeable with every other one.
A better prompting approach is not to vaguely demand a “premium look,” but to state explicit design constraints, for example:
- Use a limited color palette
- Adopt a consistent spacing scale
- Create clear hierarchy between primary and secondary content
- Avoid using the same card style in every section
- Let decorative elements serve the content rather than compete with it
5. How to Write High-Quality Prompts
A high-quality prompt is not about length but about how clearly the information is organized. Use the following structure.
1. Role and Goal
State what role the model should play and what problem it is ultimately solving. For example:
You are a developer skilled in frontend engineering and UI design. Build a responsive page suitable for real use—not a static mockup.
2. Technical Boundaries
Specify allowed implementation approaches, data sources, and file scope so the model does not introduce unnecessary dependencies on its own.
3. Feature Checklist
Break requirements into page structure, interaction behavior, data states, and exception cases. Avoid overly abstract phrasing.
4. Visual Constraints
Describe color preferences, layout density, corner radius, shadow strength, animation timing, and mobile adaptation requirements.
5. Verification Requirements
Ask the model to self-check before outputting:
- Any undefined variables
- Any dead event handlers
- Whether empty and error states are covered
- Whether it renders correctly at different widths
- Any obvious accessibility issues
6. Modification Mechanism
You can also ask the model to work in stages:
Step 1: present an implementation plan. Step 2: generate the code. Step 3: self-check against the requirements item by item. Step 4: fix only the problems found and explain each change.
This reduces the omissions that come with generating a large amount of code in one shot.
6. A Human Review Checklist for Model-Generated Code
No matter how well the model performs, critical code still needs human review.
Engineering Level
Check whether components have clear responsibilities, whether state is centralized, whether duplicated logic can be extracted, and whether naming is understandable.
Runtime Level
Check first load, repeated operations, error recovery, page refresh, and behavior across different screen sizes.
Visual Level
Check whether spacing is consistent, whether colors have sufficient contrast, whether text gets truncated, whether buttons are easy to identify, and whether decorations interfere with reading.
Security Level
Never hand real credentials, sensitive configuration, or user privacy data directly to a model. When external data is involved, use sanitized samples, and re-examine input validation, permission checks, and data display logic before merging the code.
7. Conclusion: From “Writing Code” to “Completing Tasks”
The value of Chinese LLMs in frontend development should no longer be measured by the quality of a single code generation. What matters is whether the model can understand complete requirements, handle multiple page states, stay consistent in visuals and interactions, fix issues based on runtime results, and keep collaborating within engineering constraints.
The three-tier framework offers a practical evaluation path:
- Tier 1: Are basic components complete and reliable?
- Tier 2: Does complex logic form closed loops?
- Tier 3: Does the full page balance function, aesthetics, and experience?
For developers, the most effective approach is not to treat the model as an automatic generator, but to integrate it into the full workflow of requirement analysis, coding, testing, review, and iteration. With clear prompts, explicit boundaries, and continuous verification, the model can evolve from “quickly producing code” into an engineering partner that “helps deliver real products.”
