What Is a Test Case? Definition, Examples & Templates (2026)
Whether you're new to software testing or transitioning into a QA role, understanding test cases is foundational. A test case is the single most important artifact in structured testing — it defines what to test, how to test it, and what success looks like. In this guide, we'll break down the definition, walk through real examples, and give you templates you can use today.
What Is a Test Case?
A test case is a documented set of conditions, inputs, steps, and expected results designed to verify whether a specific feature or function of a software application works as intended. Think of it as a recipe: it tells anyone — regardless of their familiarity with the system — exactly what to do, what data to use, and what the outcome should be.
Test cases are used across every type of testing, from unit testing to user acceptance testing (UAT). They provide structure, consistency, and a paper trail that proves the software was tested properly.
In simple terms: A test case answers three questions — What are you testing? How do you test it? What should happen if it works?
Components of a Test Case
Every well-structured test case contains the same core components. Understanding each one is essential before you start writing test cases of your own.
🆔 Test Case ID
A unique identifier (e.g., TC-LOGIN-001) so you can reference, track, and report on it easily.
📝 Title
A concise, descriptive name that tells you what the test validates at a glance. For example: "Verify login with valid credentials."
⚙️ Preconditions
What must be true before the test starts — e.g., "User account exists and is active" or "Browser is Chrome 120+."
📋 Test Steps
Sequential, numbered instructions describing exactly what the tester does. Specific enough for anyone to follow.
📊 Test Data
The exact values used during execution — usernames, passwords, quantities, dates, file names, etc.
✅ Expected Result
What should happen if the feature works correctly. Must be specific enough to judge pass/fail unambiguously.
📌 Actual Result & Status
Filled in during execution — what actually happened and whether the test passed, failed, or was blocked.
Types of Test Cases
Not all test cases are created equal. Different types exist to cover different risk areas. A thorough test suite includes a mix of all four:
✅ Positive Test Cases
Verify the system works correctly when used as intended with valid inputs. These are your "happy path" tests.
Example: Enter a valid email and correct password → user is logged in and redirected to the dashboard.
❌ Negative Test Cases
Verify the system handles invalid inputs, errors, and unexpected conditions gracefully — without crashing or exposing data.
Example: Enter an incorrect password → system displays "Invalid credentials" and does not reveal whether the email exists.
⚠️ Boundary Test Cases
Test behaviour at the edges of acceptable ranges. Bugs love to hide at boundaries — these tests flush them out.
- • Password field: test with exactly 8 characters (minimum) and 64 characters (maximum)
- • Quantity field: test with 0, 1, 999, and 1000
- • Date field: test with today, yesterday, and a date 100 years in the future
🔗 Integration Test Cases
Verify that different modules or services work together correctly. These catch problems that unit tests miss.
Example: When a user places an order, verify that the payment gateway charges the correct amount AND the inventory system decrements stock AND the confirmation email is sent.
Stop Managing Test Cases in Spreadsheets
Try LogicHive Free
Create, organise, and execute test cases with built-in templates and real-time collaboration. No credit card required.
Real-World Test Case Examples
Theory is useful, but seeing real test cases makes everything click. Here are three examples covering different scenarios you'll encounter in practice.
Example 1: Login (Positive)
- Navigate to /login
- Enter "testuser@example.com" in the Email field
- Enter "SecurePass123!" in the Password field
- Click "Sign In"
Example 2: Checkout (Negative)
- Navigate to /checkout
- Enter card number "4111 1111 1111 1111"
- Enter expiry date "01/23" (past date)
- Enter CVV "123"
- Click "Pay Now"
Example 3: Search (Boundary)
- Click into the search field
- Leave it empty
- Press Enter or click the search icon
Test Case Template
Use this template as a starting point for your own test cases. Copy it into your test management tool or spreadsheet and adapt it to your project.
Test Case ID: [PROJECT]-[MODULE]-[NUMBER] Title: [Short, descriptive title starting with a verb] Objective: [What this test validates and why it matters] Preconditions: - [Condition 1] - [Condition 2] Test Steps: 1. [Specific action with exact field names/URLs] 2. [Next action] 3. [Next action] Test Data: - [Field]: [Value] - [Field]: [Value] Expected Results: - [Specific, measurable outcome 1] - [Specific, measurable outcome 2] Actual Results: [Completed during execution] Status: [Pass / Fail / Blocked / Skipped] Executed By: [Name] Execution Date: [Date] Notes: [Any observations or context]
How to Organise Test Cases
Writing great individual test cases isn't enough — you need to organise them so your team can find, execute, and maintain them efficiently. Here's a proven approach:
📁 Group by Module or Feature
Create folders or sections for each major area: Login, Registration, Checkout, Reporting, Admin, etc. This mirrors how your application is structured.
🏷️ Tag by Priority
Mark test cases as Critical, High, Medium, or Low priority. This lets you run a focused smoke test of just Critical cases when time is short.
🔄 Use Consistent Naming
Follow a convention like [MODULE]-[NUMBER] for IDs and start titles with verbs: "Verify…", "Confirm…", "Test…". This makes search and filtering reliable.
📦 Bundle into Test Suites
Group related test cases into suites that can be executed together — e.g., a "Checkout Regression Suite" or a "New User Onboarding Suite".
🔗 Link to Requirements
Map each test case back to a user story or requirement. This creates traceability and helps you spot untested requirements at a glance.
A dedicated test management platform handles all of this automatically — folders, tags, suites, traceability matrices, and version history — so you can focus on testing rather than spreadsheet wrangling.
Frequently Asked Questions
What is a test case in software testing?
A test case is a documented set of conditions, steps, and expected results used to verify whether a specific feature or function of a software application works as intended. It provides a structured approach to testing that ensures consistency, repeatability, and traceability.
What are the main components of a test case?
The main components are: Test Case ID (unique identifier), Title (short description), Preconditions (setup requirements), Test Steps (sequential actions), Test Data (input values), Expected Results (what should happen), Actual Results (what did happen), and Status (pass/fail/blocked).
What is the difference between a test case and a test scenario?
A test scenario is a high-level description of what to test (e.g., "Test user login functionality"), while a test case is a detailed, step-by-step document describing exactly how to test it, including specific inputs, steps, and expected outputs. One test scenario can contain multiple test cases.
How many test cases should I write for a feature?
The number depends on the feature's complexity. At minimum, include positive test cases (valid inputs), negative test cases (invalid inputs), and boundary test cases (edge values). A simple login form might need 8-12 test cases covering valid credentials, invalid passwords, empty fields, locked accounts, and special characters.
Can test cases be reused across projects?
Yes, test cases for common functionality like login, registration, search, and CRUD operations can be templated and reused across projects with minor modifications. Using a test management tool makes it easy to clone and adapt test cases, saving significant time on test case creation.
Conclusion
A test case is the building block of structured software testing. It turns vague intentions ("make sure login works") into specific, repeatable, verifiable checks. Whether you're running UAT or QA testing, well-written test cases are what separate thorough testing from guesswork.
Start with the template above, follow the patterns in the examples, and use a consistent structure across your team. Once you're comfortable with the basics, learn how to write effective test cases that catch more bugs and save time.
Ready to Manage Test Cases Properly?
LogicHive gives you templates, real-time collaboration, and full traceability — so you can focus on testing, not spreadsheets.
No credit card required
Related Articles
How to Write Test Cases: Complete Guide with Templates & Examples
Step-by-step instructions for writing effective test cases, with best practices and common mistakes to avoid.
UAT vs QA: What's the Difference?
Understand the critical differences between UAT and QA testing, when to use each, and how they complement each other.
Test Management Tools Comparison
Compare the leading test management tools and find the right fit for your team's needs and budget.