Evaluating AI Coding Tools: Building a Complete Site From Scratch
Evaluating AI coding tools with toy examples like a single button or a login form produces misleading results. This article argues for assessing them on real projects—such as building a complete ten-page shopping site from scratch—where consistency, maintainability, and modification cost determine actual engineering value. It presents a five-dimensional framework covering first-run rate, page and flow completeness, visual consistency and adaptation, architecture and engineering quality, and the cost of subsequent modification, followed by a root-cause analysis of common failure modes such as hollow abstraction, context decay, and non-converging fix loops. It closes with reusable engineering practices and practical recommendations for individuals and teams, and clarifies that these tools accelerate implementation rather than replace architecture decisions.
1. Why Real Projects Beat Toy Examples in Evaluation
Evaluating AI coding tools with examples like “write a button” or “build a login form” almost always produces a misleading perfect score. The correctness boundary of such tasks is extremely narrow: a single file, a single page, no cross-page state, no routing, and no resource dependencies. As long as the model generates a component that renders, it is counted as a success.
The difficulty of real engineering never lies in “being able to write it,” but in “staying consistent” and “surviving modification.” Take building a shopping site from zero as an example. Once you require delivery of ten pages—homepage (product listing), product detail page, checkout page, payment success page, login page, registration page, user account overview, orders page, wallet and coupon page, and settings page—the nature of the task immediately shifts from “code generation” to “small-scale system design”:
- Pages must share navigation, footer, theme color, and card styles. Any independent improvisation causes visual fragmentation.
- Login and registration are the same form capability, and the four sub-modules of the user center share the same layout shell. Duplicate implementation means changing five places later when you change one.
- From checkout to payment success is a flow chain, requiring route parameters, state passing, and exception fallback.
- Where the data comes from, whether it can be replaced, and how load failures are displayed determine whether the site is a “one-time screenshot” or a “sustainably evolvable project.”
Therefore, the core of the evaluation is not “whether it can generate a decent-looking interface,” but “whether the generated result can continue to be maintained as a real engineering project.”
2. Designing Evaluation Benchmarks and Acceptance Criteria
To make horizontal comparisons meaningful, inputs and acceptance standards must be fixed; otherwise, conclusions degrade into personal impressions.
Unified task input should include three types of information: product form, page list with dependencies, and acceptance criteria. An example specification snippet is as follows:
# Task: Build a shopping site frontend from scratch## Page list (10)1. / Home: product listing, with category filtering, sorting, pagination2. /product/:id Detail: images and text, spec selection, stock status, add to cart3. /checkout Checkout: address, shipping method, coupon code, total summary4. /checkout/success Payment success: order summary, continue shopping entry5. /login Login; 6. /register Registration: share form validation rules7. /account Overview; 8. /account/orders; 9. /account/wallet; 10. /account/settings## Global constraints- Use unified design tokens (theme color, spacing, border radius, font size)- Component-based splitting, with view, style, and logic separated- Mock data uniformly placed in a separate data access layer, easy to replace with real APIs- Adapt to both desktop and mobile breakpoints; touch areas no smaller than 44x44- Must pass build and static checks on delivery, with no console errors
Acceptance criteria should be judgeable and reproducible, avoiding subjective descriptions like “beautiful interface.” The recommended five-dimensional framework is as follows.
3. Implementing the Five-Dimensional Evaluation Framework
3.1 First-Run Rate
This is the lowest threshold and, in practice, the most easily compromised item. Judgment items include: whether dependencies install successfully, whether the dev server starts, whether the production build passes, whether the first screen is blank, and whether there are unhandled exceptions in the browser console and terminal. Special attention is needed for the “looks like it runs but keeps throwing errors” state—a page that renders does not mean its state management, route guards, and data requests are defect-free.
3.2 Page and Flow Completeness
Judgment items: whether route coverage reaches 10/10; whether navigation forms a closed loop (after login, can it return to the original target page; after successful checkout, can it jump to the success page carrying the order summary); whether form validation is present (required fields, format, length, and whether error-message placement is reasonable); and whether empty states and error states are considered. A list page missing an empty state is effectively unusable in real business.
3.3 Visual Consistency and Adaptation
Typical defects include: theme colors hardcoded everywhere, so changing colors requires a full replacement; light-colored text on light backgrounds, making content invisible; and only a single breakpoint implemented, causing element overflow on mobile or layout chaos on login-type pages. The judgment method should be specific—whether contrast meets readability baselines, whether overflow scrolling exists, and whether touch-target sizes meet standards—rather than a general “the colors look nice.”
3.4 Architecture and Engineering Quality
Judgment items: whether directory layering is clear, whether styles are separated from logic, whether component reuse is reasonable (for example, whether the four user-center pages share a layout shell), whether data access is abstracted into an independent module, and whether the abstraction is “true to its name.” Here, the most important thing to watch for is hollow abstraction: custom-hook directories and global-state-container directories are created, and the files exist, but their internals are empty implementations or contain only comment placeholders—structural normalization actually increases the reader’s judgment cost.
3.5 Cost of Subsequent Modification
This dimension measures “engineering value.” The method is to add a medium-difficulty new requirement on the same baseline (for example, “add a coupon management page and integrate the wallet page’s balance display”), then observe the number of interaction rounds needed, whether the changes trigger regressions on existing pages, and whether the generating side can accurately identify the change scope. Rework rounds and manual repair hours are more convincing metrics than first-screen aesthetics.
4. Root Cause Analysis of Typical Failure Modes
Hollow abstraction and overly strong structural priors. The model tends to first lay out a “professional-looking” directory structure and then complete the implementation within a limited budget, resulting in a complete skeleton with empty content. The fix is to require module-by-module delivery and acceptance rather than full generation in one shot.
Context decay during long tasks. As the number of pages grows, early design constraints (theme color, route naming, component APIs) are easily ignored by later generations, manifesting as the same type of button looking inconsistent across pages. The response is to solidify constraints into design token files and component contract documents, and to explicitly reference them in each delivery round.
Inconsistent build environment and path handling. Dependency versions, script commands, path casing, and module resolution rules all cause “runs locally but not on delivery.” An extreme case is re-initializing within an already-initialized project directory, producing nested same-named directories and ultimately build failure. Clearly defining the “project root directory” and “reuse existing project configuration” is a necessary constraint.
Missing resources and content. Images using placeholders and product descriptions filled with meaningless text indicate that the generating side prioritizes “visual completeness” over “deliverable content.” This is caused by the prompt not specifying content requirements, and requires specifying real field structures and reasonable default content in the specification.
Data layer coupled with the view. Mock data hardcoded directly inside components seems convenient but actually turns connecting real APIs later into a large-scale rewrite. Requiring the data access layer to uniformly expose asynchronous interfaces, with the view layer depending only on that layer, can reduce the replacement cost to a constant level.
Non-converging fix loops. Repeated “please fix” still producing the same type of error usually stems from the absence of a verifiable signal. Requiring the generating side to attach test cases, run static checks and builds, and output a change list is an effective way to make the loop converge.
5. Reusable Engineering Practices
Specification first. Use structured product descriptions, a route table, a component list, and design tokens as inputs, making implicit conventions explicit.
Phased delivery. The recommended milestone order is: project skeleton and routing → design system and layout shell → page content and components → interaction and form validation → data access layer and state management → responsive layout and accessibility → self-testing and build verification. Confirm each milestone manually before moving to the next stage.
Constrain each round with a definition of done. Each delivery must declare the judgment items it satisfies, for example: build passes, no console errors, no placeholder content, and styles taken from design tokens.
Make the tool prove itself. Require output of test cases, run-check results, and a list of changed files with impact-scope descriptions, rather than just conclusions.
Example directory and layering convention:
src/tokens/ # Design tokens: colors, spacing, border radius, font sizelayout/ # Layout shell: navigation, footer, account-center shellapi/ # Data access layer: products / cart / orders / walletmocks/ # Dev-time adapter implementations, replaceable as a whole with real requestscomponents/ # Shared components: Button / Card / FormFieldpages/ # The ten pages__tests__/ # Key flow tests: login, checkout, payment success
Small-step commits and rollback capability. Commit each milestone independently, so the impact of any problems in the AI-generated results stays controllable and it is easy to pinpoint which round of changes introduced a regression.
Manual review checklist. It should at least cover: authentication and unauthorized access, consistency between client-side and server-side form validation, whether sensitive information is written into the code, dependency sources and licenses, accessibility and contrast, and error handling and fallbacks.
Compliance and security baseline. Use modes with code non-disclosure or privacy-protection capabilities to handle internal code; keys and credentials are injected uniformly via environment variables or a secret manager; run dependency vulnerability scanning and code audits on generated code to avoid pushing unreviewed implementations directly into production branches.
6. Implementation Recommendations for Individuals and Teams
Individual developers can maintain a small benchmark task set (multi-page sites, admin systems, data dashboards), horizontally compare different tools with unified prompts, and record three metrics—first-run rate, rework rounds, and rework hours—to form their own selection basis rather than relying on evaluation articles or marketing claims.
For team adoption, establish an internal evaluation set drawn from real but non-core requirements, with clear entry thresholds (for example, build success rate and review pass rate), and configure static checks, tests, and build verification on the pipeline as gates. The hosting and delivery of generated artifacts can follow existing general cloud capabilities, such as object storage, content delivery, logging services, monitoring and alerting, and container platforms. Cloud platforms such as Baidu AI Cloud provide standardized capabilities in these general areas, making it convenient to smoothly integrate “code generation” into existing engineering processes without building a separate system.
The expectation that needs correcting is this: AI coding tools accelerate “implementation,” not replace “architecture decisions.” They significantly compress the time from design to a runnable skeleton, but consistency, maintainability, and security still depend on specification quality, task-partitioning methods, and human review. Upgrading the evaluation from “does the interface look like a finished product” to “can it continue to evolve as an engineering project” is the prerequisite for these tools to deliver stable returns in real R&D processes.
