Difference between revisions of "GIANT SCRIPTS"
Line 1: | Line 1: | ||
<div id="content_view" class="wiki" style="display: block"><span style="font-size: 14px">.................................................................................................................[[Main Page]] / Back to [[Design Issues]] / Back to [[Test Automation Issues]]</span> | <div id="content_view" class="wiki" style="display: block"><span style="font-size: 14px">.................................................................................................................[[Main Page]] / Back to [[Design Issues]] / Back to [[Test Automation Issues]]</span> | ||
=<span style="font-family: Arial; font-size: 16px">'''Issue Summary'''</span>= | =<span style="font-family: Arial; font-size: 16px">'''Issue Summary'''</span>= | ||
− | <span style="font-size: 16px">Scripts | + | <span style="font-size: 16px">Scripts span thousands of lines or have many purposes bundled into the same script. </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-family: Arial; font-size: 16px">'''Examples'''</span>= | =<span style="font-family: Arial; font-size: 16px">'''Examples'''</span>= | ||
− | <span style="font-size: 16px">Scripts are not modular; one script does the test case from beginning to end (this is often the case if you use [[CAPTURE-REPLAY]]).</span><br /> <span style="font-size: 16px">Scripts perform more than one test case - you have to scroll and scroll to find out what the script is doing. This is also known as a "code smell", e.g. long class smell.</span> | + | <span style="font-size: 16px">Scripts are not modular; one script does the test case from beginning to end (this is often the case if you use [[CAPTURE-REPLAY]]).</span><br /> <span style="font-size: 16px">Scripts perform more than one test case - you have to scroll and scroll to find out what the script is doing. This is also known as a "code smell", e.g. long class smell. Scripts perform many functions; for example, you have to pass in lots of parameters even if a particular test only needs one. This is known as the "long method" code smell. (Thanks to Angie Jones - code smells tutorial, TestBash Manchester 2018.)</span> |
=<span style="font-family: Arial; font-size: 16px">'''Questions'''</span>= | =<span style="font-family: Arial; font-size: 16px">'''Questions'''</span>= |
Latest revision as of 09:24, 26 September 2018
Issue Summary
Scripts span thousands of lines or have many purposes bundled into the same script.
Category
Design
Examples
Scripts are not modular; one script does the test case from beginning to end (this is often the case if you use CAPTURE-REPLAY).
Scripts perform more than one test case - you have to scroll and scroll to find out what the script is doing. This is also known as a "code smell", e.g. long class smell. Scripts perform many functions; for example, you have to pass in lots of parameters even if a particular test only needs one. This is known as the "long method" code smell. (Thanks to Angie Jones - code smells tutorial, TestBash Manchester 2018.)
Questions
Who is doing the scripting?
Resolving Patterns
Most recommended:
- ABSTRACTION LEVELS: This pattern helps but it may be too costly or too time-consuming to change retroactively the architecture of your current automation, still you should use this pattern for all new automation efforts or when you have to do complex updates.
- GOOD DEVELOPMENT PROCESS: Apply this pattern if you don't have a process for developing test automation. Apply it also if your process lives only on paper (nobody cares)
- GOOD PROGRAMMING PRACTICES: This pattern should already be in use! If not, you should apply it for all new automation efforts. Apply it also every time you have to change current testware.
- ONE CLEAR PURPOSE: Use this pattern if you have scripts that perform more than one test case
Other useful patterns:
- DESIGN FOR REUSE: Apply this pattern for long lasting testware
- KEEP IT SIMPLE: Use this pattern always
- SINGLE PAGE SCRIPTS: Use this pattern to modularize your scripts
.................................................................................................................Main Page / Back to Design Issues / Back to Test Automation Issues