Guidelines/Best Practice/Tips for writing test cases.
1. Test Cases need to be simple and transparent:
Create test cases which are as simple as possible. They must be clear and concise as author of test case may not execute them.
Use assertive language like go to home page, enter data, click on this and so on. This makes the understanding the test steps easy and test execution faster.
2. Create Test Case with End User in mind
Ultimate goal of any software project is to create test cases that meets customer requirements and is easy to use and operate. A tester must create test cases keeping in mind the end user perspective
3. Avoid test case repetition.
Do not repeat test cases. If a test case is needed for executing some other test case , call the test case by its test case id in the pre-condition column
4. Do not Assume
Do not assume functionality and features of your software application while preparing test case. Stick to the Specification Documents.
5. Ensure 100% Coverage
Make sure you write test cases to check all software requirements mentioned in the specification document. Use Traceability Matrix to ensure no functions/conditions is left untested.
6. Test Cases must be identifiable.
Name the test case ids such that they are identified easily while tracking defects or identifying a software requiremnt at a later stage.
7. Implement Testing Techniques
Testing techniques must be used for effective testing.
Suppose you encounter a scenario to test a good deal of values. In such a case apply both Boundary Value Analysis and Equivalence Partitioning techniques. This will aid in covering a good range of value and avoid unnoticed defects.
In case Application has many pages/integrations then create test cases for each State Change by implementing the State Transition Technique.
8. Peer Review.
After creating test cases, get them reviewed by your colleagues. Your peers can uncover defects in your test case design, that you may easily miss.