Simple mantra you must follow when you write test cases - think that you are giving instructions to test the software, to an 8th grade kid. The kid knows English and knows how to operate computer; but does not know anything on how to test your application.
Is it really possible to make a kid to test my application? Yes it is, provided the instructions are clear and simple. Have you ever called a customer support help desk to resolve a problem in your laptop? You might have observed that the help desk person asking a series of simple short questions and solving your problems in minutes. The trick is clear and simple document. Look at this following example.
- Open firefox browser.
- Navigate to www.openmentor.net
- Click on Word Games link.
- Click on the link that says "Click Here to start"
- Choose 4 from the list box shown.
- Click Go.
In the industry, a test case is written in a document or in a spreadsheet with the following details.
Test case Id: A unique identifier for this test case, across the project or company.
Test case name: Usually this will be the test condition that you wrote before.
Pre-condition: The pre-requisite that must exist before we do this test.
Test Steps: Simple step by step such as clicks, types, navigation etc to carry out the test.
Test Data: The data yo must choose or type in any forms.
Expected Results: What is the expected outcome when we do these steps with the given data.
Usually people ask me this question - why should we write this much, when I know how to do it? Remember, you or any other person in the project, may be moved to a different project tomorrow. In that case, should other person re-invent the wheel? So better put all the things you remember in testing this product, in a paper. Also, you be the thinker that adds more value; let the test execution be done by other juniors. It also helps in assessing whether we have missed any permutation or combination in testing. If everything is just remembered by you, no one knows how many tests you remember and how many you do not. So better to document every test case.
Writing test cases will take more time. Agreed. But it is usually for one set of test cases; after that, you copy-paste the same text and make modifications in steps or data and expected results. It is not usually all text in all test cases are typed fully by you. Once a pattern of test is identified and typed, rest is all making minor modifications to that text.
In the next posting, we will see examples of test cases and a few techniques like boundary value analysis etc.