界面已本地化;技能介绍与说明文档按所选语言由 AI 自动翻译,代码、命令、路径和专业术语保留原文,以原作者文档为准。
探索技能
数据与研究 · SKILL.md

test-case-writer

test-case-writer

【数据与研究】Turn a requirement or user story into clear, executable test cases. Use when asked to write test cases, test scenarios, a test suite for a feature, or to derive tests from acceptance criteria. Produces structured test cases — preconditions, steps, test data, expected results — across happy path, edge cases, and negative cases, plus a coverage note, s…

独立 GitHub 快照 · 自动分类 · 以原作者文档为准

技能说明

GitHub

name: test-case-writer description: "Turn a requirement or user story into clear, executable test cases. Use when asked to write test cases, test scenarios, a test suite for a feature, or to derive tests from acceptance criteria. Produces structured test cases — preconditions, steps, test data, expected results — across happy path, edge cases, and negative cases, plus a coverage note, so a tester (or automation) can run them without guessing."

Test Case Writer Skill

Good test cases are unambiguous and complete: anyone can run them and get the same result, and together they cover the ways the feature can succeed and fail. This skill derives test cases from a requirement or user story — happy path first, then the edge and negative cases that find real bugs — each written so it's directly executable.

Working from a brief

Given a user story or a one-line feature description, write the test cases anyway — infer the acceptance criteria, boundaries, and likely failure modes, labelling assumptions. Always include edge and negative cases, not just the happy path. Never hand back questions instead of cases.

Required Inputs

Ask for these only if they aren't already provided (else infer and label):

  • The requirement — the feature/user story and its acceptance criteria.
  • Inputs & rules — fields, valid/invalid values, limits, and business rules that define correct behaviour.
  • Scope & environment — UI/API/both, platforms, and any preconditions (logged-in, data state).
  • Priority — what matters most (critical paths), so cases can be ordered.

Output Format

Test Cases: [feature]

A short intro line, then cases in a table (or per-case blocks for complex flows):

IDTitleTypePreconditionsStepsTest dataExpected resultPriority
TC-01Valid loginHappy pathuser exists1. … 2. …valid credslogged in, lands on …High
TC-02Wrong passwordNegativeuser exists…bad passworderror shown, not logged inHigh
TC-03Empty fieldsNegative/validation—…blankinline validationMed
TC-04Max-length inputEdge/boundary—…boundary valueaccepted/handledMed

Cover, deliberately: happy path, boundary/edge (empty, max, min, just over/under limits), negative (invalid input, wrong state, unauthorised), and any business-rule cases.

End with a coverage note: which acceptance criteria/requirements each case maps to, and any gaps or risks to flag for review.

Quality Checks

  • Each case has clear preconditions, numbered steps, the test data, and a single expected result
  • Steps are unambiguous — two testers would execute them identically
  • Coverage includes edge/boundary and negative cases, not just the happy path
  • Cases trace back to the acceptance criteria / requirement (coverage note)
  • Cases are prioritised so the critical paths are obvious
  • Expected results are specific and verifiable (not "works correctly")

Anti-Patterns

  • Do not write only happy-path cases — the bugs live in the edges and negatives
  • Do not write vague steps ("test the login") — give the exact actions and data
  • Do not use unverifiable expected results ("it should work") — state the observable outcome
  • Do not combine many checks into one bloated case — keep cases atomic and traceable
  • Do not skip preconditions/test data — they're why a case is reproducible

Based On

Test-design practice — requirement-derived cases with boundary-value and negative testing, atomic executable steps, and traceability to acceptance criteria.

Example Trigger Phrases

  • "Write test cases for this story."
  • "Write test scenarios for checkout."
  • "Build a test suite for this feature."
  • "Derive tests from these acceptance criteria."
我的收藏