Great work!

XP to next level

BugEater
EN

Test Cases: The Professional Standard

If a checklist is the quick sketch, a test case is the architectural drawing. It captures not just what to verify, but the precise conditions, sequence of steps, and expected outcomes needed to verify it — so that anyone on the team, at any point in the future, can run the same test and get the same result.

Learning Objectives

By the end of this lesson you will be able to:

  • Write a test case using the standard professional structure
  • Explain the purpose of each field in the test case format
  • Distinguish between positive and negative test cases
  • Describe the three reasons formal test cases are valuable beyond bug-finding

The Test Case Structure

A standard test case has six components:

Field Description
Test Case ID A unique identifier. Format varies: TC-001, LOGIN-05, REG-NEG-03. Enables traceability.
Title A concise description of what is being tested and the expected outcome.
Preconditions The state the system must be in before step 1 is executed.
Steps Numbered, atomic actions the tester performs.
Expected Result What the system should do after the final step. Based on requirements.
Pass/Fail Status Updated after execution: Pass, Fail, or Blocked.

A Complete Test Case Example

Test Case ID: REG-001

Title: Registration form accepts valid credentials and creates account

Preconditions:

  • User is not logged in
  • Browser: Chrome 120 on macOS
  • Test environment: staging.example.com
  • The email newuser_tc01@example.com does not exist in the database

Steps:

  1. Navigate to https://staging.example.com/register
  2. Enter email: newuser_tc01@example.com
  3. Enter password: SecurePass123
  4. Enter confirm password: SecurePass123
  5. Click the Create Account button

Expected Result: The user is redirected to the dashboard at /app/dashboard. A welcome email is sent to newuser_tc01@example.com. The user record is present in the users table with status active.

Positive vs Negative Test Cases

Testing is not just about verifying that things work when used correctly — it's equally about verifying that the system fails gracefully when used incorrectly.

Positive Test Cases

A positive test case verifies the happy path — the system behaves correctly when given valid, expected input.

Examples:

  • User logs in with correct credentials → lands on dashboard
  • User submits form with all required fields → receives confirmation
  • Search returns results for a valid query

Negative Test Cases

A negative test case verifies that the system handles invalid, unexpected, or edge-case input correctly.

Examples:

  • User submits login form with wrong password → sees error, not a crash
  • User leaves required email field empty → sees validation message
  • User enters a past date where only future dates are allowed → sees validation message, form is not submitted

The ratio rule of thumb: For any feature, you should have at least as many negative test cases as positive ones. Systems fail at the edges, not in the middle.

A Negative Test Case Example

Test Case ID: REG-NEG-002

Title: Registration form shows validation error when email field is empty

Preconditions:

  • User is not logged in
  • Browser: Chrome 120 on macOS
  • Test environment: staging.example.com

Steps:

  1. Navigate to https://staging.example.com/register
  2. Leave the email field empty
  3. Enter password: SecurePass123
  4. Enter confirm password: SecurePass123
  5. Click the Create Account button

Expected Result: Per REG-AC-07: The form does not submit. The email field displays the validation message "Email is required."

Why Formal Test Cases Are Valuable

1. Reproducibility and Audit Trail

A test case executed today can be re-executed identically in six months. This is essential for regression testing and for formal audits in regulated industries.

2. Onboarding New Team Members

A new QA engineer joins the team. A library of test cases lets them contribute to testing immediately, without needing weeks of context building.

3. Foundation for Automation

Well-structured manual test cases are the specification for automated tests. Each manual step maps to an automation command. Teams that write good manual test cases first build automation faster and with fewer errors.

Pro Tips

One expected result per test case. If you have multiple things to check, either use sub-steps or split into multiple test cases. Ambiguous pass/fail criteria make test results meaningless.

Keep preconditions realistic. If a precondition requires database manipulation or admin access, note exactly what needs to be done. "User has a subscription plan" is not enough — "User has an active Pro subscription (can be set via admin panel at /admin/users)" is better.

Summary

  • A test case has six components: ID, Title, Preconditions, Steps, Expected Result, and Pass/Fail Status.
  • Positive test cases verify correct behavior with valid input (happy path).
  • Negative test cases verify correct behavior with invalid, unexpected, or edge-case input.
  • Test cases provide reproducibility, onboarding support, and an automation foundation — not just bug detection.
  • A good library of test cases is one of the most valuable assets a QA team can build.

Quiz

What is the purpose of the Preconditions field in a test case?

Which of these is a NEGATIVE test case?

Why are formal test cases valuable beyond just finding bugs during a single test execution?