After analysing the requirement and splitting it into test conditions, we finally reach the part people usually call “writing test cases”.

In the previous article I used High Level Test Case for the short description. This one goes into more detail; many teams call it a Low Level Test Case. That is project vocabulary, not two mandatory ISTQB layers. If your company has a different template, use the company template. Don’t take this article into a meeting and demand that the whole team change its columns.

What does a test case need to answer?

Someone picking up the test case should understand:

A common template has fields like these:

FieldWhat it is for
Test Case IDAn identifier for tracing, reporting and discussion
TitleOne sentence describing the scenario and main result
PreconditionsThe state that must be true before starting
Test DataAccount, input, file or data needed
StepsActions in order
Expected ResultObservable behaviour that is expected
PriorityHelps choose execution order when time is limited
StatusTest-case lifecycle status such as Draft, Approved or Obsolete

Execution status — Pass, Fail, Blocked — usually belongs to a test run, not the lifecycle of the test case itself. If a tool puts both in one place, follow the tool, but keep the distinction in your head.

Example: successful login

Suppose the requirement has been clarified:

The test case could look like this:

FieldContent
IDLOGIN-001
TitleActive user logs in successfully with valid credentials
PreconditionsUser is on the Login page; account is active; no session exists
Test Dataadmin@example.com / Correct#123
PriorityP0

Steps:

#ActionExpected Result
1Enter email admin@example.comEmail appears correctly in the field
2Enter password Correct#123Password is masked as designed
3Click LoginRequest is processed once; user goes to /dashboard; header shows the correct account name

There is no need to split “click the field”, “move a hand to the keyboard” and “type the letter a” into three steps. A test case is not a script for a human-shaped robot. Write enough for another person to execute it consistently, but don’t describe things anyone can see after opening the app.

Expected Result must be checkable

An expected result such as:

The system works correctly.

...leaves you not knowing where to look.

Be more specific:

The user is redirected to /dashboard, a valid session is created and the header displays the name Admin.

If one step has several important results, you can group them as long as they remain readable. If the expected result fills half the screen, the test case is probably carrying too many goals. Revisit how the scenario was split.

A precondition is not a hidden step

A precondition describes the state that needs to exist, for example:

If creating that state through the UI is itself a flow that needs testing, write a separate test case or setup. If it is only a condition for testing login, don’t make the person running the test register an account from scratch every time just because “the user must reach this screen”.

Linking another test case as a precondition can be convenient, but it easily creates a dependency chain: TC-03 needs TC-02, TC-02 needs TC-01, and TC-01 fails so the whole set sits still. Prefer independent setup and resettable data where possible.

Keep test data separate or put it in the title?

The title should describe the scenario:

Active user logs in successfully with valid credentials.

Keep the concrete values in test data:

email = admin@example.com
password = Correct#123

If the value is the boundary or the thing that makes this case different from another, putting it in the title is reasonable:

Password with exactly 12 characters is accepted.

There is no rule that every title must contain a real account. Stuffing long data into a name makes the report look like a broken log line.

Where does Priority come from?

P0, P1 or High, Medium, Low are project conventions. Don’t assign P0 to every login test and announce that “login is the most important thing”.

Priority should consider:

The point is that when only 30 minutes remain, the team knows what to run first. If every case is P0, the Priority column is decorating the spreadsheet.

Reviewing a test case

Before execution, read it again and ask:

Peer review helps catch assumptions and missing coverage. It does not need to become a meeting for policing semicolons; first check whether the test is correct and useful.

Example of splitting test cases by screen in a spreadsheet
Example of splitting test cases by screen in a spreadsheet

A spreadsheet is fine for a small set. As the number of cases, runners and test runs grows, a test management tool makes life easier.

Wrap-up

A good test case is not a long test case. It is clear enough for someone else to run, specific enough to tell pass from fail, and traceable enough to explain why it exists.

The next article goes into Bug Logging. A failed test case is only a signal; turning that signal into a bug report a developer can reproduce is a different story.

References