There are certain documents which should be developed before and during software testing. This is known as Testing Documentation. This section describes Test Case Documentation.
A test case is a set of actions which a tester carries out to verify a particular functionality of a software application. This helps to ensure that the software is bug free and end-user requirements are fulfilled.
Usually, the QA team is responsible for writing test cases except unit test cases which are written by the development team.
- Ensure 100% coverage
- Avoid repetition
The main purpose of writing test cases is to verify that all features of a software application are working as expected. Other benefits of having test cases include;
- Ensure that software meets the end user requirements
- Improve quality of software
- Anyone can refer and execute the test
- Reduce maintenance and software support cost
Before writing a test case you should consider following facts.
- Check whether the test case already exists. If yes, update it.
- Consider all the different scenarios possible.
- Give yourself enough time to write test cases.
Steps to write test cases
- Test case ID - A test case should have ID so that it can be identified easily.
- Test case description - This tells what the tester is going to test in brief.
- Test steps - This is about how to execute the test. Test steps should be clear, brief and include essential facts.
- Test data - In order to execute the test case, the tester would need Test Data.
- Expected result - This helps tester what is the perfect behaviour of the test case.
- Actual result - This includes the actual behaviour while the test cases were being executed.
- Status of the test - After check the actual result against expected result, assign Pass or Fail status
- Comments - Here the tester can include any useful information such as issues, attachments etc.
Here’s a sample test case for checking login functionality. Both positive and negative test cases should be included in testing.
- Write test cases such that others can understand easily and modify if required.
- Create test cases keeping in mind the end user perspective.
- Write unique test cases and avoid irrelevant and duplicate test cases.
- Use testing techniques.
- Use correct test case ID.
As a part of Test Documentation, Test Cases play an important role. Finally, writing test cases is nothing but you must have best practices.