Evaluating AI-Generated Complex Interactive Web Applications
A reliable evaluation of complex interactive web applications requires more than visual inspection. This article presents a repeatable framework for testing requirement abstraction, state modeling, real-time progression, interaction behavior, visual consistency, maintainability, prompt design, iterative refinement, and implementation details such as hex-grid coordinates, target selection, speed control, and automated research. It also explains how to distinguish genuine model capability from generation failures caused by truncation, congestion, or conflicting prompts.
Complex interactive web applications are not completed by simply adding more CSS. They test a model’s ability to abstract requirements, model state, advance time, provide interface feedback, and handle edge cases. Using these tasks as probes of model capability is reasonable, but the probe must be reproducible. The same requirements, acceptance procedures, and failure criteria are needed to distinguish a stable, deliverable implementation from a visually impressive one-off demo.
What Makes a Good Evaluation Task?
A useful comprehensive probe typically combines several types of constraints.
First, the task should require conceptual abstraction. For example, changing turn-based progression into real-time progression requires the model to understand that both sides share a continuous clock, that progress does not depend on a manual end-turn action, and that user operations and settlement can occur concurrently. If the prompt directly provides timer code, this capability is no longer being tested.
Second, the task should introduce a clearly defined capability that does not exist in the original gameplay. One example is optional automated research: when resources and prerequisites are available, an assistant advances the research; when resources are insufficient, it waits without reporting an error. This tests whether the model can implement intent rather than merely restate known rules.
Third, the task should include spatial and control logic. Units that automatically search for opponents or objective points require proximity checks, occupancy detection, and simple path selection. The viewport can be panned with the arrow keys, speed can be adjusted with a slider over a defined range, and the map can use hexagons rather than squares. Each of these behaviors can be verified through concrete operations, avoiding purely subjective scoring.
Fourth, the presentation layer should be observable without overshadowing the underlying logic. Transparent panels, draggable windows, layer switching, and button states can test layout and interaction details, but they should not replace functional correctness. A visual style that resembles a classic desktop interface should be treated as an appearance criterion, not as a substitute for passing functional tests.
Four Acceptance Categories Instead of One Subjective Impression
A practical evaluation can use four separate checklists. Each item should be marked as passed, partially passed, or failed, with minimal reproduction steps recorded.
Logical Correctness
Does the real-time loop continue to advance? Do pause and speed controls change only the time scale without disrupting resource settlement? Does automated research respect both resource requirements and prerequisites? Do units move toward their current targets, and do they select new targets when the previous target disappears?
Use a fixed initial seed or fixed initial layout and observe the application continuously for several dozen seconds. This is more reliable than evaluating a single screenshot.
Interaction Completeness
Do the arrow keys move the viewport instead of scrolling the entire page? Is the speed slider clamped between 1× and 10×? Is window dragging constrained to the visible area? Do buttons provide disabled, hover, and pressed states?
Event loss under heavy load should also be recorded. Slow generation and runtime lag are different problems and should not be conflated.
Visual Consistency
Glass-like panels, rounded corners, shadows, and icon alignment belong to the visual evaluation. Text icons or generic symbols are acceptable, but the same category of object should use a stable visual mapping rather than changing randomly after each refresh.
When comparing prompt versions, fix the browser width and zoom level. Otherwise, apparent improvements may simply result from a layout accidentally fitting the viewport better.
Maintainability
Are the time system, map coordinates, unit state, and UI rendering separated? Is there an excessively long single file that is difficult to inspect? Can important state be printed or otherwise inspected?
An implementation that works but cannot be maintained will usually collapse when the requirements change in the next iteration.
Generation time should not be treated as direct evidence that model capability has declined. More concurrent users, a longer context, or truncated output can make the same prompt slower or produce a worse result. At minimum, an evaluation record should include:
- The prompt version
- Whether continuation was required
- Whether the output was complete
- The runtime environment
- Whether the failure occurred during generation or execution
Write Prompts as Contracts, Not Collections of Adjectives
Turning requirements into a testable contract is usually more effective than accumulating descriptive language. A contract can be divided into goals, hard constraints, acceptance steps, and prohibited behaviors.
The goal should take only one or two sentences. For example: build a real-time battle prototype on a hexagonal map with resources, units, objective points, and optional automated research.
Hard constraints should specify time, input, and object behavior:
- Time advances continuously.
- The speed range is 1× to 10×.
- The arrow keys pan the viewport.
- Cities, units, and resources use stable icons.
- Automated research is disabled by default and consumes resources only after it is enabled.
Acceptance steps should be written as an operation sequence. For example, set the speed to 5× and confirm that resource growth changes while the rules remain unchanged. Then enable the assistant and confirm that only projects meeting their requirements are completed.
Prohibited behaviors help prevent the implementation from drifting away from the task:
- Do not turn the system into a turn-based interface with an end-turn button.
- Do not use square cells as a substitute for hexagons.
- Do not build a static, screenshot-like page without functioning interaction.
A representative state structure can also be specified. It is not a platform-specific interface; it simply makes the generated result easier to inspect:
state = {tick, speed, paused,view: { q, r },cities: [{ id, q, r, stock }],units: [{ id, q, r, targetId }],research: { enabled, current, queue }}
Each frame should perform three operations: advance tick according to speed, settle resources and movement, and render the current state. Automated research should read stock and the prerequisite conditions rather than directly modifying unrelated unit coordinates. When something fails, this structure makes it easier to determine whether the problem lies in the time system, path selection, or UI binding.
Change One Variable at a Time
It is common for visual quality to decline after multiple rounds of prompting. One reason is that later prompts change the visuals, rules, and copy at the same time. To satisfy new adjectives, the model may rewrite the entire page and accidentally remove correct button hierarchy, transparency, or event bindings.
A safer approach is to preserve the complete previous output, submit only a description of the required difference, and explicitly state that all unmentioned behavior must remain unchanged. Fix one failed item per iteration: correct the hex-grid coordinates first, then fix automatic target selection, and only afterward adjust the glass panels or window switching.
When the visual requirements are demanding, generate the logical prototype and visual shell separately. Connect them through the same state fields. After the logic prototype passes acceptance, request a presentation-layer replacement without changing the meaning of those fields. This avoids rewriting the game loop merely to add a translucent effect.
Truncation and continuation also need to be handled deliberately. If output stops in the middle of a function, the continuation request should provide the last complete symbol and list the items that remain to be implemented. Repeating the entire requirements document often causes two competing state machines to coexist.
Implementation Details Worth Defining in Advance
Hex-Grid Coordinates
Define the coordinate system before implementing the map. With axial coordinates, q and r are integer axes, neighbor offsets are fixed to six directions, and distance is calculated using axial-coordinate distance.
If the model mixes offset coordinates with pixel coordinates, units may leave their cells or overlap. Convert axial coordinates to pixels only during rendering. Do not use screen coordinates directly for pathfinding.
Automatic Target Selection
A simple nearest-target strategy is sufficient for an evaluation prototype; a complete navigation mesh is not required. Each unit can select a target every few ticks, move through a neighboring cell that reduces distance, and attempt a lateral step when the preferred cell is occupied.
This is enough to verify that target acquisition exists without introducing an overly complex search system. For acceptance testing, place one target nearby and another farther away. The nearby target should be selected first. After it is removed, the unit should switch to the farther target within a limited number of ticks.
Speed Control
Speed should not be implemented simply by dividing every setInterval delay by the selected multiplier. A clearer design uses a fixed frame interval and an accumulator that advances logical ticks by multiplying the elapsed progression by speed.
When paused, treat speed as zero while keeping the interface interactive. Changing the slider should update state rather than restart the animation clock; otherwise, switching speeds can drop ticks or cause duplicate settlement.
Automated Research
Automated research needs failure paths. When resources are insufficient, the current project should remain active and the interface should display a visible reason. When the queue is empty, the assistant should remain idle. Enabling the assistant repeatedly should not reset progress.
It is not enough to observe that the system “clicked research by itself.” The constraints must also be demonstrably enforced.
Draggable Windows and Layer Switching
A draggable window should record the pointer offset, update its position while the pointer moves, and end the drag when the pointer is released or leaves the interaction area.
Layer switching should change only the selected window’s stacking order and title-bar state. It should not destroy the canvas inside the window, or the map state may be lost. For translucent effects, a background color with adjusted opacity is sufficient; the implementation does not need to depend on a proprietary desktop theme. Buttons must retain a real clickable area rather than becoming decorative strips.
How to Interpret Comparison Results
Generation quality can vary across versions and entry points. Comparisons should use the number of passed items under the same prompt and acceptance script, along with the number of completions required before obtaining the first fully runnable result.
A better-looking result may simply have more complete glass panels and button styling. A more reliable result is reflected in whether speed control, automated research, and target selection pass on the first attempt. These dimensions should not be compressed into an ambiguous judgment that one version is simply “stronger.”
Slower generation should be recorded separately. It affects the trial experience, but it does not automatically indicate weaker logical capability.
If generated code is going into a real project, passing the evaluation is only the starting point. Additional work is still required for tests, resource limits, state recovery after disconnection or refresh, logging, and monitoring.
Cloud object storage can hold initial scenarios used for reproduction. A logging service can record the prompt version and runtime errors for each generation. Monitoring and alerts can detect cases where logical ticks stop advancing for an extended period. These are general engineering capabilities; they do not replace reading and reviewing the generated code itself.
The purpose of evaluation is not to declare that one generation has definitively caught up with or fallen behind another. It is to establish repeatable evidence: which constraints are consistently satisfied, which appear only under specific prompts, and which failures result from truncation, congestion, or conflicting instructions.
When the probe task is clearly defined, acceptance steps are fixed, and each iteration focuses on a single failure, a generated complex interactive web application becomes more than a demo. It becomes a foundation that can be inspected and developed further.
