Software Testing · Lesson 2 of 8

Writing test scenarios and test cases

The fields of a good test case, positive and negative cases, and a worked login example.

A test scenario is a high-level thing to test ("Verify login"). A test case is a precise, repeatable check under that scenario, written so anyone can run it and get the same result.

Fields of a test case

  • ID and title
  • Preconditions — what must be true before starting.
  • Steps — numbered, one action each.
  • Test data — exact inputs.
  • Expected result — specific and checkable.
  • Actual result and status (Pass / Fail / Blocked) — filled during execution.
  • Priority

Positive and negative cases

Positive cases use valid input and the expected flow. Negative cases use invalid input, missing data or wrong order — and check that the system fails gracefully with a clear message. Good suites have plenty of both.

Example

Practise on any app you use
Scenario: Login with email and password

TC_LOGIN_01  Valid login                                   Priority: High
  Pre:   User anu@example.com exists, password "Kochi@2026"
  Steps: 1. Open /login  2. Enter email  3. Enter password  4. Click Login
  Expected: Dashboard opens; user's name shows at top right

TC_LOGIN_02  Wrong password                                Priority: High
  Steps: as above with password "kochi2026"
  Expected: Error "Email or password is incorrect"; stays on /login; password field cleared

TC_LOGIN_03  Empty email                                   Priority: Medium
  Expected: "Email is required" shown; no request sent

TC_LOGIN_04  5 wrong attempts                              Priority: High
  Expected: Account locked for 15 min (per requirement R-12)

What to notice

• Each case checks one thing and has an exact expected result.
• Negative cases (02–04) outnumber the positive one — that's typical.
• The error message doesn't reveal whether the email exists — testers also check security behaviour like this.

Apps, IDs and data are fictional examples written for practice.

Key points

  • Scenario = what to test; case = exact steps and expected result.
  • One check per test case.
  • Write both positive and negative cases.
  • Expected results must be specific.

Quick check

Which expected result is written best?

Practice task

Write six test cases (two positive, four negative) for a 'Sign up with mobile number and OTP' screen.

Interview corner

Write test cases for a pen / lift / ATM.

Group them: functional (does it work as intended), negative (misuse), boundary, usability, performance and safety. Interviewers check structure and coverage, not a perfect list.

What's the difference between a test scenario and a test case?

A scenario is a high-level area to test; test cases are detailed steps, data and expected results under it.

Original lesson written by the InfoparkDaily team · © 2026 InfoparkDaily · Free to learn — no paid course or subscription.