How to Write Test Cases From a Requirements Document

Writing test cases from requirements is the core daily skill of a manual tester, and it is the thing most interview tasks for junior QA roles are built around. The good news is that it is a method rather than a talent, and the method is learnable in an afternoon.

Read the requirement properly first

Take a requirement such as: “Users must be able to reset their password using a link sent to their registered email address. The link expires after 24 hours.”

Before writing anything, identify four things.

  • The actors. Who does this? A logged-out user.
  • The action. Requesting a reset, then using the link.
  • The rules. Registered email only, 24-hour expiry.
  • The gaps. What the requirement does not say. What happens with an unregistered email? Can the link be used twice? What if they request several resets?

That last category is where testers earn their place. Spotting what the requirement failed to specify, and asking about it before development finishes, prevents far more defects than testing afterwards does.

Cover the three types of case

Every requirement needs cases in three groups, and new testers typically write only the first.

Positive cases. The thing works as intended. Registered user requests a reset, receives an email, clicks the link within 24 hours, sets a new password, logs in with it.

Negative cases. Invalid input is handled properly. Unregistered email address. Empty field. Malformed address. Link used after 25 hours. New password that fails the complexity rules.

Boundary cases. The edges of the rules, where defects cluster. The link at 23 hours 59 minutes and at 24 hours 1 minute. A password at exactly the minimum length and one character below it.

A junior candidate who produces all three groups in an interview task stands out immediately, because most produce only the happy path.

What a test case contains

Keep the format simple and consistent:

  • ID for referencing it later.
  • Title describing what is being tested in one line.
  • Preconditions: what must be true before you start.
  • Steps: numbered, specific, each one action.
  • Test data: the actual values used.
  • Expected result: precisely what should happen.

The two most common faults are vague steps and vague expectations. “Enter an invalid email” should be “Enter abc@” with the exact value stated. “An error appears” should name the message and where it appears. Another tester must be able to run your case and reach the same verdict without asking you anything.

One case, one thing

Resist combining. A case that tests the reset email, the expiry and the complexity rules together will fail, and the failure will not tell you which part broke. Separate cases cost slightly more time to write and save considerably more in diagnosis.

Prioritise, because you will not run everything

There is never enough time. Rank your cases by risk: how likely is this to break, and how bad is it if it does. Password reset failing entirely is critical. A slightly misaligned error message is not.

Being able to explain that prioritisation is a senior behaviour, and it is worth demonstrating early.

A practice exercise worth doing

Take any feature of a website you use and write cases for it as though from a requirement. A search box is a good start: empty search, single character, very long string, special characters, no results, many results, pagination, sorting.

Do that for three or four features and keep the output. It is both practice and portfolio material, and it is exactly what you will be asked to produce in a junior QA interview.