Although executing test cases is a less difficult and less time consuming task but preparing test cases is great challenge for the software testers when testing a software application or device. It is the tester by whom the quality of the product is maintained by monitoring each and every software application and device so that there is not point of failure in the quality.
All these can be maintained by preparing nice and proper test cases according to test plan or requirements of the clients. But apart from this, a new learning tester should know the first most important part that is how we can lay a path to write test cases for any sort of requirements like what are the basic steps and necessity to start up with while preparing our test cases.
Let’s focus on this aspect rather than getting indulges in how to plan and write the test cases. Before getting started we should understand,
“What is a Test Case?”
A Test Case is a simple action you can say like variables or conditions designed or created to test a particular feature of a software application or device for its functionality check under correct and wrong actions.
When it comes to writing a test, case then there are twelve steps to follow. These twelve points can help you a lot to write effective test case at an early stage of practicing.
Your Test Cases must contain the following items:
- TEST CASE ID
- MODULE NAME
- TEST SUMMARY
- TEST DESCRIPTION
- TEST DATA
- TEST ENVIRONMENT
- STEPS TO FOLLOW
- EXPECTED RESULT
- ACTUAL OUTPUT
- STATUS (PASS/FAIL)
Although this is a simple first step that individual should follow is naming their test case according to their requirement or what they are planning to start or test with.
For your better understanding we can take a Login page example of any website so that I can easily able to enlighten you.
Actual format for writing Test Case ID is:
TC: resembles Test Case (TC)
LOGIN: resembles module name being tested
001: resembles serial number of the test so that we can easily identify when needed.
2) MODULE NAME
I believe these two words simply make you aware that what we will be going to talk about the first is type of Module and second is its name to be assigned for your test case.
According to Login Page example your module name can as:
Module Name: LOGIN
3) TEST SUMMARY
In test summary we are just trying to verify the functionality of a module according to a test case created for it.
Let’s make it clear with the example below:
- VERIFY LOGIN FUNCTIONALITY WITH VALID LOGIN CREDENTIALS
So above is a one line test case comments we have generated to test a particular feature of a module. Here we are trying to make you understand that you can check login functionality of any website page by providing valid or correct input details for your login for the homepage of our desired website.
4) TEST DESCRIPTION
Test Description is a detailed description of your test so that we can get an idea what will happen after we provide proper login rights to the login page.
- ENSURE THAT USER SHOULD BE ABLE TO LOGIN TO THE APPLICATION BY PROVIDING VALID LOGIN CREDENTIALS
While providing proper detailed description in test description its make easier to know what will happen and what is the main motto or agenda of the test for a particular module working with.
5) TEST DATA
The name test data can be easily understood because Test indicates what to test and Data indicates inputs, values, etc. So, we can imagine that we are planning to test feature functionality by assigning proper test inputs.
- VALID USERNAME AND PASSWORD
So your required test data will be valid username and password for your login.
Priority means how fast we can fix a bug/defect when arise. It indicates the levels of priority according to which we can easily confirm which bug has to fix fast or earlier while focusing on priority levels.
Priority levels are such as: P1, P2, P3, P4, and P5
P1 –> (most important)
P2 –> (least important)
Let’s see the priority level with our Login Page example:
As priority level for Login Page is P1 which higher state level, so your main focus should be on fixing this type of bug first.
7) TEST ENVIRONMENT
Test environment tells you in which software or hardware environment you are working to create, test and run your test cases.
- WINDOWS XP SP2 WITH IE 6.0, MOZILLA FIREFOX, GOOGLE CHROME, SAFARI, OPERA
If you are working on these particular window and browsers then you can describe them as per your test environment. It actually depends on your working environment.
Prerequisite is the pre-condition that need to be focused when you execute your test cases.
- VALID USER SHOULD EXIST IN THE APPLICATION
9) STEPS TO FOLLOW
In this particular step, we generate a valid path to test the feature according to a test case by simply creating a few lines to steps.
Check with the following example:
Steps to Follow:
- ENTER THE URL OF THE APPLICATION IN ADDRESS BAR OF THE BROWSER AND CLICK GO BUTTON.
- ENTER USERNAME IN THE USERNAME TEXT FIELD.
- ENTER PASSWORD IN THE TEXT FIELD.
- CLICK SUBMIT BUTTON TO LOGIN TO THE APPLICATION.
Above are the four steps that you can follow to execute your test case.
10) EXPECTED RESULT
This step describes your desired output value that to be represented.
- USER SHOULD BE LOGGED INTO THE APPLICATION AND HOMEPAGE SHOULD OPEN UP.
11) ACTUAL OUTPUT
This option gives to your actual executed output for a test case.
When you got your test case executed and got passed then
- USER IS DIRCTED TO HOMEPAGE.
12) STATUS (PASS/FAIL)
This option is pretty much simple as the name represents Status which means final results which can be measured in pass or fail reply.
In status option, we usually check or execute our test cases on different browsers to check whether they are compatible or not. If it shows with fail status, then we further decide which type of bug is this and send for enhancement to the development team.
You can also show your status in colors like: green (pass) and red (fail) which ever you like.
So, these were the required twelve steps that can be followed while preparing test cases for your requirements.
Writing best test cases is the aim of every software tester but without knowing the basics to start up, he/she cannot attain success in his/her work.
Hope that you may also follow these basic steps as a guideline and will be able to solve your issues. You can share your views about how it goes in the comment section below. We would love to hear your experience and resolve your queries.