How to Evaluate AI Coding Tools: Code Generation Quality and Selection Practices
Choosing between AI coding assistants reliably requires a reproducible benchmark task, not single-point demos. This article walks through a representative case — prompting AI to build a 10-page e-commerce frontend from scratch — and covers six scoring dimensions, the failure patterns that show up most often (with code examples and fixes), prompt-engineering guidance, and a human review checklist. It explains why task completeness, runnability, architecture quality and cross-page consistency matter more than demo impressions, and how to turn evaluation results into reusable prompts and review rules.
Why you need a reproducible evaluation benchmark
As context windows and reasoning ability keep improving, the capability boundary of AI coding assistants has moved from “function-level completion” to “understanding natural-language intent, breaking down tasks, and generating complete multi-file projects”. When teams compare tools of very different shapes, they tend to fall into two traps: judging only the “single-point results” shown in official demos, or designing comparison tasks that are too simple — a single page or a single function — to reveal how a tool behaves under long chains, many files and strong consistency requirements.
A more reliable approach: define a benchmark task of moderate size with a complete business loop and clear acceptance criteria, have every tool complete it under identical input, and then compare them along one fixed set of dimensions. This article uses a single representative case as a thread — prompting AI to build a 10-page e-commerce frontend site from scratch — to explain evaluation dimensions, recurring issues and engineering practice systematically. The case matters because it is not an isolated pile of pages: it requires the product flow, the user flow and the transaction flow to interlock, so any inconsistency in data or state surfaces immediately.
Designing the benchmark task: stress-testing tools with a complete business loop
An ideal evaluation task should cover the full user journey. For an e-commerce frontend, a representative page list looks like this:
- Home / product listing page
- Product detail page
- Checkout / order page
- Order success page
- Login page
- Registration page
- User center — dashboard
- User center — orders
- User center — wallet / coupons
- User center — settings
What makes this list interesting is that it builds in several coupling points: the login state has to carry through every sub-page of the user center; the checkout flow has to connect the product detail page, the purchase page and the payment-success page; and the wallet has to line up with order data. The real difficulty is not “can it generate 10 pages” but the overall completeness of the site and consistency across pages — whether the AI can maintain global state, a unified routing structure, a consistent design language and consistent data contracts.
Six core evaluation dimensions
Score the tools against one fixed set of dimensions so that subjective impressions do not drive the conclusion.
1. Task completion and completeness
Did the tool produce all pages in one shot or with few interactions? Are the core functions of each page present — list rendering, detail display, form submission, status feedback? This is the most basic threshold. Many tools can generate a “skeleton” yet skip critical branches such as empty, error and loading states.
2. Runnability and stability
Whether the output actually runs is the dimension that separates tools most sharply. Common problems: it errors on the first run, needs several rounds of repair before it starts, or cannot run at all once generated. “It compiles” does not mean “it runs”, and “it runs” does not mean “the logic is correct”.
3. Code quality and architectural soundness
Are concerns separated — styles from logic, data access from views? Is the directory structure clear? Are sensible layers (components, state management, data layer) actually laid out rather than merely named? The most common illusion here is hollow abstraction: a hooks/, context/ or services/ folder exists, but it is either empty or contains a single TODO.
4. Visual and interaction consistency
Is the design language consistent in color, spacing and component style? Is responsive behavior covered for mobile? Are there contrast defects, such as a white-on-white button that becomes invisible? Do form pages like login and registration break on small screens?
5. Response speed and interaction experience
Waiting time for generation and edits, and how much the tool stutters, directly affects the flow of development. Speed should not be the only metric, but over long iterative tasks it significantly amplifies the difference in experience.
6. Maintainability and extensibility
Is the code easy for a human to take over? Can mock data be swapped for real APIs painlessly? This is what determines whether the project can move from demo to product.
Frequent problems in AI-generated code, with counter-examples and fixes
The defects that keep reappearing during evaluation are also the priorities for prompt tuning and manual review.
Problem 1: mock data coupled with the view
AI tends to hardcode fake data straight into components, which forces heavy rework of the view when a real API has to be integrated.
// Counter-example: mock data hard-coded in the component, hard to swap for a real APIfunction ProductList() {const products = [{ id: 1, name: "Product A", price: 99 },{ id: 2, name: "Product B", price: 199 },];return products.map(p => <ProductItem key={p.id} data={p} />);}// Correct: data access decoupled from the view, so the view needs zero changes when a real API arrives// services/product.jsexport async function fetchProducts(params) {const res = await fetch("/api/products?" + new URLSearchParams(params));if (!res.ok) throw new Error("Failed to load products");return res.json();}// The component only cares about rendering and statefunction ProductList() {const { data, loading, error } = useProducts();if (loading) return <Skeleton />;if (error) return <ErrorTip message={error.message} />;return data.map(p => <ProductItem key={p.id} product={p} />);}
Problem 2: hollow state and context
A directory structure that “looks professional” while containing nothing is a typical case of structural false prosperity.
// Typical output: the Provider scaffolding is complete, but the value is emptyconst CartContext = createContext(null);export function CartProvider({ children }) {// TODO: there is often no implementation here at allreturn <CartContext.Provider value={{}}>{children}</CartContext.Provider>;}
When reviewing, check whether these abstractions genuinely carry state and side effects instead of stopping at the naming layer.
Problem 3: responsive and accessibility defects
/* Counter-example: white text on a white background, the button is invisible against light themes */.btn-primary { background: #fff; color: #fff; }/* Correct: keep foreground/background contrast at WCAG AA (~4.5:1) */.btn-primary { background: #2563eb; color: #fff; }
Layouts that do not adapt to mobile, and form pages that break on small screens, are also high-incidence areas that usually need extra prompting or manual completion.
Problem 4: broken directory structure
Some tools produce structure errors such as “a folder of the same name nested inside a folder”, which breaks the build outright. Record this kind of problem first during evaluation, because the damage it does to maintainability is fundamental.
Prompt engineering: put acceptance criteria into the input
Evaluation and hands-on practice confirm the same pattern: the more specific the input, the more controllable the output. A quality prompt should contain four elements:
- Tech stack constraints: specify the framework, language and styling approach to prevent style drift.
- A complete page list with dependencies: spell out the 10 pages and their data-flow relationships, such as login state carrying through the user center and the checkout chain connecting its steps.
- Acceptance criteria: for example “form validation is mandatory”, “use placeholders for images first but keep the real fields in the structure”, “the layout must adapt to mobile”, “color contrast must remain readable”.
- Layering requirements: require data access to be separated from the view and state management to be centralized, which suppresses mock-data coupling and hollow abstraction at the source.
For long tasks, step-by-step generation plus small acceptance checks usually works better than one-shot generation: first get a minimal runnable loop working (the app starts, routes are navigable), then fill in functionality and styling page by page, and finally handle responsiveness and consistency in a single pass. This surfaces fatal problems such as “it doesn’t run” early and avoids rework later.
Human review: a step you cannot skip after AI generation
No matter how capable the tool, AI-generated code should always pass human review. Suggested checkpoints:
- Does it start with one command? Get it running before refining it; fix runtime failures first.
- Are the data contracts clear? Is mock data confined to the data layer, and can it be swapped for real APIs painlessly?
- State consistency: are login state, cart and order status consistent across pages?
- Hollow-spot detection: do
hooks,contextandservicescontain real implementations? - Visuals and usability: are contrast, responsiveness, and the loading, error and empty states all in place?
Conclusion
Evaluating AI coding tools comes down to dropping the instinct for “single-point demos” and moving to an engineering path of a reproducible benchmark task + a fixed set of evaluation dimensions + strict manual verification. Using a closed-loop task such as building a complete e-commerce site from scratch as the yardstick makes it possible to compare tools fairly on completeness, stability, architectural quality and consistency, and it also lets a team accumulate a reusable set of prompts and review rules. One point deserves emphasis: the value of AI coding tools is to amplify a developer’s output, not to replace engineering judgment. Treat it as an efficient “copilot”, with a human owning architectural decisions and quality control — that is the most reliable way to collaborate today.
