Test Case

A set of input values, execution preconditions, expected results and execution postconditions, developed for a particular objective or test condition, such as to exercise a particular program path or to verify compliance with a specific requirement.

Present in sylabi

Example usage

A test case for a login form with a maximum password length of 16 characters could look like this: preconditions — the account exists and the browser is on the login page; input values — username jdoe, password of exactly 16 characters; expected result — successful login and redirect to the dashboard; postconditions — the session is created. A second test case with a 17-character password expects an error message. Each test case is written for a specific objective, such as exercising a particular program path or verifying compliance with a requirement.

FAQ

What is the difference between a test case and a test scenario? A test scenario is a document specifying a sequence of actions for executing a test; a test case is the specific set of input values, preconditions, expected results, and postconditions developed for a particular objective. Several test cases can be derived from one scenario.

Do test cases always need expected results? Yes — an expected result is what makes a test case verifiable. Without it, you cannot distinguish a pass from an inconclusive run.

What is a test set? A test set is a group of test cases where the postcondition of one test often becomes the precondition of the next, creating a chain of executions.

Are test cases only used in manual testing? No. Automated tests are also organized as test cases — the script implements the inputs, preconditions, expected results, and postconditions programmatically.

Learn more

How To Write a Test Case - Katalon
Best practices for writing good test cases including naming conventions, action verbs, preconditions, negative scenarios, and regular updates

Test Case vs Test Scenario
Detailed comparison explaining that test scenarios are high-level descriptions covering multiple test cases, while test cases focus on specific steps and expected results

Test Case Templates: Free Excel & Word Examples
Comprehensive test case templates with 20 standard components including Test Case ID, Title, Objective, Preconditions, Test Steps, Expected Results, and more. Includes best practices for writing effective test cases. Formats: PDF, DOC, Excel

Recommend more content related to this term