Writing effective test cases is as important as testing is concerned. They help in finding the difficult bugs and make test coverage maximum. To write effective test cases, first and foremost thing is to understand the software application very clearly. Test case writing should be started as soon as the development of the software. In this article we will discuss some of the points to remember for writing effective test cases but first let’s understand what is a test case and why do we write test cases.
What is a test case?
Test case is set of activities with expected and actual results executed in sequence to validate the feature of an application. Test case is the document and is designed by the tester based on the SRS document and Use case document.
Definition by Wikipedia: Test case
Test case is a component which has pre condition, steps to execute or actions to perform and expected results according to the requirements given for a particular software application. We write test cases to verify that software works as per the user expectations as well as the business requirements. There are various level of testing, and each of them has test cases.
Effective test cases are those test cases which have maximum test coverage but are minimum in numbers. There is no point writing 1000 of test cases when only 500 is needed. To write or choose the effective test cases is a skill which comes with experience. Below are my top tips to follow when you are designing test cases for an application to make the testing effective.
Tips On Writing Effective Test Cases:
- In- depth study of the documents / requirements is the most important step in writing effective test cases. Before starting test case design, go through all the requirements given in SRS and FRD documents and review them. If you find something doesn’t seem right, make it clear with the client or senior managers so that ambiguity in test cases can be avoided.
- Update cases / results according to the real behavior when you get the real software to test. Test case design starts with the development but when software is ready for testing, it gets some real time difference from what was given in the requirements so you have to update the test cases or expected results accordingly.
- Delete irrelevant test cases whenever there is any requirement changes or if an old feature is replaced with the new one. This will make test cases more organized and you will have all the relevant test cases with you. This will avoid any confusion and extra effort if any new tester execute them.
- Merge similar scenarios to make a better test case. For example. If an application has two text box say username and password and login button, instead of making two different test cases for each of them, it can be merged into one. Here we are looking for quality of test cases not the quantity.
- If possible refer to parent product and analyze the previously logged defects and make them into test cases. In this way you will have the most difficult and prone to error scenarios. It is always beneficial to refer the parent product or similar software for more and different cases.
- Go beyond the requirements and think from different user’s perspective to get the better idea of the usability of the software and out of the box testing scenarios. While writing SRS and FRD, most of the data comes from general scenarios. It is not possible to cover all the cases in the documents. Tester who can use the software from user’s perspective can find the small details which may annoy users and may not be useful for them. In this way you will make your software more usable and of higher quality. Include such scenarios in your test cases.
- Automate repetitive test cases like regression or sanity tests. This will not only save your manual efforts but also time. Whenever a new change or fix is introduced into the software, you have to make sure that it did not affect any old functionality by running regression tests every time. You can use any automation tool to automate regression tests.
- Exploratory or random testing is very important since you can find many defects which are not listed in requirements and hence, convert them into test cases to make test cases more effective. In some cases while UAT, user stories have really good scenarios for testing and it is a good practice to convert them into test cases.
Writing effective test cases is a process, you have to make modifications and include new scenarios while testing is in progress. Test procedure is nothing but a series of execution steps to follow for testing a particular module. Same tips applies when it comes to writing effective test procedures or definitions since UNDERSTANDING is the key here. It includes understanding of the requirements as well as the behavior of the software and proceed with the testing accordingly. If you have anything more to add here then feel free to add in the comments below. This might help other testers out there.
While writing test cases keep in mind that you are covering all types of testing like functional testing, boundary value test cases, negative test cases etc. Make sure that you are writing test cases as simple as mentioned in the “Tips/Guidelines for writing test cases”. Write the test cases to the point, don’t try to add unnecessary steps in test case which leads to problems other tester while executing the cases.
Generally I prefer excel to write down the test cases in format given in the above link. You may use test management tools for writing test cases like HP ALM/Quality center, Zephyr, Testuff, TestLink, QAComplete, qTest, QMetry, PractiTest etc.
If you have query on test case writing or execution then feel free to comment below.
If you are not regular reader of this website then highly recommends you to Sign up for our free email newsletter!! Sign up just providing your email address below: