Helpful Tips for Writing Effective Test Cases
This is the second article in the series of our articles about test cases. In this article, we are sharing some Helpful Tips for Writing Effective Test Cases
The main activity of the Software Tester is to write test scenarios and test cases for testing. Few important factors are related to this activity. Let us have a look at those factors first.
1. Keep the test cases simple
Keep all the steps of test cases atomic and precise. Produce test cases that are as simple as possible. Test cases should be clear and concise as the writer of the test case may not execute them.
2. Review Test cases after writing
When you have written all test cases, review at least once critically. Make sure test data specified in test cases is feasible for testers and relates to the real-time environment. Verify that all the references to other test cases and artifacts are exact.
3. Be a Contributor
Being a software tester, never hesitate to contribute to business and give suggestions if you feel that application needs improvement.
4. Never Forget the End-User
The most important stakeholder is the ‘End User’ who will finally use the application. So, never forget him at any point of test case writing.
Page Break
5. Avoid Test Case Repetition
Do not repeat test cases. When a test case is needed for executing some other test case(s), mention the test case by its test case ID in the pre-condition column.
6. Ensure Maximum Coverage
7. Confirm that you write test cases to check all software requirement(s) specified in the specification document. Use Traceability Matrix to make certain no functionality is left unverified.
8. Test Cases must be Classifiable
Name the test case ID that is easy while tracking defects or classifying a software requirement later.
9. Implement Different Testing Techniques
It’s very hard to check every possible condition in the application under test. Software Testing techniques help you select a few test cases with the maximum prospect of finding a defect.
Ø Boundary Value Analysis (BVA): This technique defines the testing of boundaries for a specified range of values.
Ø Equivalence Class Partition (ECP): This technique partitions the range into equal parts or groups that are inclined to have the same behavior.
Ø State Transition Technique: This technique is used when software behavior changes from one state to another resulting in a particular action.
Ø Error Guessing Technique: In this technique, you guess the error that may arise while doing manual testing. This is not a recognized method but takes adv of a tester’s experience with the application.
10. Do not forget to Cover the Negative Cases
A negative case is as important as a positive case. Make sure that you have two test cases for each scenario: Positive & Negative. The positive one should cover the intended or normal flow and the negative one should cover the unintended or exceptional flow.
Page Break
11. Write Atomic (Small) Test Steps
Each test step should be an atomic one. There should not be any further sub-steps. The simpler a test step is, the easier it would be to proceed with testing.
12. Prioritize the Tests
We often have tough timelines to finish up testing for an application. Here, we may miss testing some of the main functionalities and features of the software. To avoid this, add a priority with each test while writing it.
13. Sequence of Test Case Steps Matters
Confirm whether the sequence of steps in the test case is correct. Preferably, the steps should also define the entire sequence from entering the application until exiting the application for a particular scenario that is being tested.
14. Add Timestamp and Tester’s Name to the Comments
It is always better to add a timestamp with the tester’s name in the testing comments so that a test result (pass or fail) can be credited to the state of an application at that particular time. Otherwise, you can have an ‘Executed Date’ column added separately to the test case, and this will explicitly identify the timestamp of the test.
15. Add Browser Name and Version
When you are testing a web application, test results can differ based on the browser on which the test is executed. For the ease of other testers, developers, or whoever is reviewing the test cases, should add the browser name and version to the test case so that the defect can be reproduced easily.
Page Break
We’ve written this article to give you the foundation and a basis to avoid mistakes in writing test cases. Check out our series of articles to know more about test cases and share your views in the comments!