A set of input values, execution preconditions, expected results and execution post conditions, developed for a particular objective or test condition, such as to exercise a particular program path or to verify compliance with a specific requirement
Above is the definition from official ISTQB glossary, but in a simple term test case is a set of conditions which a tester use to determine whether a system under test satisfies requirement. Test cases help to find problems in requirement or the design of the application.
Test case template
Test case template can be vary from different companies. However the basic items/section would remain same. Below are some of the basic items you may find in a test case document.
- Test Case ID: Identification number used to identify the test cases.
- BR Number: Business Requirement number, this will map with the corresponding requirement on the requirement / Spec document.
- Prerequisites: Any preconditions that must be fulfilled prior to executing the test.
- Test Steps: Step by step procedure to execute the test.
- Test Data: Relevant test data which needs to execute the test case.
- Expected Results: Expected result of the test case.
- Actual Results: Actual result of the test ( To be filled after the test )
- Test Status: Status of the test – Could be ‘Not started’ / ‘Pass’ / ‘Fail’ / ‘Blocked’
- Executed By: Name of the person who performed the test
- Test Environment: Environment which test was executed
- Remarks: Any special notes with regard to the test case / or the test execution
How to write a good test case
- Ensure all the positive / negative test scenarios.
- Write in simple language.
- Use the exact names in the Web forms / Web screens / Windows forms
Good characteristics of a good test case
- Accurate – On point, It says what it does
- Traceable – It maps with the requirement document, So when in doubt it can be traced back.
- Repeatable – Can be used to perform over and over