How to Test and Evaluate LLM Web App Generation
This article explains how to evaluate large language models on generating web applications, not just first-pass visuals. Using a glassmorphic desktop UI and a real-time strategy game prototype, it covers demand understanding, styling, interaction loops, multi-system logic, iteration, structured prompts, and a reusable review process.
As large language models enter software development, “generate a web app from one requirement” is no longer only a demo. It is a practical way to test understanding, engineering structure, and interaction implementation. What matters is not whether one generation “looks runnable,” but whether the model can reliably build UI, handle events, keep state in sync, enforce rules, and iterate under complex requirements.
This article uses two typical tasks: a desktop-style web UI with glassmorphism, window dragging, and 3D task switching; and an RTS prototype with auto-combat, research, pathfinding, speed control, and keyboard camera movement. Together they expose the real limits of LLM front-end code generation.
Why first-generation visuals are not enough
People often judge coding ability by first-round look and feel: color, layout, buttons. That mainly shows template skill, not delivery of a complex project.
A useful evaluation framework includes at least five dimensions:
Requirement understanding
Can the model catch implicit constraints? “Real-time strategy” is not units on a map; time must keep advancing, actions must not wait for turn confirmation, and resources and combat must update on a timeline.Visual expression
Can abstract style words become a stable style system? “Frosted glass,” “desktop stacking,” and “3D window switching” need opacity, blur, shadow, border highlights, perspective, and animation timing—not a rounded card.Closed-loop interaction
Buttons, drag, zoom, sliders, and shortcuts must change state, not sit as static chrome.Complex logic organization
Modules must stay in sync. After game speed changes, movement, production, research, and enemy behavior should all accelerate. After auto-targeting, units should re-decide when a target disappears.Iterative repair
When a developer reports wrong z-order, stuck units, or auto-research that cannot be turned off, can the model patch locally without breaking existing features?
Evaluation should shift from “can it generate a page” to “can it keep a small running system maintainable.”
Task one: what a desktop-style web UI demands
A desktop UI looks visual, but it is mostly state and events. A solid implementation typically needs:
- Multiple window create and display
- Title-bar drag
- Z-order switching
- Minimize, maximize, close
- Translucent glass styling
- Overview or 3D switch animation
- Position correction on resize
- Basic mouse and touch support
1. Drag is more than listening to mouse move
Generated pages often “support drag” with poor UX:
- Window jumps while dragging
- Drag drops when the pointer leaves the title bar
- Window leaves the viewport and cannot be recovered
- Overlapping windows do not raise correctly
- Maximized windows still drag
- Touch does not work
A more robust approach: on title-bar press, store pointer and window origin; on move, apply delta and update position; on release, clear drag state. Clamp position to bounds.
let activeWindowId = null;let startPointer = { x: 0, y: 0 };let startWindow = { x: 0, y: 0 };function beginDrag(windowId, pointerX, pointerY, currentX, currentY) {activeWindowId = windowId;startPointer = { x: pointerX, y: pointerY };startWindow = { x: currentX, y: currentY };bringToFront(windowId);}function updateDrag(pointerX, pointerY) {if (!activeWindowId) return;const deltaX = pointerX - startPointer.x;const deltaY = pointerY - startPointer.y;const nextX = clamp(startWindow.x + deltaX, 0, viewportWidth - 160);const nextY = clamp(startWindow.y + deltaY, 0, viewportHeight - 48);updateWindowPosition(activeWindowId, nextX, nextY);}function endDrag() {activeWindowId = null;}
The point is not length. The model must treat drag as start, update, and cleanup, plus z-order, bounds, and edge cases.
2. “Glass” should be executable style requirements
Vague style prompts fail. “Make it premium” or “glass look” often yields a pale card.
Better to break style into:
- Low-opacity light panel background
- Background blur
- Highlighted semi-transparent border
- Light shadow for floating layers
- Title bar vs body contrast
- Active window brighter or sharper edges
- Gradient, glow, or low-contrast texture instead of flat empty background
.desktop-window {background: rgba(255, 255, 255, 0.18);border: 1px solid rgba(255, 255, 255, 0.34);box-shadow: 0 16px 42px rgba(0, 0, 0, 0.24);backdrop-filter: blur(18px);border-radius: 12px;overflow: hidden;}.desktop-window.is-active {border-color: rgba(255, 255, 255, 0.62);box-shadow: 0 20px 56px rgba(0, 0, 0, 0.34);}
Visual quality depends on prompt granularity, context length, load, and output policy. One weak run does not prove lack of ability. Prefer a fixed test template and compare consistency and how fast later iterations converge.
3. 3D window switching is a composite test
It checks whether the model can:
- Render multiple window thumbnails from data
- Distinguish current, background, and hidden windows
- Apply perspective and scale
- Switch with keyboard or mouse
- Restore focus after animation
- Update stacking on task switch
This is often generated as a static collage: windows appear but cannot be selected, focused, or returned. Acceptance should follow a path:
- Open at least three windows
- Enter overview
- Select a non-front window
- Confirm it returns to the desktop on top
- Repeat and check for missing windows, broken z-order, or windows that cannot close
Task two: RTS prototypes test reasoning more deeply
Desktop UIs stress interaction and visual structure. An RTS prototype stresses rule modeling, state machines, and coordination.
The hard part is not drawing a map; it is turning natural-language requirements into runnable rules.
1. From turn-based to real-time
“Make the strategy game real-time” is high-level. Real-time is not a timer alone; all activity shares one clock.
Movement, resource gain, research, enemy spawn, and combat cooldown should advance on a unified time delta:
function gameLoop(timestamp) {const deltaTime = timestamp - lastTimestamp;lastTimestamp = timestamp;const scaledTime = deltaTime * gameSpeed;updateResources(scaledTime);updateResearch(scaledTime);updateUnits(scaledTime);updateEnemies(scaledTime);resolveCombat(scaledTime);renderGame();requestAnimationFrame(gameLoop);}
A strong implementation treats speed as a global time scale, not animation-only. Otherwise units move faster while research, income, and attack rates stay the same.
2. Auto-research tests intent expansion
Auto-research is not a standard RTS rule, so it tests whether the model can design a new system from user intent.
A complete system needs at least:
- Auto-mode toggle
- Researchable list
- Resource checks
- In-progress research state
- Apply effects on complete
- Idle handling when nothing is left
- Priority between manual and auto research
Recommended logic: when auto is on, if no research is running, pick from unlocked, unfinished techs that the player can afford, by a preset priority.
function tryAutoResearch(state) {if (!state.autoResearchEnabled) return;if (state.currentResearch) return;const candidate = state.techTree.find(item => {return !item.completed &&item.unlocked &&hasEnoughResource(state.resources, item.cost);});if (candidate) {startResearch(candidate.id);}}
Do not accept “the checkbox changed the UI.” Check low resources, completion, manual override, and restart edges.
3. Auto-targeting needs spatial queries and state changes
“All units auto-find enemies” sounds simple and raises:
- How nearest target is computed
- Units vs buildings priority
- Re-acquire after death
- Move when out of range
- Stop in attack range
- Whether all units pile on one target
- Sticking on map edges or obstacles
For a small prototype, nearest-by-distance is enough:
function findNearestTarget(unit, targets) {let nearest = null;let minDistance = Infinity;for (const target of targets) {if (target.destroyed) continue;const dx = target.x - unit.x;const dy = target.y - unit.y;const distance = Math.sqrt(dx * dx + dy * dy);if (distance < minDistance) {minDistance = distance;nearest = target;}}return nearest;}
On richer maps, Euclidean distance is not enough. Obstacles, blocked cells, or terrain cost need grid pathfinding, reachability, and local avoidance. A generated prototype need not implement a full algorithm, but it should split path, target, and attack state instead of letting units walk through the map.
Hex maps and camera control: what to accept
Hex maps often expose weak coordinate handling. Unlike square grids, they need:
- Axial/offset to screen conversion
- Odd/even row or column offset
- Neighbor lookup
- Click hit testing
- Map bounds
- Units centered on cells
- Coordinate conversion when the camera moves
Tiling hex art while still moving, selecting, and pathing on a square grid is incomplete.
Camera movement is more than keydown. A better implementation:
- Continuous move while a direction key is held
- Diagonal move with two keys
- Camera clamped to the map
- Do not steal keys when an input is focused
- Decide in advance whether camera speed follows game speed
- Offer touch alternatives on small screens
How to write complex prompts that succeed more often
Failures often come from unstructured input, not lack of capability. Use a four-layer prompt: goal, modules, rules, acceptance.
Layer 1: Goal
Do not say “make a nice strategy game.” State:
- App type
- How it runs
- Main user actions
- Visual style
- Single-file delivery or not
- Whether mock data is required
Layer 2: Modules
Split map, units, resources, research, combat, control panel, log, speed. Clear modules make data structures easier.
Layer 3: Rules
For example:
- The game runs continuously from start to end
- Speed multiplier affects all time-based behavior
- Idle units auto-search enemies
- Auto-research starts only when resources allow
- Completed research feeds unit stats or resource efficiency
- Cities, units, and resource sites use different icons
Layer 4: Acceptance
For example:
- After speed change, income and movement both change clearly
- Turning auto-research off stops automatic resource spend
- After a target dies, units pick a new one quickly
- Arrow keys pan the map without leaving it
- Every button produces an observable state change
This turns wishes into a task list and a debug contract.
A reusable model evaluation process
Teams and individuals should use a fixed process, not one impression.
1. Freeze the prompt and version
Keep the same task text across models. Change one variable at a time: extra visual requirements, extra auto logic, or a specific bug to fix.
2. Record first-pass success
First-pass success measures coverage of ordinary requirements. Track:
- Does the page run
- Obvious errors
- Are core modules present
- Do key interactions work
- Does visual structure match the brief
3. Measure iteration cost
Real work cares about edit efficiency. Count:
- Rounds to fix one issue
- Whether each fix introduces new bugs
- Whether the model remembers constraints
- Whether it finds the relevant code
- Whether it rewrites the whole project without need
4. Separate demo-ready from engineering-ready
Demo-ready shows the idea. Engineering-ready needs clearer structure, explicit state bounds, testable features, and maintainability. The gap is usually large.
In prototype work, models can speed UI scaffolding and basic logic. Before production, developers still need review, security, performance, error handling, and cross-device testing.
Conclusion: treat the model as an accelerator, not the acceptance bar
Complex web UIs and interactive prototypes are effective tests of LLM coding. Desktop UIs test visuals, events, and state. RTS games test abstract requirements, rules, time systems, and automation. Together they avoid ranking models on static pages alone.
The practical method is not one-shot completeness. Use structured prompts, modular acceptance, and small iterations: lock core logic, then visuals, then edges and performance. That keeps the speed of AI-assisted prototyping while leaving architecture, quality, and delivery under developer control.
