I got this question yesterday on Twitter! “Why do you write test cases?”. It made me think, do we really need test cases to test an application or system? I was always told to create the test cases first, review it thoroughly to ensure that all possibilities are covered, and then proceed with the testing. But why should we do it? What are the benefits and would I really mess it if I start testing without test cases?
To me, test cases for testing is more like the shopping list is for shopping!
Here are the reasons why?
- You don’t need one, but there is a chance that you might miss a few!
- You can go shopping very well without a shopping list, as long as you know what to buy. But there is a chance that you might miss something that you ought to buy. Similarly, you can start testing without the test cases but if it’s a large set of features to validate, you might miss a few if you don’t have a checklist.
- Take time to think through what to buy rather than a hasty decision that you regret later
- For creating a shopping list, you go around the house, look at what should you buy, take time to think through what items and where to buy. This gives you enough time to make the right decisions rather than on the shop floor. Same way, taking time to think of what you will be testing and how will save time while testing.
- Plan better
- By knowing what you need to buy, you can plan better on which aisle to start from, where to go next and how to get to checkout. You won’t end up going from aisle 1 to 20 and then come back to fetch something you missed. Test cases work the same way, by knowing what you will be testing in advance, you can plan your tests and day.
- Know when you are done! Avoid revisits.
- With a clear list of items, you know when you are done shopping. It helps you avoid unnecessary immediate revisits. Test cases will tell you when to stop testing and avoids retests.
- The format differs based on individual’s need and preference
- It can be as simple as “Veggies” or can be very specific on the product, brand, and size, etc. Same way, test cases can be a simple checklist with a brief summary or it can be exhaustive procedural steps based on user needs.
- No restrictions
- Even with a shopping list, you are still free to walk around the aisles and buy what you like without restrictions. Similarly, the testers can perform ad-hoc tests based on their intuition on top of the planned test cases.
- If you buy the same things every time, you don’t need a shopping list
- If you visit the same shop and buy the same things every time you don’t need a shopping list. Already you know where each item is specifically and follow your usual routine. Same way, for testers who are expert on the application, and testing it for some time know by their experience what to test, and where to look for bugs.
Fully defined test cases are not always a necessity, but spending some time to think through what you will be testing and making even a simple checklist to cover all bases will help you plan your testing better!
Let me what do you think about the necessity of test cases in the comments.
For more information and the latest updates on test automation, follow me on Twitter @testingchief or subscribe to testingchief.com.