Difference between revisions of "GOOD PROGRAMMING PRACTICES"
m (Topic titles in capital letters) |
|||
(5 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">.................................................................................................................[[Main Page]] / Back to [[Process Patterns]] / Back to [[Test Automation Patterns]]</span><br /> | <div id="content_view" class="wiki" style="display: block"><span style="font-size: 14px">.................................................................................................................[[Main Page]] / Back to [[Process Patterns]] / Back to [[Test Automation Patterns]]</span><br /> | ||
=<span style="font-size: 16px">'''Pattern summary'''</span>= | =<span style="font-size: 16px">'''Pattern summary'''</span>= | ||
− | <span style="font-size: 16px">Use the same good programming practices for test code as in software development for production code.</span | + | <span style="font-size: 16px">Use the same good programming practices for test code as in software development for production code.</span> |
=<span style="font-size: 16px">'''Category'''</span>= | =<span style="font-size: 16px">'''Category'''</span>= | ||
− | <span style="font-size: 16px">Process</span | + | <span style="font-size: 16px">Process</span> |
=<span style="font-size: 16px">'''Context'''</span>= | =<span style="font-size: 16px">'''Context'''</span>= | ||
− | <span style="font-size: 16px">This pattern is appropriate when you want your automation scripts to be reusable and maintainable, that is when your test automation is to be long lived.</span><br /> <span style="font-size: 16px">This pattern is not necessary if you only write short disposable scripts.</span | + | <span style="font-size: 16px">This pattern is appropriate when you want your automation scripts to be reusable and maintainable, that is when your test automation is to be long lived.</span><br /> <span style="font-size: 16px">This pattern is not necessary if you only write short disposable scripts.</span> |
=<span style="font-size: 16px">'''Description'''</span>= | =<span style="font-size: 16px">'''Description'''</span>= | ||
− | <span style="font-size: 16px">Scripting is a kind of programming, so you should use the same good practices as in software development. </span | + | <span style="font-size: 16px">Scripting is a kind of programming, so you should use the same good practices as in software development. </span> |
=<span style="font-size: 16px">'''Implementation'''</span>= | =<span style="font-size: 16px">'''Implementation'''</span>= | ||
<span style="font-size: 16px">If you don’t have an automation engineer, have developers coach the automation testers. Important good practices are:</span><br /> | <span style="font-size: 16px">If you don’t have an automation engineer, have developers coach the automation testers. Important good practices are:</span><br /> | ||
− | + | * <span style="font-size: 16px">[[DESIGN FOR REUSE]]: Design reusable testware. </span> | |
− | * <span style="font-size: 16px">[[DESIGN FOR REUSE ]]</span> | + | * <span style="font-size: 16px">[[KEEP IT SIMPLE]]: Use the simplest solution you can imagine.</span> |
− | * <span style="font-size: 16px">[[KEEP IT SIMPLE]]</span> | + | * <span style="font-size: 16px">[[SET STANDARDS]]: Set and follow standards for the automation artefacts. </span> |
− | * <span style="font-size: 16px">[[SET STANDARDS]]</span> | + | * <span style="font-size: 16px">[[SKIP VOID INPUTS]]: Arrange for an easy way to automatically skip void inputs</span> |
− | * <span style="font-size: 16px">[[SKIP VOID INPUTS]]</span> | + | * <span style="font-size: 16px">[[INDEPENDENT TEST CASES]]: Make each automated test case self-contained</span> |
− | * <span style="font-size: 16px">[[INDEPENDENT TEST CASES]]</span> | ||
* <span style="font-size: 16px"><span style="font-size: 16px">[[ABSTRACTION LEVELS]]: Build </span>testware that has one or more abstraction layers.</span> | * <span style="font-size: 16px"><span style="font-size: 16px">[[ABSTRACTION LEVELS]]: Build </span>testware that has one or more abstraction layers.</span> | ||
* <span style="font-size: 16px">Separate the scripts from the data: use at least [[DATA-DRIVEN TESTING]] or, better, [[KEYWORD-DRIVEN TESTING]]</span> | * <span style="font-size: 16px">Separate the scripts from the data: use at least [[DATA-DRIVEN TESTING]] or, better, [[KEYWORD-DRIVEN TESTING]]</span> | ||
* <span style="font-size: 16px">Apply the "DRY" Principle (Don’t Repeat Yourself), also known as "DIE" (Duplication is Evil)</span> | * <span style="font-size: 16px">Apply the "DRY" Principle (Don’t Repeat Yourself), also known as "DIE" (Duplication is Evil)</span> | ||
− | <br /> <span style="font-size: 16px">Put your best practices in a Wiki so that both testers and developers profit from them.</span | + | <br /> <span style="font-size: 16px">Put your best practices in a Wiki so that both testers and developers profit from them.</span> |
=<span style="font-size: 16px">'''Potential problems'''</span>= | =<span style="font-size: 16px">'''Potential problems'''</span>= | ||
− | <span style="font-size: 16px">If the software developers don't use good programming practices, then don't follow them, but investigate good programming outside of your company. (Read books!)</span | + | <span style="font-size: 16px">If the software developers don't use good programming practices, then don't follow them, but investigate good programming outside of your company. (Read books!)</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">[[BRITTLE SCRIPTS]]</span>''<br /> ''<span style="font-size: 16px">[[ BUGGY SCRIPTS]]</span>''<br /> <span style="font-size: 16px">''[[ DATA CREEP]]''</span><br /> ''<span style="font-size: 16px">[[ GIANT SCRIPTS]]</span>''<br /> ''<span style="font-size: 16px">[[HIGH ROI EXPECTATIONS]]</span>''<br /> ''<span style="font-size: 16px">[[ OBSCURE TESTS]]</span>''<br /> ''<span style="font-size: 16px">[[SCRIPT CREEP]]</span>''<br /> ''<span style="font-size: 16px">[[TEST DATA LOSS]]</span>''<br /> ''<span style="font-size: 16px">[[TOOL-DRIVEN AUTOMATION]]</span>'' | + | ''<span style="font-size: 16px">[[BRITTLE SCRIPTS]]</span>''<br /> ''<span style="font-size: 16px">[[ BUGGY SCRIPTS]]</span>''<br /> <span style="font-size: 16px">''[[ DATA CREEP]]''</span><br /> ''<span style="font-size: 16px">[[ GIANT SCRIPTS]]</span>''<br /> ''<span style="font-size: 16px">[[HIGH ROI EXPECTATIONS]]</span>''<br /> ''<span style="font-size: 16px">[[ OBSCURE TESTS]]</span>''<br /> ''<span style="font-size: 16px">[[SCRIPT CREEP]]</span>''<br /> ''<span style="font-size: 16px">[[TEST DATA LOSS]]</span>''<br /> ''<span style="font-size: 16px">[[TOOL-DRIVEN AUTOMATION]]</span>'' |
=<span style="font-size: 16px">'''Experiences'''</span>= | =<span style="font-size: 16px">'''Experiences'''</span>= | ||
− | <span style="font-size: 16px">If you have used this pattern, please | + | |
+ | <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> |
Latest revision as of 14:38, 21 August 2018
Pattern summary
Use the same good programming practices for test code as in software development for production code.
Category
Process
Context
This pattern is appropriate when you want your automation scripts to be reusable and maintainable, that is when your test automation is to be long lived.
This pattern is not necessary if you only write short disposable scripts.
Description
Scripting is a kind of programming, so you should use the same good practices as in software development.
Implementation
If you don’t have an automation engineer, have developers coach the automation testers. Important good practices are:
- DESIGN FOR REUSE: Design reusable testware.
- KEEP IT SIMPLE: Use the simplest solution you can imagine.
- SET STANDARDS: Set and follow standards for the automation artefacts.
- SKIP VOID INPUTS: Arrange for an easy way to automatically skip void inputs
- INDEPENDENT TEST CASES: Make each automated test case self-contained
- ABSTRACTION LEVELS: Build testware that has one or more abstraction layers.
- Separate the scripts from the data: use at least DATA-DRIVEN TESTING or, better, KEYWORD-DRIVEN TESTING
- Apply the "DRY" Principle (Don’t Repeat Yourself), also known as "DIE" (Duplication is Evil)
Put your best practices in a Wiki so that both testers and developers profit from them.
Potential problems
If the software developers don't use good programming practices, then don't follow them, but investigate good programming outside of your company. (Read books!)
Issues addressed by this pattern
BRITTLE SCRIPTS
BUGGY SCRIPTS
DATA CREEP
GIANT SCRIPTS
HIGH ROI EXPECTATIONS
OBSCURE TESTS
SCRIPT CREEP
TEST DATA LOSS
TOOL-DRIVEN AUTOMATION
Experiences
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.
.................................................................................................................Main Page / Back to Process Patterns / Back to Test Automation Patterns