Large-Model Code Generation in Practice: From Page Generation to Bug Fixing

    This evaluation examines how well a large language model handles a realistic front-end development workflow, including understanding project files, generating a multi-page website, validating runtime behavior, diagnosing rendering issues, and performing regression fixes. The results show that generating code is only one part of software delivery: reliable execution requires a complete cycle of generation, testing, debugging, and verification.

    As large language models become part of software development workflows, code generation is no longer judged only by whether a model can write code. In real projects, developers also need to know whether the model can understand complex requirements, read project files correctly, generate runnable pages, diagnose failures, fix problems, and complete the work efficiently.

    A recently released large-parameter model designed for coding tasks attracted considerable attention. Public information indicates that models of this type often use a mixture-of-experts architecture, offer a large total parameter count, and support a large context window. In theory, these capabilities make them suitable for long documents, multi-file projects, and complex front-end development tasks.

    However, parameter count and context length do not directly translate into a reliable development experience. To evaluate the model more objectively, this test used a task that resembles a real development scenario.

    1. Test Task: Generate a Website from a Content Script

    The objective was straightforward: the project directory contained an image-and-text script file and an image. The model was asked to use these resources to create a complete multi-page HTML presentation website.

    Although the task appears simple, it includes several technical steps:

    1. Read and understand structured text.
    2. Identify the number of pages and the relationships between them.
    3. Extract titles, body text, images, and other content.
    4. Design the page layout and visual hierarchy.
    5. Write HTML, CSS, and any necessary interaction logic.
    6. Ensure that all pages can be accessed correctly.
    7. Check for blank pages, misalignment, overflow, and overlapping elements.
    8. Continue fixing issues based on screenshots or written feedback.

    This makes the task more representative of a model’s overall development ability than simply asking it to generate a static page.

    During the test, the model received the same project files, task description, and supporting guidelines. This helped minimize the influence of external variables. The evaluation focused less on whether the pages looked attractive and more on whether the model could complete the full workflow from requirement understanding to a runnable deliverable.

    2. Initial Requirement Understanding Was Generally Correct

    After starting the task, the model scanned the project directory and read the script file and image resource. Its behavior showed that it understood this was not a simple question-answering task. It needed to process local files and produce multiple web pages.

    Several aspects of this stage were positive:

    • It found the relevant resources in the project directory.
    • It understood that the script file was the source of the page content.
    • It recognized that the image needed to be used on the website.
    • It began organizing the code according to the available guidelines.
    • It established a basic page structure and file relationship.

    For a coding agent, this first step is important. Many development tasks fail not because the model cannot write code, but because it misunderstands the working directory, input files, or final delivery requirements. If resources are missed at the beginning, even well-written code may not satisfy the task.

    However, starting correctly does not guarantee a reliable result. The real test is whether the model can validate the generated code and repair problems after execution.

    3. First Generation: Completed Code Does Not Mean a Usable Website

    After working for an extended period, the model reported that the website had been generated. When the pages were opened for inspection, the result was not ideal. The first page displayed correctly, but later pages showed a blank screen or missing content.

    These problems can come from several sources:

    • Page files were not generated correctly.
    • Links between pages used incorrect paths.
    • The JavaScript initialization process stopped unexpectedly.
    • Data indexes did not match the number of pages.
    • CSS or JavaScript resource paths were incorrect.
    • Container height, positioning, or display conditions were configured incorrectly.
    • A browser runtime error occurred, but the model did not check the console.

    From a user’s perspective, there is a clear difference between “generation completed” and “the project is usable.” Writing files only proves that the task reached a certain stage. It does not prove that the website passed runtime validation.

    Before reporting completion, an ideal coding agent should perform at least the following checks:

    1. 1. Confirm that all target files exist.
    2. 2. Start a local preview or static server.
    3. 3. Open every page and check for blank screens.
    4. 4. Check the browser console for errors.
    5. 5. Verify page navigation, image loading, and layout dimensions.
    6. 6. Fix abnormal pages and run regression tests again.

    Without these steps, a model can easily mistake “the code has been written” for “the requirements have been completed.”

    4. First Repair Attempt: Feedback Response Was Possible, but Validation Was Limited

    After receiving feedback about the blank pages, the model made further changes and later reported that the issue had been fixed. However, when the pages were opened again, several styling problems remained, including misaligned elements, incomplete content, and shifted component positions.

    This indicates that the model had some ability to respond to feedback, but its repair process may have relied more on code-based assumptions than on actual runtime diagnosis.

    Web rendering problems are different from ordinary text-based code errors. Syntactically valid code does not guarantee correct visual output. A page may have no obvious structural errors while still displaying incorrectly because of issues such as:

    • A fixed height clips content that extends beyond the container.
    • Absolute positioning depends on a particular screen size.
    • Flexbox shrinking rules are inappropriate.
    • The image and its container use incompatible aspect ratios.
    • Font size and line height cause text overflow.
    • Shared styles create selector conflicts across multiple pages.
    • Previous page state is not cleared after navigation.
    • Responsive behavior breaks at different browser window sizes.

    These issues cannot be diagnosed reliably by reading source code alone. They must be checked against the actual rendered result.

    5. Screenshot Feedback: Limited Ability to Perform Broad Fixes

    To improve the diagnosis process, the test provided screenshots of several problematic pages and clearly identified pages with more obvious alignment issues. The model attempted another round of changes, but the process took a long time. At one point, the task stalled, requiring an interruption, a restart, and another instruction to continue.

    The final result showed that some problems improved, but not all were resolved. The model mainly focused on the pages explicitly mentioned in the feedback and did not proactively inspect the remaining pages.

    This reveals a common limitation: the model tends to interpret feedback as “fix these specific local problems” rather than “run a regression check across the entire project.”

    In real development, modifying a shared style can affect every page. Therefore, any local change should trigger a full validation cycle instead of checking only the pages shown in the screenshots. A more reliable workflow would be:

    1. Identify the problem
    2. ↓
    3. Locate the shared component or page-specific code
    4. ↓
    5. Modify the implementation
    6. ↓
    7. Reopen every page
    8. ↓
    9. Check different content lengths and window sizes
    10. ↓
    11. Confirm that no new layout problems were introduced

    If the model focuses only on a single screenshot, it may hide the problem with temporary offsets or fixed widths without addressing the underlying cause.

    6. Longer Runtime Does Not Mean Higher-Quality Completion

    In this test, multiple repair rounds took more than an hour in total. The model repeatedly reported that the task was complete or that all issues had been fixed, while manual inspection still found obvious defects.

    This shows that code models should not be evaluated only by whether they eventually return a result. Other important metrics include the following.

    1. First-Attempt Success Rate

    Whether the website runs correctly after the initial generation is an important measure of basic reliability.

    2. Problem Detection Ability

    Can the model proactively identify blank screens, console errors, failed image loads, and layout overflow instead of waiting for the user to report each issue?

    3. Repair Accuracy

    Does the original problem actually disappear after modification, and are new problems introduced?

    4. Regression Test Coverage

    Does the model check all pages, or only the portions mentioned by the user?

    5. Task Duration

    If a simple static website requires a long series of repeated repairs, its practical value is reduced even if it eventually becomes runnable.

    6. Result Explainability

    Can the model explain which files it changed, what caused the problem, and how it verified that the fix worked?

    These metrics suggest that a coding model’s intelligence cannot be measured solely by parameter count or individual benchmark results. It must be evaluated across the complete task workflow.

    7. A Second Test with a Specialized Role

    To determine whether the problems were caused by insufficient task guidance, a new project was created with a specialized role focused on front-end development. The goal was to improve generation quality through clearer engineering guidelines.

    This time, the model still took a relatively long time to generate the pages. Navigation between pages worked, but opening the pages resulted in a black screen. Unlike a white screen, a black screen often indicates that the page structure or resources exist but that a more serious runtime or rendering problem has occurred. Possible causes include:

    • The background and text use the same color.
    • The root container has zero height.
    • A critical script throws an exception.
    • Page content is hidden.
    • The stylesheet fails to load.
    • The initialization function is never executed.
    • Resource paths do not work in the current execution environment.

    After the issue was clearly reported, the model located and fixed it relatively quickly. This suggests that more specific role constraints and error descriptions can help narrow the diagnostic scope.

    However, this does not prove that a specialized role can solve the problem completely. Its value is primarily in helping to:

    • Define clearer task boundaries.
    • Reinforce front-end engineering practices.
    • Remind the model to focus on browser runtime results.
    • Encourage a more appropriate debugging sequence.

    Without actual previews, console checks, and automated validation, simply adding a role description has limited impact.

    8. How to Improve Code Generation Tasks

    Improving the success rate of AI-generated websites requires changes in three areas: prompts, project constraints, and validation workflows.

    1. Define Delivery Requirements Clearly

    Instead of simply asking for “a website,” specify:

    • The number of pages.
    • The file organization.
    • The entry file name.
    • The page navigation rules.
    • How images should be used.
    • Whether responsive layouts are required.
    • Whether inline resources are prohibited.
    • Which checks must be completed before delivery.

    2. Require a Staged Workflow

    The task can be divided into the following stages:

    1. Analyze the input files.
    2. Provide a page plan.
    3. Create the basic structure.
    4. Write styles and interaction logic.
    5. Start a preview.
    6. Validate each page.
    7. Fix detected problems.
    8. Run final regression tests.

    A staged workflow is easier to control than asking the model to complete the entire project in one step.

    3. Require a Validation Report

    At the end of the task, ask the model to report:

    1. - Which files were generated.
    2. - How many pages were checked.
    3. - Whether any console errors were found.
    4. - Whether image loading was verified.
    5. - Whether page navigation was tested.
    6. - Whether different window sizes were checked.
    7. - What known issues remain.

    This reduces the chance that the model will declare completion without performing validation.

    4. Prefer Stable Layout Techniques

    For automatically generated pages, use flow-based layouts, flexbox, and grid layouts whenever possible, and use extensive absolute positioning with caution. Fixed coordinates may be convenient for quickly producing a visual mockup, but they are highly sensitive to text length, window size, and content changes.

    5. Add Automated Checks

    When possible, add simple scripts to check:

    1. - Whether all HTML files exist.
    2. - Whether referenced CSS, JavaScript, and image paths are valid.
    3. - Whether page titles are present.
    4. - Whether key containers exist.
    5. - Screenshots of each page captured with a headless browser.
    6. - Manual or program-assisted comparison of the screenshots.

    These mechanisms can turn visual problems into engineering issues that are easier to track.

    9. Conclusion: Evaluate Whether the Model Can Complete the Full Loop

    This test leads to a relatively clear conclusion: large language models are already capable of understanding task intent, scanning project files, and generating initial code. However, they still require human involvement when delivering complex front-end pages reliably, maintaining visual consistency, and completing multi-round debugging.

    Three points are particularly important:

    First, a model’s completion report does not mean that the project is actually usable.

    Second, successfully fixing a local issue does not mean that the entire project has passed regression testing.

    Third, a long task duration does not prove that the problem has been fully resolved.

    For developers, the most practical approach is not to treat the model as a completely autonomous engineer, but as a collaborative tool with strong code-generation capabilities. Developers should define acceptance criteria, provide reproducible feedback, inspect critical results, and require the model to follow a complete cycle of generation, execution, validation, repair, and regression testing.

    Only when code generation is combined with testing and verification can a model move beyond merely “writing code” and begin delivering usable software.