Difference between revisions of "DEFAULT DATA"
(Created page with "<div id="content_view" class="wiki" style="display: block"><span style="font-size: 14px">.........................................................................................") |
|||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | <div id="content_view" class="wiki" style="display: block"><span style="font-size: 14px">.................................................................................................................[ | + | <div id="content_view" class="wiki" style="display: block"> |
− | =<span style="font-size: 16px">Pattern summary</span>= | + | <span style="font-size: 14px">.................................................................................................................[[Main Page]] / Back to [[Design Patterns]] / Back to [[Test Automation Patterns]]</span> |
+ | =<span style="font-size: 16px">'''Pattern summary'''</span>= | ||
<span style="font-size: 16px">Use default data to simplify data input</span> | <span style="font-size: 16px">Use default data to simplify data input</span> | ||
− | =<span style="font-size: 16px">Category</span>= | + | =<span style="font-size: 16px">'''Category'''</span>= |
<span style="font-size: 16px">Design</span> | <span style="font-size: 16px">Design</span> | ||
− | =<span style="font-size: 16px">Context</span>= | + | =<span style="font-size: 16px">'''Context'''</span>= |
<span style="font-size: 16px">This pattern is useful when test cases need a lot of common data that is not all meaningful for the specific test.</span> | <span style="font-size: 16px">This pattern is useful when test cases need a lot of common data that is not all meaningful for the specific test.</span> | ||
− | =<span style="font-size: 16px">Description</span>= | + | =<span style="font-size: 16px">'''Description'''</span>= |
<span style="font-size: 16px">Instead of cluttering test cases with data that is needed, but is not relevant for the specific test, use default data. </span><br /> <br /> <span style="font-size: 16px; line-height: 24px">For example, if you are interested in testing validation for a Name field but don't care about the contents of the address or phone number fields, set up a default value for the address ("123 Main Street") and phone number. Then in your test, you will say what the Name field should contain, but not what the other fields should contain, so your framework will copy the default values (because if they were left blank, the test would fail) to those fields.</span> | <span style="font-size: 16px">Instead of cluttering test cases with data that is needed, but is not relevant for the specific test, use default data. </span><br /> <br /> <span style="font-size: 16px; line-height: 24px">For example, if you are interested in testing validation for a Name field but don't care about the contents of the address or phone number fields, set up a default value for the address ("123 Main Street") and phone number. Then in your test, you will say what the Name field should contain, but not what the other fields should contain, so your framework will copy the default values (because if they were left blank, the test would fail) to those fields.</span> | ||
− | =<span style="font-size: 16px">Implementation</span>= | + | =<span style="font-size: 16px">'''Implementation'''</span>= |
<span style="font-size: 16px">Prepare default data. Your [[TEST AUTOMATION FRAMEWORK]] substitutes default data for missing data during the data inputs in the test cases </span> | <span style="font-size: 16px">Prepare default data. Your [[TEST AUTOMATION FRAMEWORK]] substitutes default data for missing data during the data inputs in the test cases </span> | ||
− | =<span style="font-size: 16px">Potential problems</span>= | + | =<span style="font-size: 16px">'''Potential problems'''</span>= |
<span style="font-size: 16px">Default values should be valid, but there may be combinations of other values that make a normally valid value invalid.</span><br /> <span style="font-size: 16px">You may end up with a lot of people living at the same address… ;-)</span> | <span style="font-size: 16px">Default values should be valid, but there may be combinations of other values that make a normally valid value invalid.</span><br /> <span style="font-size: 16px">You may end up with a lot of people living at the same address… ;-)</span> | ||
− | =<span style="font-size: 16px">Issues addressed by this pattern</span>= | + | =<span style="font-size: 16px">'''Issues addressed by this pattern'''</span>= |
− | ''<span style="font-size: 16px">[[CREEP]]</span>'' | + | ''<span style="font-size: 16px">[[DATA CREEP]]</span>'' |
− | =<span style="font-size: 16px">Experiences</span>= | + | =<span style="font-size: 16px">'''Experiences'''</span>= |
− | <span style="font-size: 16px">Thanks to Richard Bradshaw, whose pattern DATA BUILDER inspired this one.</span><br /> <br /> <span style="font-size: 16px">If you have used this pattern, please | + | |
+ | <span style="font-size: 16px">Thanks to Richard Bradshaw, whose pattern DATA BUILDER inspired this one.</span><br /> <br /> | ||
+ | |||
+ | <span style="font-size: 16px">If you have used this pattern and would like to contribute your experience to the wiki, please go to [[Feedback]] to submit your experience or comment.</span><br /> <br /> | ||
+ | |||
+ | <span style="font-size: 14px">.................................................................................................................[[Main Page]] / Back to [[Process Patterns]] / Back to [[Test Automation Patterns]]</span></div> |
Latest revision as of 15:53, 21 August 2018
.................................................................................................................Main Page / Back to Design Patterns / Back to Test Automation Patterns
Pattern summary
Use default data to simplify data input
Category
Design
Context
This pattern is useful when test cases need a lot of common data that is not all meaningful for the specific test.
Description
Instead of cluttering test cases with data that is needed, but is not relevant for the specific test, use default data.
For example, if you are interested in testing validation for a Name field but don't care about the contents of the address or phone number fields, set up a default value for the address ("123 Main Street") and phone number. Then in your test, you will say what the Name field should contain, but not what the other fields should contain, so your framework will copy the default values (because if they were left blank, the test would fail) to those fields.
Implementation
Prepare default data. Your TEST AUTOMATION FRAMEWORK substitutes default data for missing data during the data inputs in the test cases
Potential problems
Default values should be valid, but there may be combinations of other values that make a normally valid value invalid.
You may end up with a lot of people living at the same address… ;-)
Issues addressed by this pattern
Experiences
Thanks to Richard Bradshaw, whose pattern DATA BUILDER inspired this one.
If you have used this pattern and would like to contribute your experience to the wiki, please go to Feedback to submit your experience or comment.