Evaluating and Building Interactive Applications Generated by Large Language Models
Large language models are increasingly capable of generating interactive front-end applications rather than static page code. This article presents a practical framework for evaluating such applications, covering visual fidelity, interaction design, game logic, physical simulation, readability, usability, maintainability, and automated testing. Examples involving sliding puzzles and 3D bowling games show why a visually impressive prototype is not necessarily a correct or production-ready application.
1. From “Generating Pages” to Delivering Usable Applications
As large language models improve at code generation, users expect more than a static page. They want a front-end application that can respond to natural-language requirements while providing visual quality, interaction logic, and basic runtime capability.
For example, when asked to “create an ink-wash-style sliding puzzle” or “build a bowling game in which a ball can knock down pins,” a model may need to address several types of problems at the same time:
- Interface structure: How should the page be divided? How should buttons, instructions, the canvas, and status panels be organized?
- Visual styling: Do the colors, materials, lighting, background, animations, and overall theme match the description?
- Interaction flow: How do users start, drag, reset, and view results? How should invalid actions be handled?
- Core rules: Is the puzzle solvable? Are collisions reasonable? Is scoring correct? Are win and loss conditions reliable?
- Engineering maintainability: Is the state easy to understand? Can the logic be separated? Is the application easy to modify and extend?
Therefore, the quality of a generated application cannot be judged only by whether it includes particle effects, gradient backgrounds, or dynamic lighting. Visual design is only one part of delivery quality. Functional completeness, rule correctness, and consistency of user experience are what ultimately determine whether the application is usable.
2. Evaluating Visual Generation: Accuracy Matters More Than Flashiness
Many automatically generated front-end pages prioritize visual impact. Dark backgrounds, floating particles, glowing borders, gradient shadows, and frosted-glass effects are common because they are relatively easy to implement and can create an immediate sense of technical sophistication.
However, visual quality should be evaluated by how well the design matches the target—not by the number of effects used.
2.1 Does the Described Style Actually Appear?
Suppose the requirement explicitly calls for a traditional ink-wash style. The generated result should include visual characteristics such as:
- Blank space, grayscale, and low-saturation black-and-white colors;
- Fewer sharp rectangular borders;
- Background textures that suggest rice paper, ink diffusion, or brush strokes;
- Restrained animation without frequent flashing or intense neon lighting;
- Typography with sufficient breathing room rather than dense cyberpunk-style components.
If the model claims to use “ink-wash rendering,” “paper texture,” or “ink diffusion,” but the final page still consists of generic dark cards, blue-purple gradients, and particle effects, there is a disconnect between requirement interpretation and code output.
This does not necessarily mean that the model fails to understand the concept. More often, the model falls back to common page templates during generation instead of converting style requirements into executable styling constraints.
2.2 Use a Visual Acceptance Checklist
Developers can evaluate generated results with a checklist like the following:
| Evaluation Area | Key Question |
|---|---|
| Theme consistency | Does the page match the visual direction described in natural language? |
| Color control | Are there high-saturation or high-brightness elements that conflict with the theme? |
| Layout hierarchy | Is the primary operation area clear, or is information too densely packed? |
| Readability | Are text, buttons, and icons easy to recognize against different backgrounds? |
| Animation restraint | Does animation support feedback rather than interfere with operation? |
| Cross-device support | Can the page still be operated and read on smaller screens? |
For internal prototypes, visual acceptance does not need to reach pixel-perfect design quality at the beginning. However, obvious mismatches—such as a classic theme being rendered as a generic technology interface—should be avoided.
3. Sliding Puzzle Example: Correct Layout Does Not Mean Correct Gameplay
A sliding puzzle may look like a simple grid-movement problem, but it depends on explicit state constraints. A page can display neatly arranged tiles without implementing reliable game logic.
3.1 Minimum Requirements for a Usable Sliding Puzzle
A basic sliding puzzle should provide:
- A fixed grid size, such as 3×3 or 4×4;
- One empty cell for movement;
- Movement limited to tiles directly adjacent to the empty cell;
- An initial state that is guaranteed to be solvable;
- Updates to tile positions, move count, and completion state after every move;
- A success message when all tiles return to the target order;
- A reset operation that generates another valid state rather than simply shuffling tiles at random.
The requirement that the initial state be solvable is one of the most commonly overlooked rules. If the tile array is shuffled without constraints, the result may be mathematically impossible to solve, meaning the user cannot complete the game regardless of their actions.
3.2 Basic Solvability Checking
For grids with an odd side length, inversion counts can be used to determine whether a state is solvable. An inversion is a pair of numbers in which a larger number appears before a smaller number in the tile sequence.
An example implementation is shown below:
function getInversionCount(values) {const list = values.filter(item => item !== 0);let count = 0;for (let i = 0; i < list.length; i++) {for (let j = i + 1; j < list.length; j++) {if (list[i] > list[j]) {count++;}}}return count;}function isSolvable(values, gridSize) {const inversions = getInversionCount(values);if (gridSize % 2 === 1) {return inversions % 2 === 0;}// For even-sized grids, the row containing the empty cell// must also be considered. Complete the full rule in production.return true;}
This logic illustrates why a model generating a mini-game must do more than create a clickable interaction shell. It must also understand the feasibility constraints behind the problem.
3.3 Common Sliding Puzzle Defects
During acceptance testing, pay particular attention to the following:
- Whether clicking a non-adjacent tile incorrectly allows it to move;
- Whether rapid repeated clicks corrupt the state;
- Whether another move can be triggered before the movement animation finishes;
- Whether interaction remains enabled after the puzzle is completed;
- Whether the move count is accurate;
- Whether reset truly restores a new initial state;
- Whether image slices, tile numbers, and target positions remain consistent.
These issues determine whether the result is merely a visual demonstration or a deliverable feature.
4. 3D Bowling Example: Physical Appearance Does Not Equal Realistic Physics
Three-dimensional interactive scenes often create strong visual impact in code generated by large language models, but they also expose common-sense and implementation errors. A bowling scene with a lane, pins, lighting, and rolling animation may appear complete. Yet if the pins are arranged incorrectly or collision behavior is unrealistic, users will quickly notice that the scene does not behave like bowling.
4.1 Pin Placement Should Follow Basic Conventions
Standard bowling pins are arranged in a triangular formation. If the gaps between pins are too large, a ball rolling through the center may fail to create a chain reaction, making an apparent “strike” visually and logically unconvincing.
Instead of placing every pin manually, generated code should create positions from row and column rules:
function createPinPositions(rowGap, columnGap) {const positions = [];let index = 0;for (let row = 0; row < 4; row++) {const count = row + 1;const offset = ((count - 1) * columnGap) / 2;for (let col = 0; col < count; col++) {positions.push({id: index++,x: col * columnGap - offset,z: row * rowGap});}}return positions;}
This approach provides a stable layout and makes it easier to adjust spacing, scale the scene, or introduce different difficulty levels through parameters.
4.2 Physical Behaviors to Validate
Even without a complex physics engine, a lightweight bowling demonstration should address at least the following:
- Whether the ball’s direction is determined by user input;
- Whether the ball passes through the pins;
- Whether a pin’s fall is related to the direction of impact;
- Whether fallen pins remain down instead of standing up again;
- Whether calculations stop after the ball leaves the lane;
- Whether a round can be reset correctly;
- Whether the score matches the number of pins knocked down.
If the application simply triggers an animation in which every pin falls when the ball approaches, it can be described as a demonstrative interaction. It should not be mistaken for realistic collision handling. Prototype documentation should clearly identify the implementation level: visual simulation, rule-based simulation, or rigid-body physics simulation.
5. A Dark Interface Is Not Automatically a Premium Experience
Automatically generated pages often favor dark themes. Without sufficient contrast, however, they can become difficult to use. This is especially common when a 3D canvas, dark background, and dark-gray controls are layered together, making buttons, status information, and boundaries hard to recognize.
5.1 Readability Is a Basic Interaction Requirement
An interface should ensure that:
- Primary text has sufficient contrast with the background;
- Primary and secondary buttons have a clear hierarchy;
- Disabled, hover, and selected states are distinguishable;
- The canvas and control areas are visually separated;
- Results, error messages, and help information remain visible;
- Touch targets are large enough on mobile devices to prevent accidental input.
A consistent set of design variables can help establish these relationships:
:root {--bg-color: #151515;--panel-color: #222222;--text-main: #f2f2f2;--text-muted: #b8b8b8;--accent-color: #d99a35;--border-color: #454545;}.button-primary {color: var(--bg-color);background: var(--accent-color);border: 1px solid var(--accent-color);}.button-secondary {color: var(--text-main);background: transparent;border: 1px solid var(--border-color);}
The key issue is not the specific color palette. It is whether the color system communicates meaning consistently: users should be able to distinguish primary actions, supporting information, and risk states at a glance.
6. A Layered Evaluation Framework for LLM-Generated Applications
To avoid evaluating generated results based only on subjective impressions, teams can divide acceptance into five levels.
Level 1: Runtime Capability
Check whether the page loads, whether there are obvious script errors, whether key buttons work, and whether interaction causes crashes.
Level 2: Requirement Coverage
Compare the implementation with the requirements item by item. Confirm that the theme, functionality, status display, reset mechanism, and result feedback are all present.
Level 3: Rule Correctness
For puzzles, board games, scoring systems, sorting tasks, collisions, and similar scenarios, verify that the core algorithms follow the intended rules rather than merely checking whether an interface exists.
Level 4: Experience Consistency
Check whether the visual theme, interaction feedback, copy, and animation rhythm are consistent. Avoid fragmented experiences in which different parts of the page follow unrelated styles.
Level 5: Code Quality
Review whether state management is clear, whether duplicate logic is excessive, whether styles are maintainable, and whether the code contains hard-coded coordinates, scattered event handlers, or constants that are difficult to modify.
For enterprise development, automated tests can also be added to the workflow. For example, core interactions can have basic assertions:
function assert(condition, message) {if (!condition) {throw new Error(message);}}function testPuzzleMove() {const state = [1, 2, 3, 4, 5, 6, 7, 0, 8];const nextState = moveTile(state, 8);assert(nextState[7] === 8, "The tile should move into the empty position");assert(nextState[8] === 0, "The original tile position should become empty");}
A large language model can help generate the skeletons for these tests, but the product or engineering team must still define what “correct” means.
7. Conclusion: Treat Model Output as a Starting Point, Not the Final Acceptance Result
Large language models can significantly accelerate the creation of interactive pages, animation prototypes, and lightweight games. They are especially useful for exploring requirements, drafting interfaces, assembling components, arranging basic interactions, and suggesting code structures.
However, for projects with visual style requirements, game rules, physical behavior, and user experience constraints, final quality still depends on rigorous acceptance criteria. Developers should not assume that an application is complete simply because it looks impressive, nor overlook rule defects merely because one feature appears to work.
A more reliable process is to use a large language model to quickly establish an interactive prototype, then have developers iterate on visual fidelity, rule correctness, state management, accessibility, and performance. Automated generation creates real engineering value only when “can generate” becomes “can be used correctly, maintained reliably, and operated as expected.”
