Test Case (TC) is the most important document prepared in testing activities. It is the base for testing an application. So make sure it is reviewed by all respective stakeholders before actual execution.
What is Test Case?
In simple words, the test case is a set of actions to take to verify if the function of the software application is working as expected.
TCs are designed and executed to find defects in the software application in the early stages. So the defects can be fixed and the quality of software application can be improved.
For this reason, preparing the test case as early as possible in the software development process is preferred.
Usually, testers write the test cases (except Unit Tests which are written and executed by developer). In a typical scenario when developers are developing a software application, testers are designing Test Scenarios, Test Cases and creating Test Data.
Once Development is completed, testers execute the TCs to test software applications.
Main Components of Test Case:
- Test Case ID: the unique value to identify the TC or sometimes to determine the number of TCs.
- Module Name: Module or Function Name which will be tested by TC.
- TC Scenario: A functionality of module to test
- Test Case Name: Unique name for TC to know what it verifies.
- Pre-requisite: any special setup is needed to be done before running TC
- Test Data: the data that needs to be prepared for testing
- Test Steps: describe the steps to perform tests
- Expected Results: expected results from the steps performed above
- Actual Result: usually it will be pass or fail
- Status: After execution, if TC is Pass / Failed or On Hold for some reason
- Comments: This column is used to note related information when performing test cases.
- Test Executed By: Name of the tester who executed the TC
Sample Test Application:
Letxs take a below Test Application
And below is how we can write TCs for Test Scenario of xLogin Functionalityx
You can download the Test Case Template here :
Some Sample TCs:
Here are some sample TCs we can think of for Login Functionality:
- Check the case of only entering the [User ID] field but not the password
- Check the case of only entering the [Password] field but not the [User ID]
- Verify login function for correct input [User ID] and [Password]
- Check the login function in case of incorrect entry 3 times [User ID] and [Password]
- Check the [User ID]/ [Password] input for more than allowed characters
- Verify the case of entering special characters into [User ID]
- Check the input field [User ID] with leading spaces.
- Check the case of [Password] with leading spaces.
- Verify the data displayed in the Password textbox must be a star or dot
- Test if the OK button works as expected
- Verify if Cancel button works as expected
- Verify if Reset button works as expected
What is Test Script
In Automated Testing, testers write code/test scripts to automatically execute tests. Testers will use automation tools to build test scenarios and verify that the software works properly. The goal is to complete the test in a shorter time.
So test script is a set of instructions that will be performed on the application using an automation tool to verify if application functionalities work as expected.
Difference Between Test Cases x Test Scripts
Test Case is a term used in manual testing and a test script used in an automation Testing.
The only difference between these two concepts is, Test cases are written and executed manually, while Test Scripts are full script/code that QA/testers write to execute using a test automation tool.
Bonus Tips:
- Understand the requirements thoroughly and write TCs covering positive scenarios AND negative scenarios for the complete coverage.
- Always make sure you write test cases in such a way that you test only one thing at a time.
- Also, write the TCs in such a way that can be reused for Regression testing or in the next releases.
- Try to identify the Test Data while designing TCs.
I hope you found this document helpful! Please let us know if you have any queries. Happy to help!