Site icon testautomation.in

Understanding Structure and Importance of Test Case

structure and importance of test case

structure and importance of test case

Structure and importance of test case

Learning Objectives

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


What is a Test Case?

A test case is a documented set of inputs, actions, and expected results used to verify that a software feature works correctly.

Think of it as a recipe.

Just as a recipe tells you:

A test case tells the tester:


Example

Suppose you’re testing a login page.

Instead of saying

Test Login

A proper test case would be

Field Value
Test Case ID TC_LOGIN_001
Title Verify successful login
Preconditions User account exists
Test Data Username: admin Password: Admin123
Steps Open Login page → Enter credentials → Click Login
Expected Result Dashboard should open

This allows any tester to execute the same test consistently.


Why Are Test Cases Important?

Without test cases:

With test cases:


Structure of a Test Case

A good test case contains these sections:

Test Case ID
Title
Module
Priority
Requirement ID
Preconditions
Test Data
Test Steps
Expected Result
Actual Result
Status
Comments

Let’s understand each one.


1. Test Case ID

Unique identifier.

Example

TC_LOGIN_001
TC_CART_005
TC_PAYMENT_020

Why?

Easy tracking in Jira, Azure DevOps, or test management tools.


2. Title

Short description.

Good

Verify login with valid credentials

Bad

Login Test

A good title clearly explains what is being verified.


3. Module

Which feature?

Examples


4. Priority

How important is the test?

Priority Meaning
High Critical business function
Medium Important
Low Nice to have

Example

Login

High

Profile Picture Upload

Low


5. Requirement ID

Links the test case to a requirement.

Example

REQ-101
US-230
BR-15

Useful for traceability.


6. Preconditions

What must exist before testing?

Example

Application is running
User account exists
Database available
Internet connected

Without preconditions, someone else may not be able to execute the test correctly.


7. Test Data

Test data is data that is used during testing.

Example

Username

admin@test.com

Password

Password123

Sometimes include:



8. Test Steps

Step-by-step actions.

Example

  1. Open Login page
  2. Enter username
  3. Enter password
  4. Click Login

Each step should be simple and clear.


9. Expected Result

What should happen?

Example

Dashboard opens successfully.

Not

Login works.

Expected results should be measurable.


10. Actual Result

Filled after execution.

Example

Dashboard opened successfully.

or

Error displayed

11. Status

Usually


12. Comments

Extra observations.

Example

Issue reproduced only on Chrome.

Complete Example

Field Value
Test Case ID TC_LOGIN_001
Title Verify successful login
Priority High
Preconditions Registered user exists
Test Data admin / Admin123
Steps Open Login → Enter username → Enter password → Click Login
Expected Result User is redirected to Dashboard
Actual Result Dashboard displayed
Status Pass

Characteristics of a Good Test Case

A good test case is:


Common Mistakes

❌ Too many actions in one step

Bad

Open login page, enter username, enter password, click login, verify dashboard.

Better

Step 1 Open Login page

Step 2 Enter username

Step 3 Enter password

Step 4 Click Login

Step 5 Verify Dashboard

❌ Vague expected results

Bad

System works.

Better

Dashboard page opens and displays the logged-in user's name.

❌ Missing test data

Never assume everyone knows which data to use.


 

 

Have a look at other manual testing topics here 

Exit mobile version