Evaluating AI Coding Tools: Building an E-commerce Site from Scratch

    AI coding tools have evolved from simple line completions to autonomous development agents. However, marketing demos often mask real-world engineering challenges. This article introduces a systematic evaluation methodology by building a React e-commerce site with 10 pages as a standardized test task. It covers core evaluation dimensions including autonomous execution, workflow design, code quality, and debugging capabilities. It also analyzes typical failure patterns in AI-generated projects and provides prompt engineering strategies and acceptance checklists to help developers objectively select and utilize AI coding tools.

    1. Why a Systematic Evaluation Methodology is Needed

    Over the past two years, AI coding tools have evolved from simple inline code completion to autonomous development agents. Early tools could only predict the next line of code, whereas mainstream products today can independently decompose requirements, create files, execute commands, and fix errors. Developers are no longer asking “should I use them?” but rather “which one, how to use it, and where are the boundaries?”

    However, there is often a significant gap between promotional materials and actual capabilities. The seamless experience shown in demo videos can turn into repeated errors and futile multi-round fixes in real-world projects. This happens because public information typically only showcases success stories, while engineering practices require an understanding of failure modes and capability boundaries. Rather than passively accepting vendor narratives, it is better to proactively design a standardized test task to measure different tools with the same yardstick. This article uses “building an e-commerce site from scratch” as an example to provide a reusable evaluation methodology.

    2. Designing a Standardized Test Task: The E-commerce Litmus Test

    2.1 Task Definition

    An ideal test task should meet three conditions: broad coverage, clear acceptance criteria, and sufficient complexity to “force out” the tool’s true capabilities. A typical task is as follows:

    Use React to build a front-end shopping site containing 10 pages:

    • Home Page (Product List)
    • Product Detail Page
    • Product Purchase Page
    • Purchase Success Page
    • User Login Page
    • User Registration Page
    • User Dashboard
    • User Orders Page
    • User Wallet (Coupons)
    • User Settings Page

    2.2 Why an E-commerce Site is an Ideal Test Scenario

    • Strongly coupled business workflow: Browsing, adding to cart, placing orders, paying, and viewing orders form a complete loop. This tests the tool’s grasp of “overall consistency,” something single-page code snippets cannot cover.
    • Comprehensive engineering challenges: It covers all core front-end issues, including routing design, state management, form validation, and component reuse.
    • Long task stress test: The scale of 10 pages triggers multi-file, multi-round generation workflows, easily exposing stability issues during long task execution.
    • Detail defect exposure: Interactive details like login state, form validation, and responsiveness are disaster zones for style conflicts and accessibility issues.

    2.3 Define “What Counts as Done” First

    Before testing, acceptance criteria must be clearly defined; otherwise, evaluation conclusions will lose credibility. Recommended criteria include at least:

    • The project can be started with a single command without blocking errors.
    • The core shopping workflow can be completed end-to-end.
    • Main pages render correctly under mobile viewports.
    • Login/registration forms have basic validation.
    • Styles and logic are separated, and mock data is not strongly coupled with components.

    3. Core Evaluation Dimensions

    3.1 Task Understanding and Autonomous Execution

    Whether a tool qualifies as an “agent” depends on its ability to deliver end-to-end with minimal human intervention. Evaluation points include: whether it correctly understands the page list and business workflow; whether it proactively plans the project structure; and whether it self-checks during generation. In practice, the watershed moment often lies here: some tools can produce a runnable project in one go, while others throw errors on the first run, requiring manual descriptions of the error context multiple times to converge. The first-pass success rate is the most intuitive hard metric.

    3.2 Interaction Modes and Workflow Design

    Current mainstream tools generally offer multiple working modes. Common industry capability tiers include:

    • Inline completion: Predicts the next code segment in the editor, suitable for localized efficiency boosts.
    • Chat generation: Generates files or snippets via natural language descriptions.
    • Agent mode: Autonomously decomposes tasks, creates files, executes commands, and fixes errors.
    • Planning mode: Generates an execution plan before taking action, suitable for complex tasks.

    During evaluation, focus on three aspects: whether mode divisions are clear (too many options increase decision cost); whether the default mode is smart enough; and whether the execution process is visible and controllable. Additionally, privacy modes (restricting code transmission or enabling desensitized reporting) are significant bonus points for enterprise scenarios, and can even be a veto factor when commercial code is involved.

    3.3 Engineering Quality of Generated Code

    There is a massive gap between “runs” and “maintainable.” It is recommended to review the generated code from four perspectives:

    1. Architectural soundness: Whether component division and directory structure follow community conventions, rather than cramming all logic into a few giant files.
    2. Separation of concerns: Whether styles are managed independently, and whether mock data is consolidated into an independent mock layer, rather than scattered inside components and coupled with rendering logic.
    3. Real extensibility: Whether a reasonable structure is reserved for state management—beware of hollow shells that “look present” where directories and naming are set up but contain no actual implementation.
    4. Naming and stylistic consistency: Whether similar pages adopt consistent patterns, avoiding style drift like mixing functional components with class components halfway through.

    3.4 Defect Fixing and Iteration Capability

    In real-world engineering, the first round of generation is never perfect. The tool’s “correctability” is crucial: if you paste the raw error message back, can it accurately locate and fix the issue? Will it fall into a loop of “fixing one thing and breaking two others”? Weak fixing capabilities mean high manual takeover costs later, which is the most easily underestimated hidden cost during selection. It is recommended to deliberately design “destructive tests”: intentionally introduce errors and count the rounds required for the fix to converge.

    3.5 Engineering and UX Details

    • Responsiveness: Most AI-generated projects default to desktop viewports. Whether the mobile end is adaptive requires explicit acceptance; login and registration pages are the most common “deformation disaster zones.”
    • Visual consistency: Are colors, spacing, and button styles unified? Are there contrast disasters like “white text on a white background”?
    • Placeholder resource handling: Do images use a unified placeholder scheme, and can they be replaced with real resources at a low cost?
    • Information density: Do core pages like detail pages have a basic information hierarchy, rather than just a title and an image?

    4. Typical Problem Patterns and Causes in AI-Generated Projects

    Based on extensive testing feedback, issues in AI-generated front-end projects are highly patterned. Understanding these patterns helps in quick identification and proactive avoidance:

    4.1 Consistency Drift

    Cause: The model generates pages one by one, lacking global design constraints, leading to disparate colors and layout styles across pages.
    Countermeasure: Provide design specifications (theme colors, spacing, border radius, component conventions) in the prompt first, or require generating global styles and layout components before filling in pages sequentially.

    4.2 Style Conflicts and Contrast Defects

    The root cause of “white text on a white background” is usually chaotic override orders between global styles and component styles, or conflicts between inline styles and stylesheets.
    Countermeasure: Require using a single unified styling solution and add contrast checks to the acceptance checklist.

    4.3 Placeholder Resources and Data Coupling

    Models cannot generate real product images out of thin air. If the prompt does not specify a resource strategy, it will produce bare placeholder characters. If mock data is written directly into components, extensive rework is required later when connecting real APIs.
    Countermeasure: Explicitly state in the prompt: “Use a placeholder image service for all images, and consolidate all data into an independent mock directory.”

    4.4 Chaotic Project Structure

    In some cases, counterintuitive structures like “creating a directory with the same name inside a directory” appear, directly causing module resolution failures and project startup errors. This exposes reliability issues at the file system operation level—a hard flaw with extremely high manual repair costs. It should be recorded as a major defect during evaluation.

    4.5 Long Task Instability

    A 10-page task means hundreds or thousands of model calls and file operations; any single deviation can be amplified by subsequent processes. Some tools exhibit sudden speed drops, mid-task stalls, or silent file loss during long tasks. During evaluation, fully record the total task time and manual intervention count, rather than just looking at the final result.

    5. Prompt Engineering Strategies: Write Acceptance Criteria into Requirements

    5.1 One-Shot Generation vs. Phased Delivery

    For multi-page projects, instead of feeding all requirements at once, it is better to proceed in phases: have the tool generate the project skeleton and global styles first, and after passing acceptance, iterate page by page. Although the number of interaction rounds increases, the debugging cost at each step is lower, and the final consistency is actually better.

    5.2 Example Prompt Template

    1. Role: Senior Front-end Engineer
    2. Tech Stack: React + React Router + CSS Modules (separation of styles and logic)
    3. Task: Build an e-commerce shopping site containing 10 pages: Home, Detail, Purchase, Purchase Success, Login, Register, User Center (Dashboard/Orders/Wallet/Settings)
    4. Constraints:
    5. 1. Theme color unified in blue, following uniform spacing and border radius conventions;
    6. 2. All images use a placeholder image service, product data consolidated into the src/mock directory;
    7. 3. Login/registration forms must include required fields, email format, and password length validation;
    8. 4. Pages must adapt to mobile viewports (starting at 375px);
    9. 5. Output the project startup command and a page checklist self-inspection upon completion.

    5.3 Acceptance Checklist Driven

    Structure the acceptance criteria into a checklist for AI self-inspection and easy manual review:

    1. - [ ] Install dependencies and start without errors
    2. - [ ] All 10 page routes are reachable
    3. - [ ] The main shopping workflow can be completed end-to-end
    4. - [ ] No horizontal scrollbars on mobile viewports
    5. - [ ] No contrast issues like white text on a white background
    6. - [ ] Mock data is decoupled from components

    6. Tool Selection Evaluation Checklist

    Beyond general capabilities, local context factors must also be factored into the selection process:

    1. Network accessibility and response speed: Stable usage without extra network configuration; service response latency directly impacts the long-task experience.
    2. Data compliance and privacy: Whether a privacy mode is provided, whether code is used for training, and how enterprise data boundaries are defined.
    3. Billing transparency: Whether free quotas and paid strategies are clear, and whether resource consumption for long tasks is predictable.
    4. Model capability and iteration pace: The underlying model’s coding ability, context length, and product iteration speed.
    5. Ecosystem compatibility: Whether it can smoothly import existing projects, and whether mainstream languages and frameworks are supported.

    For instance, products like intelligent coding assistants launched by cloud vendors such as Baidu AI Cloud may possess native advantages in specific regional network accessibility and compliance guarantees, making them worthy of inclusion in the candidate pool for identical benchmark tests.

    It must be emphasized that selection conclusions should not come from a single test. It is recommended to run the same task three or more times and record four quantitative metrics: first-pass success rate, manual intervention count, fix convergence rounds, and code rework ratio—using data instead of gut feeling to make decisions.

    7. Conclusion

    The capability boundaries of AI coding tools are expanding rapidly, but there remains a distance between “demo-level amazement” and “production-level reliability.” From the e-commerce site test, completing the business workflow is no longer the hard part; what truly widens the gap is consistency control, defect fixing capabilities, and engineering details. For developers, the most important thing is not chasing a single tool, but establishing your own evaluation system: measure capabilities with standardized tasks, constrain outputs with acceptance checklists, and control risks with phased strategies. When the tool’s determinism is sufficient to handle more steps, hand over a larger scope of delivery to it—this is the correct posture for collaborating with AI.