How to Design Test Cases
March 3, 2019
How to Design Test Cases
Welcome to this Post – ” How to design Test Cases?”.
This post discusses about the “How to design Test Cases?”. We will focus on general definitions- Test Basis, Test Conditions; what factors lead to good test cases plus see examples on principles to completely grasp the concept.
So, go ahead and enjoy reading…
Before we start deriving test cases for some scenario it is important to understand some basic concepts first which are test basis and test conditions.
What is a Test Basis and Test Conditions?
Test basis is any document system requirement or a technical specification which provides a base for tests.
For example: a system requirement is good point of start to analyse what can be set as a basis of all tests.
Test conditions are the conditions or sub-requirements on the basis of which a particular test can be performed.
For example: if we need to measure some code that might include branches, then the conditions of tests must also include Boolean conditions i.e. True or False to establish good tests.
Now the next step is to study the document- whether system requirement, technical requirement, functional requirement, etc , identify the test conditions and pick up the most suitable, prioritized scenarios from them. And later for each scenario identify as many test cases possible. So Test Case can be defined as a set of actions or steps executed(called test steps) to verify a particular feature or functionality of the software application.
As per IEEE the test case document should indicate the following:
Name | Description |
Test case specification identifier | test case number |
Output specifications | expected output |
Test items | actual test cases |
Environmental needs | where and which environment is the target |
Input specifications | Actual inputs |
Special procedural requirement | Any special requirement for this test |
Intercase dependencies | Any dependencies on different test |
How Test Case differ from Test Scenario?
Test scenarios are more generalized statements and cover a wide range of possibilities. On the other hand, Test cases are more specific in nature as they indicate lot of information for a single scenario.
Sample Excel Template with Examples
Example 1: Lets take an example for a website where Login Functionality needs to be tested.
There many possible test cases in this case:
Test Case 1: Check results on entering valid User Id & Password
Test Case 2: Check results on entering Invalid User ID
Test Case 3: Check results on entering Invalid Password
Test Case 4: Check response when a User ID is Empty & Login Button is pressed
and many more
Conclusion:
So lets wrap it up, by denoting which steps are part of industries best practices. Below are the Best Practice for writing good Test Case:
-
- Test Cases should have identifiers.
- Test cases should indicate which requirement they are pointing to.
- Test cases should indicate clearly which test procedure should be taken and mention if there are some specific requirements.
- Test cases description should be simple and easy to follow.
- Avoid any test case to be repeated. In case there is a dependency you can mention that ID of previous test case and continue with current one with new steps.
- Never assume any functionality and features of your software application, always refer to specifications.
- Testing procedures should be used or Test Techniques should have clear purpose. Below listed Software Testing techniques help to select a few test cases with the maximum possibility of finding a defect.
1). Boundary Value Analysis (BVA): -defines the testing of boundaries for a specified range of values.
2). Equivalence Partition (EP): – defines partitions the value range into equal partition or groups that tend to have the same behaviour.
3). State Transition Technique: – is used when software behaviour changes from one state to another following particular.
4). action. Error Guessing Technique: – allows anticipating the error that may arise while doing manual testing.
- Peer Reviews can uncover defects in your test case design, which you may easily miss. Thus, it is final and important step.