Why AI‑Generated Test Cases Miss the Mark and How Understanding the Skill Design Fixes It
The article explains how the testcase‑writer Skill works—its three‑stage pipeline, three core design principles, clarification workflow, decomposition process, self‑check mechanisms, and a concrete 52‑case Taobao add‑to‑cart example—so users can craft inputs that yield accurate AI‑generated test cases.
Design Thinking
testcase‑writer uses a three‑layer pipeline: input judgment → three‑stage generation → output self‑check.
Three design principles:
Mechanism over model intelligence : quality guarantees are encoded in the prompt (13 required case types, explicit handling of vague terms, five dimensions for monetary scenarios).
Never guess when information is missing : the system asks clarification questions instead of fabricating data.
Embed review experience into generation rules : recurring review failures (generic pre‑conditions, merged steps, unverifiable expectations) are turned into hard rules.
More Input, More Questions
If the input is less than 100 characters or lacks structured information, the skill switches to a clarification mode and asks four questions about modules, core flow, key rules, and monetary/AI scenarios.
Example contrast:
Single sentence “Write login test cases” yields 20 cases, many mismatching the actual business.
Detailed input for “Taobao add‑to‑cart” with modules, flow, and rules produces 52 cases that align perfectly with the product.
Decompose Before Writing, Verify After
The tool first splits the requirement into three artifacts:
Business rules (each turned into a verifiable statement).
Boundary conditions (all numeric parameters’ edge points).
Open questions (vague terms or undefined technical details are flagged as Q‑01…Q‑XX).
During generation each case is labeled with its type (e.g., Positive , Boundary , Concurrency ) and after generation an automatic coverage check validates that all 13 types, all rules, and all boundaries are covered.
Self‑Check and Review Workflow
After generation users should first inspect the extracted business‑rule list and the pending‑question list, resolve any Q‑XX items with the product owner, then review the test‑case table.
The coverage report highlights missing dimensions or under‑represented types, guiding users to adjust the input.
Concrete Example: 52 Taobao Add‑to‑Cart Cases
Input:
Taobao add‑to‑cart, 5 modules: add to cart, SKU selection, quantity management, product management, checkout. Flow: select product → select SKU → add to cart → checkout. Rules: real‑time inventory, full‑reduction 300‑50, coupon stacking.The tool skips clarification, extracts 10 business rules, 6 boundary conditions, and 8 open questions, triggers the monetary‑scenario augmentation (precision, boundary, stacking, cumulative deduction, concurrent deduction), and generates 52 cases covering all 13 types. A single‑pass coverage check confirms completeness, and only the eight Q‑XX items need product confirmation.
Final Checklist
Provide complete information: module division, core flow, numeric limits, and flag monetary/AI scenarios.
After generation, review the rule list and pending questions before looking at the case table.
Run the self‑check; address any missing types or uncovered dimensions.
Use the Q‑XX list to clarify with product owners; the process takes about five minutes.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
