Difference between revisions of "ONE CLEAR PURPOSE"

From Test Automation Patterns
Jump to navigation Jump to search
(Created page with "<div id="content_view" class="wiki" style="display: block"><span style="font-size: 14px">.........................................................................................")
 
m (Topic titles in capital letters)
Line 1: Line 1:
 
<div id="content_view" class="wiki" style="display: block"><span style="font-size: 14px">.................................................................................................................[[Main Page]] / Back to [[Design Patterns]] / Back to [[Test Automation Patterns]]</span>
 
<div id="content_view" class="wiki" style="display: block"><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">'''Pattern summary'''</span>=
 
<span style="font-size: 16px">Each test has only one clear purpose</span>
 
<span style="font-size: 16px">Each test has only one clear purpose</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">Use this pattern to build efficient, modular and maintainable testware</span><br /> <span style="font-size: 16px">It's not necessary for disposable scripts</span>
 
<span style="font-size: 16px">Use this pattern to build efficient, modular and maintainable testware</span><br /> <span style="font-size: 16px">It's not necessary for disposable scripts</span>
=<span style="font-size: 16px">Description</span>=
+
=<span style="font-size: 16px">'''Description'''</span>=
 
<span style="font-size: 16px">Examples and the resulting tests should have a single clear purpose derived from one business rule. </span>
 
<span style="font-size: 16px">Examples and the resulting tests should have a single clear purpose derived from one business rule. </span>
=<span style="font-size: 16px">Implementation</span>=
+
=<span style="font-size: 16px">'''Implementation'''</span>=
 
<span style="font-size: 16px">See [http://hillside.net/europlop/europlop2011/submission/schedule.cgi here], look for link to One Clear Purpose pdf in the page</span>
 
<span style="font-size: 16px">See [http://hillside.net/europlop/europlop2011/submission/schedule.cgi here], look for link to One Clear Purpose pdf in the page</span>
=<span style="font-size: 16px">Potential problems</span>=
+
=<span style="font-size: 16px">'''Potential problems'''</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">[[GIANT SCRIPTS]]</span>''<br /> ''<span style="font-size: 16px">[[MANUAL%20MIMICRY MANUAL MIMICRY]]</span>''<br /> <span style="font-size: 16px">''[[OBSCURE TESTS]]''</span>
+
''<span style="font-size: 16px">[[GIANT SCRIPTS]]</span>''<br /> ''<span style="font-size: 16px">[[MANUAL MIMICRY]]</span>''<br /> <span style="font-size: 16px">''[[OBSCURE TESTS]]''</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 add your name and a brief story of how you used this pattern: your context, what you did, and how well it worked - or how it didn't work!</span><br /> <br /> <span style="font-size: 16px">Added by ''Wietze Veld''</span><br /> <br /> <span style="font-size: 16px">In our company we started to automate the tests for our existing application by rewriting the manual tests to automated tests. The manual tests were all scripted in documents. The test steps were generally copied one by one from the manual script to the automated script -we use an in-house tool built over Selenium webdriver that allows our testers to write command driven test scripts in MS Excel-. Our first goal in this process was to get as much coverage with automated tests as possible.</span><br /> <br /> <br /> <br /> <span style="font-size: 16px">After this entire process of converting manual test scripts to automated tests, we experienced some problems.</span><br />  
 
<span style="font-size: 16px">If you have used this pattern, please add your name and a brief story of how you used this pattern: your context, what you did, and how well it worked - or how it didn't work!</span><br /> <br /> <span style="font-size: 16px">Added by ''Wietze Veld''</span><br /> <br /> <span style="font-size: 16px">In our company we started to automate the tests for our existing application by rewriting the manual tests to automated tests. The manual tests were all scripted in documents. The test steps were generally copied one by one from the manual script to the automated script -we use an in-house tool built over Selenium webdriver that allows our testers to write command driven test scripts in MS Excel-. Our first goal in this process was to get as much coverage with automated tests as possible.</span><br /> <br /> <br /> <br /> <span style="font-size: 16px">After this entire process of converting manual test scripts to automated tests, we experienced some problems.</span><br />  
  
Line 27: Line 27:
 
=<span style="font-size: 16px">Identified causes</span>=
 
=<span style="font-size: 16px">Identified causes</span>=
  
* <span style="font-size: 16px">Original manual tests already covered too much, test were not being reevaluated before converting to automated tests (''[[MANUAL%20AUTOMATION MANUAL AUTOMATION]]'')</span>
+
* <span style="font-size: 16px">Original manual tests already covered too much, test were not being reevaluated before converting to automated tests (''[[MANUAL MIMICRY]]'')</span>
 
* <span style="font-size: 16px">Testers tended not to stick to the scenario but also validate what happens to be in the user interface in that tests step</span>
 
* <span style="font-size: 16px">Testers tended not to stick to the scenario but also validate what happens to be in the user interface in that tests step</span>
 
* <span style="font-size: 16px">Test efficiency was being misunderstood, less setup time if you put multiple scenarios in one test script was often the solution</span>
 
* <span style="font-size: 16px">Test efficiency was being misunderstood, less setup time if you put multiple scenarios in one test script was often the solution</span>

Revision as of 15:02, 28 April 2018

.................................................................................................................Main Page / Back to Design Patterns / Back to Test Automation Patterns

Pattern summary

Each test has only one clear purpose

Category

Design

Context

Use this pattern to build efficient, modular and maintainable testware
It's not necessary for disposable scripts

Description

Examples and the resulting tests should have a single clear purpose derived from one business rule.

Implementation

See here, look for link to One Clear Purpose pdf in the page

Potential problems

Issues addressed by this pattern

GIANT SCRIPTS
MANUAL MIMICRY
OBSCURE TESTS

Experiences

If you have used this pattern, please add your name and a brief story of how you used this pattern: your context, what you did, and how well it worked - or how it didn't work!

Added by Wietze Veld

In our company we started to automate the tests for our existing application by rewriting the manual tests to automated tests. The manual tests were all scripted in documents. The test steps were generally copied one by one from the manual script to the automated script -we use an in-house tool built over Selenium webdriver that allows our testers to write command driven test scripts in MS Excel-. Our first goal in this process was to get as much coverage with automated tests as possible.



After this entire process of converting manual test scripts to automated tests, we experienced some problems.

  • Other teams executing these tests were often not able to easily determine why a test failed
  • Tests failed for reasons not in the scope of the test script

Reasons why

  • Too much was being validated
  • Multiple scenarios in one test script
  • Unrelated scenarios in one test script
  • Purpose of the test was not -clearly- documented

Identified causes

  • Original manual tests already covered too much, test were not being reevaluated before converting to automated tests (MANUAL MIMICRY)
  • Testers tended not to stick to the scenario but also validate what happens to be in the user interface in that tests step
  • Test efficiency was being misunderstood, less setup time if you put multiple scenarios in one test script was often the solution

Solution

Write test scripts with one clearly documented scenario.
The testers needed not to concern themselves with efficiency of the steps in the test setup -which in our application shows the same pattern with variable input-, this was improved by the Test Automation team.

This is an ongoing process wherein the teams will be reevaluating their test scripts and optimize where needed.

Solution for the near future

  • Introduce the same in-house test framework but without MS Excel but for coded tests
  • Use Behavior Driven Development with SpecFlow, so the scenarios are clearly defined and documented





.................................................................................................................Main Page / Back to Design Patterns / Back to Test Automation Patterns