Test Case: A specific, written check: the steps to follow, the input data to use, and the result you expect, so anyone can run it and tell whether the software passed.
Example
Test case TC-07: open the login page, enter a registered email and a wrong password, click Sign in. Expected result: the message "Incorrect email or password" appears, and the user stays on the login page.
Parts of a Test Case
| Field | Example |
|---|---|
| ID and title | TC-07: Login with wrong password |
| Preconditions | User asha@test.com exists and is active |
| Steps | 1. Open login page 2. Enter email and wrong password 3. Click Sign in |
| Test data | Email: asha@test.com, Password: Wrong@123 |
| Expected result | Error message shown; user not logged in |
| Actual result and status | Filled in when run: Pass or Fail |
Writing Good Test Cases
- One check per test case, with a clear expected result.
- Cover positive cases (valid input) and negative cases (invalid input).
- Test boundaries, such as the minimum and maximum allowed values.
- Write steps so someone new can follow them without asking you.
- Link each test case to its requirement or acceptance criteria.
Test Case vs Test Scenario
A test scenario is what to test, such as "Verify login". Test cases are the detailed checks under it: valid login, wrong password, locked account, empty fields. Interviewers often ask you to write test cases for a login page or a pen; practise both.
Related terms
- Test Scenario: the higher-level idea a test case belongs to.
- Test Data: the input a test case uses.
- Test Plan: the document that organises testing.
- Acceptance Criteria: often the source of test cases.
Previous term: Technical Round | Next term: Test Data
Related guides
- Software Development vs Testing
- Technical Interview Questions for Freshers
- Which IT Role Suits You Best?
Frequently asked questions
What is a test case?
A test case is a written check with steps, input data, and an expected result, used to verify one behaviour of the software.
What are positive and negative test cases?
Positive test cases use valid input to check normal behaviour. Negative test cases use invalid input to check errors are handled.
What is the difference between a test case and a test scenario?
A test scenario describes what to test. Test cases are the detailed steps and expected results for it.
How do I write test cases for a login page?
Cover valid login, wrong password, unregistered email, empty fields, locked accounts, password visibility, and the remember-me option.
Explore more internship terms
The IT Internship Glossary explains 199 terms you will hear before and during your internship, with simple definitions and real examples.
Browse all 199 terms