What is a Test Case?
A test case is a set of procedures, conditions, executions, and expected results verifying the software compliance with the requirements.
It is ideally prepared by testers at the early stage of the development cycle which helps to identify the issues in the requirements or design of the software as it requires a complete understanding of the software’s process.
Testing the software with test case lets you detect bugs and determine if the software will pass or fail. This can be achieved by choosing the types of test cases to be implemented. These are:
- Functional – the process of testing the software’s behavior for each functionality and also includes the input and output.
- Structural – it focuses on evaluating from the source code that ensures to cover the program structure on the developed test cases.
- Erroneous – the created test cases applied are invalid inputs or executions to know the result and determine what is wrong with the software.
- Stress – it verifies the performance of the software functionality while loading other heavy processes such as extensive queries, repeated inputs or actions, etc.
- Scripts – it validates a set of instructions performed and determines the expected result of the software.
- Use Cases – it describes the processes or scenarios to perform.
How to Write a Test Case?
Basically, the tester creates the test case in test worksheet and should specify all the possible scenarios for each case with the right and wrong execution. Writing a test case covers the objective of the test case, conditions, steps to perform, necessary inputs, expected result, actual result and notes from the tester. A decision should be made at the end of each test case to determine if it passes or fails.
Recommended processes in creating a test case are as follows:
- Determine the amount of test resources to be allocated like the test data tool and develop a process that will help save time throughout the development.
- Specify all the possible test conditions.
- Identify the priority of test condition. High-priority should be tested first.
- Select the test condition to be tested based on the priority of test condition.
- Determine the correct result of each test case process.
- Decide the method of creating a test case: key entry, test data generator or input form which will be given to user.
- Provide documents containing the test cases and test result.
- Perform test.
- Verify the test and ensure the correctness of the software.
Example: Test Case for a typical login module
Control Number
|
Action
|
Objective or Explanation
|
Expected Results
|
Pass
|
Fail
|
1
|
Blank Username or/and Password fields. |
To determine if the login module will allow to access the member’s page with blank fields. |
A validation message should be prompted – should complete the fields. |
||
2
|
Enter invalid characters on Username field. |
To determine if it will accept invalid characters on Username field. Special characters or symbols are invalid (e.g: “”_*&!) |
A validation message should be prompted and will enable focus on Username field.
|
||
3
|
Enter the allowable limit characters of Password field. |
To validate the allowable limit characters of Password field. Minimum of 6 characters. |
If the entered characters are less than the minimum required, a validation message should be prompted. It should focus and clear the inputs on the Password field. |
||
4
|
Enter incorrect password thrice for valid user. |
To secure the account when attempting to input incorrect password for valid user. |
If the attempted entered password is still incorrect on the 3rd time, a validation message should be prompted – the account would be blocked and requires for reactivation. |
||
5
|
Complete Username and Password fields. |
To verify if the entered username and password is valid. |
If the account details entered does not exist, a validation message should be prompted and redirects to Sign-Up page. Otherwise, it should redirect to Member’s page. |
You have explained Test Case nicely. I would like to add that a test case is a written document which contains set of steps that are carried out on the software to verify its functionality to certain sets of inputs.
It is correct that a model Test Case should have ‘Control Number, Action, Objective or Explanation, Expected Result, Pass, Fail’information. Should I also include ‘Steps Needed” to make clear ‘Action’ column?
Thanks & regards,
Azam
NY, USA