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 K
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.