Introduction
A test case is one of the most important documents in manual testing. It defines how a specific functionality should be tested.
What is a Test Case?
A test case is a detailed set of conditions, inputs, execution steps, and expected results designed to verify a particular functionality of an application.
Test cases help ensure that software works according to requirements.
Components of a Test Case
- Test Case ID
- Test Scenario
- Preconditions
- Test Steps
- Test Data
- Expected Result
- Actual Result
- Status (Pass/Fail)
- Priority
Standard Test Case Format
| Field | Description |
|---|---|
| Test Case ID | Unique identifier for the test case |
| Title | Short description of test case |
| Steps | Detailed execution steps |
| Expected Result | Expected outcome after execution |
| Status | Pass or Fail |
Real Example of a Test Case
Test Case: Login Functionality
- Test Case ID: TC_Login_01
- Precondition: User registered
- Steps:
- Open login page
- Enter valid username
- Enter valid password
- Click login button
- Expected Result: User successfully logs in
Test Case vs Test Scenario
- Test Scenario: High-level description of what to test.
- Test Case: Detailed step-by-step testing instructions.
- Example: Scenario: Test login feature. Test Case: Detailed login steps.
Best Practices for Writing Test Cases
- Keep steps clear and simple
- Avoid unnecessary details
- Use proper test data
- Maintain traceability with requirements
- Review test cases regularly
Test Case Interview Questions
What is a test case?
A test case is a document that defines inputs, execution steps, and expected results to validate functionality.
What is difference between test case and test scenario?
Test scenario is high-level; test case is detailed and structured.
How do you write a good test case?
By defining clear steps, expected results, and using proper test data.
Frequently Asked Questions
Who writes test cases?
QA testers write test cases based on requirements.
Can test cases be automated?
Yes, test cases can be converted into automated test scripts.