How to Write a Test Case
Consider whether a test case already exists., Know the characteristics of a good test case., Consider the different scenarios possible before writing., Give your self sufficient writing time.
Step-by-Step Guide
-
Step 1: Consider whether a test case already exists.
Before writing a new test case for your module, find out whether there are already existing test cases that test the same component.
This can be a real time saver! If you do find existing test cases, consider updating test case, rather than writing a new one. -
Step 2: Know the characteristics of a good test case.
Being aware of what constitutes a good test case will help you write a better and stronger test case.These characteristics include:
Accuracy:
The test clearly articulates the purpose.
Tracing:
The test is capable of being traced to requirements.
Repetition:
The test can be used to do the test as many times as necessary.
Re-usability:
The test be reused if necessary.
Independence:
Every test case you write should be able to be performed in any order, without any dependency on other test cases.
Concision:
The description of a test case should be simple and clear and have no extraneous steps or words.
A tester should be able to understand it by reading it one-time over.
The description should use action words, like "do 'x'" and "do 'y'."
Concentrate on what could happen with the product when being used by a customer.
Think about this carefully and design your test(s) accordingly.Scenarios should be concise.
The goal of a test scenario is not to provide a lot of specific details, but to instead convey a specific idea about testing a particular case. , Because scenarios and cases form the base for future test cases and testing, you need to give yourself enough time to write a quality test as well as time to have the procedure thoroughly reviewed. -
Step 3: Consider the different scenarios possible before writing.
-
Step 4: Give your self sufficient writing time.
Detailed Guide
Before writing a new test case for your module, find out whether there are already existing test cases that test the same component.
This can be a real time saver! If you do find existing test cases, consider updating test case, rather than writing a new one.
Being aware of what constitutes a good test case will help you write a better and stronger test case.These characteristics include:
Accuracy:
The test clearly articulates the purpose.
Tracing:
The test is capable of being traced to requirements.
Repetition:
The test can be used to do the test as many times as necessary.
Re-usability:
The test be reused if necessary.
Independence:
Every test case you write should be able to be performed in any order, without any dependency on other test cases.
Concision:
The description of a test case should be simple and clear and have no extraneous steps or words.
A tester should be able to understand it by reading it one-time over.
The description should use action words, like "do 'x'" and "do 'y'."
Concentrate on what could happen with the product when being used by a customer.
Think about this carefully and design your test(s) accordingly.Scenarios should be concise.
The goal of a test scenario is not to provide a lot of specific details, but to instead convey a specific idea about testing a particular case. , Because scenarios and cases form the base for future test cases and testing, you need to give yourself enough time to write a quality test as well as time to have the procedure thoroughly reviewed.
About the Author
Theresa Hart
Professional writer focused on creating easy-to-follow home improvement tutorials.
Rate This Guide
How helpful was this guide? Click to rate: