Test Automation Patterns

Design Patterns

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.
CHAINED TEST
Automate the tests so that they run in a predefined sequence.
DATA-DRIVEN TESTING
Write the test cases as scripts that read their data from external files.
DESIGN FOR REUSE
Design reusable testware.
DOCUMENT THE TESTWARE
Document the automation scripts and the test data.
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
Add to each line of test data a keyword that drives how it should be processed.
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.
NO LITTERING
Tests don't produce "garbage", but if they do, they remove it.
ONE CLEAR PURPOSE
Each test has only one clear purpose.
READABLE REPORTS
Design the reports to be easy to read and to understand.
SHARED SETUP
Data and other conditions are set for all tests before beginning the automated test suite.
Develop an automation script for each window or page.
TEST AUTOMATION FRAMEWORK
Use a test automation framework.
TOOL INDEPENDENCE
Separate the technical implementation that is specific for the tool from the functional implementation.