Test Case
A Test Case is a detailed set of conditions, inputs, actions, and expected results created to verify a specific functionality or requirement of an application.
A test case answers: “How exactly should this functionality be tested?”
1. Definition
A Test Case is a detailed set of conditions, inputs, actions, and expected results created to verify a specific functionality or requirement of an application.
A test case answers: “How exactly should this functionality be tested?”
2. Purpose of Test Cases
- Validate functional and non-functional requirements
- Ensure repeatable and consistent testing
- Provide clear execution steps
- Enable defect identification and traceability
- Serve as test execution evidence
3. Key Components of a Test Case
A standard manual test case includes:
- Test Case ID
- Test Case Title / Description
- Preconditions
- Test Steps
- Test Data
- Expected Result
- Actual Result
- Status (Pass/Fail)
4. Characteristics of a Good Test Case
- Clear and unambiguous
- Independent and reusable
- Traceable to requirements
- Covers positive and negative scenarios
- Easy to understand by any tester
5. How to Write Test Cases (Steps)
- Understand the requirement
- Identify test scenarios
- Apply test design techniques
- Write clear steps
- Define expected results
- Review test cases
6. Test Case Example
Feature: Login
- Test Case: Verify login with valid credentials
- Precondition: User account exists
-
Steps:
- Open login page
- Enter valid username
- Enter valid password
- Click Login
- Expected Result: User logged in successfully
7. Test Case vs Test Scenario
| Aspect | Test Case | Test Scenario |
|---|---|---|
| Detail | Low-level | High-level |
| Steps | Yes | No |
| Purpose | Execution | Coverage planning |
8. When to Write Test Cases
- After requirement analysis
- Before test execution
- During test design phase of STLC
9. Common Mistakes
- Vague steps or expected results
- Combining multiple validations in one test case
- Missing negative test cases
- Not updating test cases after changes
10. Interview-Ready Answers
Short answer:
A test case is a detailed set of steps and expected results used to validate a specific requirement.
Detailed answer:
Test cases define exact execution steps, test data, and expected outcomes to ensure consistent and traceable testing.
11. Key Takeaway
Test Cases transform testing ideas into executable checks, ensuring repeatable and reliable testing.