One of the difficulties in writing your first test case is that it’s hard to know where to start. Writing test cases is not that difficult if you understand who you’re writing for and what you’re hoping to achieve.
What’s the purpose of a test case?
The purpose of a test case is to:
Describe how you plan to verify (i.e. prove) that the software agrees with the specifications.
The next step is to demonstrate that you’ve done this correctly and haven’t modified the findings or changed the result data.
Ideally, when you finish writing the test case, you can give it to someone else, e.g. tester or developer, and they can do the testing with the test case you wrote.
Writing your first test case
Here’s how to keep you test cases practical and effective:
- Test Case Description – Identify the information necessary to verify the functional requirements.
- Requirement Traceability – Cross-reference to the number in the specification (SRS) document.
- Purpose – Describe the software features that will be tested; the behavior being verified, for instance, when you click A, B occurs.
- Procedure – Describe how to perform the test. Keep the text simple and make sure the reader doesn’t ‘interpret’ what you’ve written. For example, “Click the Save button on the menu to save the document.”).
- Test Data – Include the exact input data that will be provided and the output for each case. Include any manual calculations necessary to determine the outputs.
Formatting your test case
You can use either Microsoft Word or Excel. I suggest that you use tables to structure the data and make it easier to read.
- Represent test data in tabular form
- Create one column for input items and
- Create one column for expected outputs
If the input data is held in an external file, identify the file name and its location.
What else would you add?