How to write test cases: step-by-step, with examples
Write a test case by starting from the requirement, listing the happy-path, negative and edge scenarios, then writing each one in a standard format — an ID, title, preconditions, numbered steps, test data and a precise expected result — and having it reviewed so anyone can run it. Below is the step-by-step, with good and bad examples from the library and how to check AI-generated cases.
From requirement to a reviewed case
Start from the requirement
Read the requirement, user story or screen. Write down what the feature must do and the rules around it (limits, errors, who can do it).
List the scenarios
Note the happy path first, then the negative and edge cases: empty input, wrong input, limits, interruptions, slow network, the wrong device.
Write each case in the standard format
Give it an ID and a title, set the preconditions and test data, write numbered steps, and state a precise expected result. Use the test case format.
Prioritise
Mark the release-blocking cases (P1) so that if time is short, the important ones run first.
Review
Have someone else read the case. If they cannot run it without asking you a question, tighten the steps or the expected result.
What a good case looks like
The difference is always the same: name the exact input and a result you can judge pass or fail.
Vague: Check login.
Clear: Signing in with a correct email and password lands the user on the home screen with their name shown.
The good version names the exact input and a result you can judge pass/fail; 'check login' cannot be run the same way twice.
Vague: Test payment works.
Clear: Paying ₹100 by UPI from the cart creates exactly one order and the amount charged equals the amount shown.
The good version fixes the data and states the precise, observable expected result — including the 'exactly one order' edge that catches double-charges.
Vague: Try wrong OTP.
Clear: Entering an incorrect OTP three times shows the lockout message and blocks a fourth attempt until the cooldown.
The good version states the count, the message and the block, so the tester knows exactly what passing looks like.
See fully written cases in the login page, UPI payment and checkout sets.
Checking cases an AI wrote for you
An AI tool can draft a lot of cases fast, but it tends to over-cover the happy path, invent inputs that do not exist in your app, and miss the real-device edges — OEM battery savers, UPI hand-offs, slow Indian networks. Before you trust an AI-generated set, read each case for a precise expected result, delete the ones that do not match your app, and make sure the negative, interruption and device cases are there.
This is exactly what testing AI-generated test cases on real devices is for — running the cases an AI wrote on the phones your users actually own, and getting back a verified pass/fail report.
300+ companies · 127,000+ bugs reported · 20,000 testers on real phones · since 2010 · see a sample report
Run these cases on real phones
From ₹9,999 + GST, report in 3 business days. Our testers run your cases on the phones, laptops and browsers real Indian users own — on Jio, Airtel and Vi — and send back a verified pass/fail report.
Earn by testing apps with 99tests
Join 20,000+ testers who run real apps on their own phones and get paid for every verified bug.
Email me new test case sets each month
One email a month. Unsubscribe anytime.