Difference between revisions of "Design Patterns"

From Test Automation Patterns
Jump to navigation Jump to search
(Design patterns show how to design the test automation testware so that it will be efficient and easy to maintain.)
Line 1: Line 1:
 
<div id="content_view" class="wiki" style="display: block"><span style="font-size: 16px">Design patterns show how to design the test automation testware so that it will be efficient and easy to maintain. <br />
 
<div id="content_view" class="wiki" style="display: block"><span style="font-size: 16px">Design patterns show how to design the test automation testware so that it will be efficient and easy to maintain. <br />
The table below gives a list of the Design patterns with a short description.The [[Design%20Patterns%20Mind%20Map Design Patterns Mind Map]] shows which other patterns are used by the design patterns</span><br /> <br />  
+
The table below gives a list of the Design patterns with a short description.The [[Design Patterns Mind Map]] shows which other patterns are used by the design patterns</span><br /> <br />  
 
{| class="wiki_table"
 
{| class="wiki_table"
 
! <span style="font-size: 16px">Pattern</span><br />
 
! <span style="font-size: 16px">Pattern</span><br />
 
! <span style="font-size: 16px">Description</span><br />
 
! <span style="font-size: 16px">Description</span><br />
 
|-
 
|-
| <span style="font-size: 16px">[[ABSTRACTION%20LEVELS ABSTRACTION LEVELS]]</span><br />
+
| <span style="font-size: 16px">[[ABSTRACTION LEVELS]]</span><br />
 
| <span style="font-size: 16px">Build testware that has one or more abstraction layers.</span><br />
 
| <span style="font-size: 16px">Build testware that has one or more abstraction layers.</span><br />
 
|-
 
|-
| <span style="font-size: 16px">[[AUTOMATE%20GOOD%20TESTS AUTOMATE GOOD TESTS]]</span><br />
+
| <span style="font-size: 16px">[[AUTOMATE GOOD TESTS]]</span><br />
 
| <span style="font-size: 16px">Automate only the tests that bring the most Return on Investment (ROI).</span><br />
 
| <span style="font-size: 16px">Automate only the tests that bring the most Return on Investment (ROI).</span><br />
 
|-
 
|-
| <span style="font-size: 16px">[[AUTOMATE%20THE%20METRICS AUTOMATE THE METRICS]]</span><br />
+
| <span style="font-size: 16px">[[AUTOMATE THE METRICS]]</span><br />
 
| <span style="font-size: 16px">Automate metrics collection.</span><br />
 
| <span style="font-size: 16px">Automate metrics collection.</span><br />
 
|-
 
|-
| <span style="font-size: 16px">[[CAPTURE-REPLAY CAPTURE-REPLAY]]</span><br />
+
| <span style="font-size: 16px">[[CAPTURE-REPLAY]]</span><br />
 
| <span style="font-size: 16px">Capture a manual test with an appropriate tool and replay it to run the test again.</span><br />
 
| <span style="font-size: 16px">Capture a manual test with an appropriate tool and replay it to run the test again.</span><br />
 
|-
 
|-
| <span style="font-size: 16px">[[CHAINED%20TESTS CHAINED TESTS]]</span><br />
+
| <span style="font-size: 16px">[[CCHAINED TESTS]]</span><br />
 
| <span style="background-color: transparent; color: #000000; font-family: arial,helvetica,sans-serif; font-size: 16px; text-decoration: none">Automate the tests so that they run in a predefined sequence.</span><br />
 
| <span style="background-color: transparent; color: #000000; font-family: arial,helvetica,sans-serif; font-size: 16px; text-decoration: none">Automate the tests so that they run in a predefined sequence.</span><br />
 
|-
 
|-
| <span style="font-size: 16px">[[COMPARISON%20DESIGN COMPARISON DESIGN]]</span><br />
+
| <span style="font-size: 16px">[[COMPARISON DESIGN]]</span><br />
 
| <span style="font-size: 16px">Design the comparison of test results to be as efficient as possible, balancing Dynamic and Post-Execution Comparison, and using a mixture of Sensitive and Robust/Specific comparisons.</span><br />
 
| <span style="font-size: 16px">Design the comparison of test results to be as efficient as possible, balancing Dynamic and Post-Execution Comparison, and using a mixture of Sensitive and Robust/Specific comparisons.</span><br />
 
|-
 
|-
| <span style="font-size: 16px">[[DATA-DRIVEN%20TESTING DATA-DRIVEN TESTING]]</span><br />
+
| <span style="font-size: 16px">[[DATA-DRIVEN TESTING]]</span><br />
 
| <span style="font-size: 16px">Write the test cases as scripts that read their data from external files.</span><br />
 
| <span style="font-size: 16px">Write the test cases as scripts that read their data from external files.</span><br />
 
|-
 
|-
| <u><span style="background-color: transparent; color: #0066cc; font-family: arial,helvetica,sans-serif; font-size: 16px; text-align: left">[[DATE%20INDEPENDENCE DATE INDEPENDENCE]]</span></u><br />
+
| <u><span style="background-color: transparent; color: #0066cc; font-family: arial,helvetica,sans-serif; font-size: 16px; text-align: left">[[DATE INDEPENDENCE]]</span></u><br />
 
| <span style="background-color: transparent; color: #000000; font-family: arial,helvetica,sans-serif; font-size: 16px; text-decoration: none">Write your test cases to be date independent</span><br />
 
| <span style="background-color: transparent; color: #000000; font-family: arial,helvetica,sans-serif; font-size: 16px; text-decoration: none">Write your test cases to be date independent</span><br />
 
|-
 
|-
| <span style="font-size: 16px">[[DEFAULT%20DATA DEFAULT DATA]]</span><br />
+
| <span style="font-size: 16px">[[DEFAULT DATA]]</span><br />
 
| <span style="font-size: 16px">Use default data to simplify data input</span><br />
 
| <span style="font-size: 16px">Use default data to simplify data input</span><br />
 
|-
 
|-
| <span style="font-size: 16px">[[DESIGN%20FOR%20REUSE DESIGN FOR REUSE]]</span><br />
+
| <span style="font-size: 16px">[[DESIGN FOR REUSE]]</span><br />
 
| <span style="font-size: 16px">Design reusable testware.</span><br />
 
| <span style="font-size: 16px">Design reusable testware.</span><br />
 
|-
 
|-
| <span style="font-size: 16px">[[DOMAIN-DRIVEN%20TESTING DOMAIN-DRIVEN TESTING]]</span><br />
+
| <span style="font-size: 16px">[[DOMAIN-DRIVEN TESTING]]</span><br />
 
| <span style="font-size: 16px">Develop a domain-specific language for testers to write their automated test cases with.</span><br />
 
| <span style="font-size: 16px">Develop a domain-specific language for testers to write their automated test cases with.</span><br />
 
|-
 
|-
| <span style="font-size: 16px">[[DON%27T%20REINVENT%20THE%20WHEEL DON'T REINVENT THE WHEEL]]</span><br />
+
| <span style="font-size: 16px">[[DON'T REINVENT THE WHEEL]]</span><br />
 
| <span style="font-size: 16px">Use available know-how, tools and processes whenever possible.</span><br />
 
| <span style="font-size: 16px">Use available know-how, tools and processes whenever possible.</span><br />
 
|-
 
|-
| <span style="font-size: 16px">[[FRESH%20SETUP FRESH SETUP]]</span><br />
+
| <span style="font-size: 16px">[[ FRESH SETUP]]</span><br />
 
| <span style="font-size: 16px">Before executing each test prepares its initial conditions from scratch.</span><br /> <span style="font-size: 16px">Tests don’t clean up afterwards.</span><br />
 
| <span style="font-size: 16px">Before executing each test prepares its initial conditions from scratch.</span><br /> <span style="font-size: 16px">Tests don’t clean up afterwards.</span><br />
 
|-
 
|-
| <span style="font-size: 16px">[[INDEPENDENT%20TEST%20CASES INDEPENDENT TEST CASES]]</span><br />
+
| <span style="font-size: 16px">[[INDEPENDENT TEST CASES]]</span><br />
 
| <span style="font-size: 16px">Make each automated test case self-contained.</span><br />
 
| <span style="font-size: 16px">Make each automated test case self-contained.</span><br />
 
|-
 
|-
| <span style="font-size: 16px">[[KEEP%20IT%20SIMPLE KEEP IT SIMPLE]]</span><br />
+
| <span style="font-size: 16px">[[KEEP IT SIMPLE]]</span><br />
 
| <span style="font-size: 16px">Use the simplest solution you can imagine.</span><br />
 
| <span style="font-size: 16px">Use the simplest solution you can imagine.</span><br />
 
|-
 
|-
| <span style="font-size: 16px">[[KEYWORD-DRIVEN%20TESTING KEYWORD-DRIVEN TESTING]]</span><br />
+
| <span style="font-size: 16px">[[KEYWORD-DRIVEN TESTING]]</span><br />
 
| <span style="font-size: 16px">Tests are driven by keywords that represent actions of a test, and that include input data and expected results.</span><br />
 
| <span style="font-size: 16px">Tests are driven by keywords that represent actions of a test, and that include input data and expected results.</span><br />
 
|-
 
|-
| <span style="font-size: 16px">[[MAINTAINABLE%20TESTWARE MAINTAINABLE TESTWARE]]</span><br />
+
| <span style="font-size: 16px">[[MAINTAINABLE TESTWARE]]</span><br />
 
| <span style="font-size: 16px">Design your testware so that it does not have to be updated for every little change in the Software Under Test (SUT).</span><br />
 
| <span style="font-size: 16px">Design your testware so that it does not have to be updated for every little change in the Software Under Test (SUT).</span><br />
 
|-
 
|-
| <span style="font-size: 16px">[[MODEL-BASED%20TESTING MODEL-BASED TESTING]]</span><br />
+
| <span style="font-size: 16px">[[MODEL-BASED TESTING]]</span><br />
 
| <span style="font-size: 16px">Derive test cases from a model of the SUT, typically using an automated test case generator.</span><br />
 
| <span style="font-size: 16px">Derive test cases from a model of the SUT, typically using an automated test case generator.</span><br />
 
|-
 
|-
| <span style="font-size: 16px">[[ONE%20CLEAR%20PURPOSE ONE CLEAR PURPOSE]]</span><br />
+
| <span style="font-size: 16px">[[ONE CLEAR PURPOSE]]</span><br />
 
| <span style="font-size: 16px">Each test has only one clear purpose.</span><br />
 
| <span style="font-size: 16px">Each test has only one clear purpose.</span><br />
 
|-
 
|-
| <span style="font-size: 16px">[[READABLE%20REPORTS READABLE REPORTS]]</span><br />
+
| <span style="font-size: 16px">[[READABLE REPORTS]]</span><br />
 
| <span style="font-size: 16px">Design the reports to be easy for the recipient to read and understand.</span><br />
 
| <span style="font-size: 16px">Design the reports to be easy for the recipient to read and understand.</span><br />
 
|-
 
|-
| <span style="font-size: 16px">[[RIGHT%20INTERACTION%20LEVEL RIGHT INTERACTION LEVEL(3)]]</span><br />
+
| <span style="font-size: 16px">[[RIGHT INTERACTION LEVEL(3)]]</span><br />
 
| <span style="font-size: 16px">Be aware of the interaction level of the test approach on the SUT and its risks (intrusion)</span><br />
 
| <span style="font-size: 16px">Be aware of the interaction level of the test approach on the SUT and its risks (intrusion)</span><br />
 
|-
 
|-
| <span style="font-size: 16px">[[SENSITIVE%20COMPARE SENSITIVE COMPARE]]</span><br />
+
| <span style="font-size: 16px">[[SENSITIVE COMPARE]]</span><br />
 
| <span style="font-size: 16px">Expected results are sensitive to changes beyond the specific test case.</span><br />
 
| <span style="font-size: 16px">Expected results are sensitive to changes beyond the specific test case.</span><br />
 
|-
 
|-
| <span style="font-size: 16px">[[SHARED%20SETUP SHARED SETUP]]</span><br />
+
| <span style="font-size: 16px">[[SHARED SETUP]]</span><br />
 
| <span style="background-color: #ffffff; font-size: 16px">Data and other conditions are set for all tests before beginning the automated test suite.</span><br />
 
| <span style="background-color: #ffffff; font-size: 16px">Data and other conditions are set for all tests before beginning the automated test suite.</span><br />
 
|-
 
|-
| <span style="font-size: 16px">[[ SINGLE PAGE SCRIPTS ]](2)</span><br />
+
| <span style="font-size: 16px">[[SINGLE PAGE SCRIPTS]](2)</span><br />
 
| <span style="font-size: 16px">Develop an automation script for each window or page.</span><br />
 
| <span style="font-size: 16px">Develop an automation script for each window or page.</span><br />
 
|-
 
|-
| <span style="font-size: 16px">[[SPECIFIC%20COMPARE SPECIFIC COMPARE]]</span><br />
+
| <span style="font-size: 16px">[[SPECIFIC COMPARE]]</span><br />
 
| <span style="font-size: 16px">Expected results are specific to the test case so changes to objects not processed in the test case don't affect the test results.</span><br />
 
| <span style="font-size: 16px">Expected results are specific to the test case so changes to objects not processed in the test case don't affect the test results.</span><br />
 
|-
 
|-
| <span style="font-size: 16px">[[TEMPLATE%20TEST TEMPLATE TEST]]</span><br />
+
| <span style="font-size: 16px">[[TEMPLATE TEST]]</span><br />
 
| <span style="font-size: 16px">Define template test cases as a standard from which you can drive all kinds of test case variations.</span><br />
 
| <span style="font-size: 16px">Define template test cases as a standard from which you can drive all kinds of test case variations.</span><br />
 
|-
 
|-
| <span style="font-size: 16px">[[TEST%20AUTOMATION%20FRAMEWORK TEST AUTOMATION FRAMEWORK]]</span><br />
+
| <span style="font-size: 16px">[[TEST AUTOMATION FRAMEWORK]]</span><br />
 
| <span style="font-size: 16px">Use a test automation framework.</span><br />
 
| <span style="font-size: 16px">Use a test automation framework.</span><br />
 
|-
 
|-
| <span style="font-size: 16px">[[TEST%20SELECTOR TEST SELECTOR]]</span><br />
+
| <span style="font-size: 16px">[[TEST SELECTOR]]</span><br />
 
| <span style="font-size: 16px">Implement your test cases so that you can turn on various selection criteria for whether or not you include a given test in an execution run.</span><br />
 
| <span style="font-size: 16px">Implement your test cases so that you can turn on various selection criteria for whether or not you include a given test in an execution run.</span><br />
 
|-
 
|-
| <span style="font-size: 16px">[[TESTWARE%20ARCHITECTURE TESTWARE ARCHITECTURE]]</span><br />
+
| <span style="font-size: 16px">[[TESTWARE ARCHITECTURE]]</span><br />
 
| <span style="font-size: 16px">Design the structure of your testware so that your automators and testers can work as efficiently as possible.</span><br />
 
| <span style="font-size: 16px">Design the structure of your testware so that your automators and testers can work as efficiently as possible.</span><br />
 
|-
 
|-
| <span style="font-size: 16px">[[THINK%20OUT-OF-THE-BOX THINK OUT-OF-THE-BOX]]</span><br />
+
| <span style="font-size: 16px">[[THINK OUT-OF-THE-BOX]]</span><br />
 
| <span style="font-size: 16px">The best automation solutions are often the most creative</span><br />
 
| <span style="font-size: 16px">The best automation solutions are often the most creative</span><br />
 
|-
 
|-
| <span style="font-size: 16px">[[TOOL%20INDEPENDENCE TOOL INDEPENDENCE]]</span><br />
+
| <span style="font-size: 16px">[[TOOL INDEPENDENCE]]</span><br />
 
| <span style="font-size: 16px">Separate the technical implementation that is specific for the tool from the functional implementation.</span><br />
 
| <span style="font-size: 16px">Separate the technical implementation that is specific for the tool from the functional implementation.</span><br />
 
|-
 
|-
| <span style="font-size: 16px">[[VERIFY-ACT-VERIFY VERIFY-ACT-VERIFY]] (4)</span><br />
+
| <span style="font-size: 16px">[[VERIFY-ACT-VERIFY]] (4)</span><br />
 
| <span style="font-size: 16px">The action to test is surrounded by two verifications that check the initial and the final state</span><br />
 
| <span style="font-size: 16px">The action to test is surrounded by two verifications that check the initial and the final state</span><br />
 
|}
 
|}
<span style="font-size: 16px">[[Home ]]</span><br /> <span style="font-size: 16px">Back to [[Test Automation Patterns]]</span><br /> <span style="font-size: 16px">Back to [[Management Patterns]]</span><br /> <span style="font-size: 16px">Forward to [[Execution Patterns]]</span><br /> <br />
+
<span style="font-size: 16px">[[Main Page]]</span><br /> <span style="font-size: 16px">Back to [[Test Automation Patterns]]</span><br /> <span style="font-size: 16px">Back to [[Management Patterns]]</span><br /> <span style="font-size: 16px">Forward to [[Execution Patterns]]</span><br /> <br />
 
----
 
----
 
<br /> <span style="font-size: 16px">[1] Suggested by Thorsten Schönfelder</span><br /> <span style="font-size: 16px">[2] This pattern is known as PAGE OBJECT in the Selenium Community and has been suggested by Lisa Crispin</span><br /> <span style="font-size: 16px">[3] Suggested by Bryan Bakker</span><br /> <span style="font-size: 16px">[4] Suggested by the testing team at BREDEX</span><br />  Be aware of the interaction level of the test approach on the SUT and its risks (intrusion) </div>
 
<br /> <span style="font-size: 16px">[1] Suggested by Thorsten Schönfelder</span><br /> <span style="font-size: 16px">[2] This pattern is known as PAGE OBJECT in the Selenium Community and has been suggested by Lisa Crispin</span><br /> <span style="font-size: 16px">[3] Suggested by Bryan Bakker</span><br /> <span style="font-size: 16px">[4] Suggested by the testing team at BREDEX</span><br />  Be aware of the interaction level of the test approach on the SUT and its risks (intrusion) </div>

Revision as of 10:31, 3 April 2018

Design patterns show how to design the test automation testware so that it will be efficient and easy to maintain.

The table below gives a list of the Design patterns with a short description.The Design Patterns Mind Map shows which other patterns are used by the design patterns

Pattern
Description
ABSTRACTION LEVELS
Build testware that has one or more abstraction layers.
AUTOMATE GOOD TESTS
Automate only the tests that bring the most Return on Investment (ROI).
AUTOMATE THE METRICS
Automate metrics collection.
CAPTURE-REPLAY
Capture a manual test with an appropriate tool and replay it to run the test again.
CCHAINED TESTS
Automate the tests so that they run in a predefined sequence.
COMPARISON DESIGN
Design the comparison of test results to be as efficient as possible, balancing Dynamic and Post-Execution Comparison, and using a mixture of Sensitive and Robust/Specific comparisons.
DATA-DRIVEN TESTING
Write the test cases as scripts that read their data from external files.
DATE INDEPENDENCE
Write your test cases to be date independent
DEFAULT DATA
Use default data to simplify data input
DESIGN FOR REUSE
Design reusable testware.
DOMAIN-DRIVEN TESTING
Develop a domain-specific language for testers to write their automated test cases with.
DON'T REINVENT THE WHEEL
Use available know-how, tools and processes whenever possible.
FRESH SETUP
Before executing each test prepares its initial conditions from scratch.
Tests don’t clean up afterwards.
INDEPENDENT TEST CASES
Make each automated test case self-contained.
KEEP IT SIMPLE
Use the simplest solution you can imagine.
KEYWORD-DRIVEN TESTING
Tests are driven by keywords that represent actions of a test, and that include input data and expected results.
MAINTAINABLE TESTWARE
Design your testware so that it does not have to be updated for every little change in the Software Under Test (SUT).
MODEL-BASED TESTING
Derive test cases from a model of the SUT, typically using an automated test case generator.
ONE CLEAR PURPOSE
Each test has only one clear purpose.
READABLE REPORTS
Design the reports to be easy for the recipient to read and understand.
RIGHT INTERACTION LEVEL(3)
Be aware of the interaction level of the test approach on the SUT and its risks (intrusion)
SENSITIVE COMPARE
Expected results are sensitive to changes beyond the specific test case.
SHARED SETUP
Data and other conditions are set for all tests before beginning the automated test suite.
SINGLE PAGE SCRIPTS(2)
Develop an automation script for each window or page.
SPECIFIC COMPARE
Expected results are specific to the test case so changes to objects not processed in the test case don't affect the test results.
TEMPLATE TEST
Define template test cases as a standard from which you can drive all kinds of test case variations.
TEST AUTOMATION FRAMEWORK
Use a test automation framework.
TEST SELECTOR
Implement your test cases so that you can turn on various selection criteria for whether or not you include a given test in an execution run.
TESTWARE ARCHITECTURE
Design the structure of your testware so that your automators and testers can work as efficiently as possible.
THINK OUT-OF-THE-BOX
The best automation solutions are often the most creative
TOOL INDEPENDENCE
Separate the technical implementation that is specific for the tool from the functional implementation.
VERIFY-ACT-VERIFY (4)
The action to test is surrounded by two verifications that check the initial and the final state

Main Page
Back to Test Automation Patterns
Back to Management Patterns
Forward to Execution Patterns



[1] Suggested by Thorsten Schönfelder
[2] This pattern is known as PAGE OBJECT in the Selenium Community and has been suggested by Lisa Crispin
[3] Suggested by Bryan Bakker
[4] Suggested by the testing team at BREDEX
Be aware of the interaction level of the test approach on the SUT and its risks (intrusion)