Test Case Writing Best Practices — 20 Real Examples (2026)
How to write test cases that pass senior QA review on the first pass. 20 worked examples across login, checkout, and API flows, plus a downloadable template and the 8 anti-patterns to avoid.

Last updated 2026-07-20 · 12 min read · By Avinash Kamble, reviewed by Priyanka G.
A good test case saves 10x its writing time in regression cycles; a bad one wastes review after review. After reviewing 4,000+ candidate test cases this year, the same eight mistakes cause 80% of rejections. Fix them, apply the template below, and your test cases will ship on first review.
Key takeaways
- The IEEE 829-inspired template we recommend for 2026 agile teams.
- 20 worked examples across UI, API, and negative flows.
- The 8 anti-patterns that get test cases sent back for rework.
- How to design a suite that stays maintainable past 500 cases.
1. The template that gets approved on first review
ID: TC-CHECKOUT-014
Title: Apply expired coupon on checkout
Preconditions: User signed in, cart has 1 item, coupon EXPIRED2025 exists
Steps: 1. Go to /checkout
2. Enter EXPIRED2025 in the coupon field
3. Click Apply
Expected: Inline error "This coupon has expired" is shown.
Cart total unchanged.
Priority: High
Type: Negative, functional
Automation: Yes — see tests/checkout/coupon.spec.tsNine fields, nothing more. See our complete manual testing tutorial for how this fits into the STLC.
2. 20 examples across UI, API, and negative flows
Grouped by feature area — copy, adapt, and add to your suite.
Login (5) Signup (3) Checkout (5) API (4) Negative (3)
Valid credentials Duplicate email Empty cart GET 200 happy path Invalid coupon
Wrong password Weak password Expired coupon POST 201 create Session expired
Locked account Missing consent Cart limit exceeded PUT 404 not found XSS in name field
SSO fallback - Payment failed DELETE 401 auth -
Password reset - 3DS challenge - -The full 20 with steps and expected results are in our login test cases library.
3. Eight anti-patterns that get you rejected
- Vague titles ("Test login") — always name the scenario.
- Multiple assertions in one case — split, or use one primary expected.
- No preconditions — the next tester can't run it.
- Environment-coupled data — hard-coded prod IDs break in staging.
- Missing negative cases — happy-path only misses the class of bugs users hit.
- Copy-pasted steps — indicates missing helper/utility.
- No priority — release manager can't cut scope.
- No automation flag — regression suite drift starts here.
4. Keeping a 500+ suite maintainable
Above 500 cases, hand-editing breaks. Adopt three habits: tag every case (@smoke, @regression, @flaky), version-control them in Git next to code (not Excel), and review coverage monthly against your requirements matrix — see the RTM template. Automation-ready cases feed directly into Playwright or Selenium suites.
For the ISO reference on test documentation, see ISO/IEC/IEEE 29119-3.
Frequently asked questions
1.How many test cases should one story have?
2.Should I store test cases in Excel or a test management tool?
3.Do I need to write cases for every bug I find in exploratory testing?
4.What's the difference between a test case and a test scenario?
Practice these questions
Run a live QA mock interview tailored to this topic and get per-skill scoring in minutes.
Was this article helpful?
More from Test Case Writing
Effective test cases, templates, examples.
- Career & Interview PrepThe 3-Minute Whiteboard Testing Trick That Impresses Interviewers (ACCORD Framework)
- AI in TestingHow to Use Claude AI for Test Case Generation (2026 Guide + Prompts)
- AI in TestingChatGPT Test Plan in 2026: The Complete Playbook (IEEE 829 Template, Risk Matrix, RACI & FAQ)
Keep building your QA edge
Pillar guides- Manual Testing Complete Guidecomplete manual testing guide for beginnersEnd-to-end manual testing tutorial — techniques, test cases, bug reports, exploratory charters.
- Manual Testing Interview Q&Acomplete manual QA interview question bank150+ manual testing interview questions with model answers, from freshers to leads.
- QA & Testing GlossarySoftwareTestPilot's QA glossary500+ software testing terms defined — from ISTQB vocabulary to CI/CD, AI testing, and framework jargon.
- QA Practice HubSoftwareTestPilot's practice labsHands-on labs — Selenium, Playwright, API, SQL exercises with sample apps and solution walkthroughs.
Continue reading

What Is Software Testing? The Complete 2026 Guide for QA Engineers
16 min read
Types of Software Testing — Functional vs Non-Functional (25+ Types Explained, 2026)
18 min read
Software Testing Life Cycle (STLC) — 6 Phases with Entry & Exit Criteria (2026 Guide)
14 min readRelated concepts, tools & standards around Software Testing Fundamentals
A quick reference of the people, companies, frameworks and technologies most often mentioned alongside Software Testing Fundamentals in real QA teams — useful when you're mapping a learning path, preparing for interviews, or scoping a new project.
Join the QA Community
Connect with fellow testers, share job leads, and get career advice.
Stop Reinventing the Wheel. Upgrade Your QA Arsenal.
Take your testing skills from beginner to Lead Engineer. Supercharge your daily workflow with our premium digital resources.
- Ready-to-use testing strategy templates
- Advanced API & UI automation guides
- ⏱️ Save 10+ hours a week on test planning
Discussion
Ask a question, share your experience, or correct us. Be kind — real people are reading.