We can define test case as a set of steps which the tester writes and then follows to test different scenarios of testing a module or a product. A test case would contain all the steps of an end to end scenario to test a certain behavior or expected output of a product. While thinking about and writing test cases the tester has to unleash his creative as well as the written communication ability to convey what he thinks in the simplest way possible.
A test case should be written in a way that a novice or a first time user who , if, runs the test case is able to reproduce the exact scenario the author of the test case had in his mind while writing the test case. So, while writing a test case the author should assume he is writing this for someone who just knows how to understand the language the test case is written in and knows nothing about the module the test case is being written on. In a way the test cases should be as descriptive as a short novel.
Test cases can be written in a simple word file or even a complex test case management system. There are various tools available in the market to allow the project to track its test cases and bugs. Various enterprises and companies have their in-house developed test case management systems or techniques of writing test cases. I started with writing test cases in a word file format.
There are a few key areas which should not be missed when test cases are written. The most important three things without which the test case is incomplete are:
- Test case Description or describing what this test case accomplishes
- Actions/ Inputs or what user has to do to run this test cases. The author must provide proper steps starting from the first and going on to the last required to run this test case.
- Expected results or what should be the proper output of running this test case. If the actual result or output does not match the expected result then the test case is said to be failed. But, if the actual output is same as the expected output, the test case is said to be passed.
But there is an opposite school of thought also which believes that all test cases need not be detailed in the Actions /Inputs or steps of the test case. According to the previous thought a good test case should have a self explanatory description and an accurate expected results data. But going by this school of thought, these test cases are good but they are good for the testers who are familiar with the product and its working, but for a novice user the traditional definition is the one I vouch by.
Various test case writing templates or methods can be found on the internet , but the one I follow is as follows:
Test Case # | Test Case Description | Actions/Inputs | Expected Results | Actual Results | Status (Pass/Fail) |
Whatever is the product or scenario putting steps in the above template would give you a great test case document.
The goal of writing test cases is not to write them in quantity, I am not saying here that quantity is not important, but quality of a test case should be put before the quantity of test cases. A module can have 50 test cases, which if run will produce more bugs then running 100 test cases of the same module. A test case author should write test cases with free and open minds and let the horses of imagination and possibilities gallop. So, writing test cases is an art a tester must learn to be able to justify the testing done on a product. After you think your test case writing is complete, you should get them reviewed from another person who has the knowhow of the module or the product. Seeking inputs and opinions from another person should not be thought of as a demeaning thing to one's prestige (I am writing this because in real life I have come across maximum number of people who think like this). Rather, seeking another opinion broadens your horizon and points out some of the areas which you probably didn't think of as important or the areas which were blind spots in your mind while you were in the test case writing exercise. So, I suggest, one should get their test cases reviewed after they are complete in your mind. Don't rely only on your opinions.
Happy test case writing.
No comments:
Post a Comment