{"id":412,"date":"2012-02-05T11:27:05","date_gmt":"2012-02-05T19:27:05","guid":{"rendered":"http:\/\/angryweasel.com\/blog\/?p=412"},"modified":"2012-02-05T11:27:05","modified_gmt":"2012-02-05T19:27:05","slug":"exploring-test-automation","status":"publish","type":"post","link":"https:\/\/angryweasel.com\/blog\/exploring-test-automation\/","title":{"rendered":"Exploring Test Automation"},"content":{"rendered":"<p>&#160;<\/p>\n<p>I try to read a lot about testing in blogs, articles, books etc. A few days ago, I came across this quote, and it struck me in an odd way.<\/p>\n<blockquote>\n<p>\u201cCommonly, test automation involves automating a manual process already in place that uses a formalized testing process\u201d<\/p>\n<\/blockquote>\n<p>The source doesn\u2019t matter, as it turns out that sentence was copied directly from the <a href=\"http:\/\/en.wikipedia.org\/wiki\/Test_automation\">Wikipedia article on Test Automation<\/a>. I\u2019ve been at Microsoft for a long time now, and although I do try to stay connected with testing outside of the Borg, sometimes I notice that *my* view of a subject is quite different than what\u2019s \u201ccommonly\u201d understood.<\/p>\n<p>Or, maybe not \u2013 but let me try to explain my concerns here a bit more.<\/p>\n<p>I\u2019m all for saving time and money, but I have concerns with an automation approach based entirely (or largely) on automating a bunch of manual tests. Good test design considers manual and computer assisted testing as two different attributes \u2013 <em>not sequential tasks<\/em>. That concept is such an ingrained approach to me (and the testers I get to work with), that the idea of a write tests-&gt;run tests manually-&gt;automate those tests seems fundamentally broken. I know there are companies that have separate test automation team that do exactly this, and I think it\u2019s a horrible approach.<\/p>\n<p>Let\u2019s use the <a href=\"http:\/\/angryweasel.com\/blog\/?p=335\">Numberz Challenge<\/a> as an example. I know right away that I\u2019m going to perform some manual tests (e.g. make sure the app can launch and close (original version had a bug here), verify look and feel, color choices, etc.). These sorts of tests could be automated, but I generally don\u2019t for a few specific reasons.<\/p>\n<ul>\n<li>The oracle for look and feel is difficult. Automated testing based on comparing screen colors or app dimensions is fragile. A pair of eyes for a few seconds every once in a while is much cheaper. <i>There are, of course, exceptions, and if you\u2019re convinced you can pull this off, just make sure you calculate the time spent investigating failures (and potential false positives) into your ROI calculation. I know many teams who have successful UI automation systems, but many more who have a bunch of test auto-crapation.<\/i><\/li>\n<li>Most systems I work on \u2013 and certainly everything that has a UI, gets at least a tiny bit of usage from the product team or a small pilot group before rolling out widely. If the screen is pink, or the font somehow changed to Comic Sans, it will be noticed without the need for an automated test.<\/li>\n<\/ul>\n<p>When I look at something like Numberz, I also see where I need to use the power of a computer to answer some of the questions I have. For example, I know I need a large enough data set to be confident of the random algorithm, and I know I need extensive pattern matching to ensure that the next number is never predictable. Doing this manually is impossible (or a waste of time depending on what you try to do).<\/p>\n<p>Now I imagine this scenario in the write-test-then-automate-it workflow.<\/p>\n<div style=\"border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &quot;Courier New&quot;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px\" id=\"codeSnippetWrapper\">\n<div style=\"border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &quot;Courier New&quot;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px\" id=\"codeSnippet\">\n<pre style=\"border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &quot;Courier New&quot;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px\"><span style=\"color: #606060\" id=\"lnum1\">   1:<\/span> Test Case Steps:<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &quot;Courier New&quot;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px\"><span style=\"color: #606060\" id=\"lnum2\">   2:<\/span> 1) Launch App<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &quot;Courier New&quot;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px\"><span style=\"color: #606060\" id=\"lnum3\">   3:<\/span> 2) Press the Roll! Button <\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &quot;Courier New&quot;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px\"><span style=\"color: #606060\" id=\"lnum4\">   4:<\/span>&#160; <\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &quot;Courier New&quot;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px\"><span style=\"color: #606060\" id=\"lnum5\">   5:<\/span> Verify:<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &quot;Courier New&quot;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px\"><span style=\"color: #606060\" id=\"lnum6\">   6:<\/span> 1) Ensure that none of the numbers is less than 0 or greater than 9<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &quot;Courier New&quot;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px\"><span style=\"color: #606060\" id=\"lnum7\">   7:<\/span> 2) Ensure that the total field is correct<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &quot;Courier New&quot;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px\"><span style=\"color: #606060\" id=\"lnum8\">   8:<\/span>&#160; <\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &quot;Courier New&quot;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px\"><span style=\"color: #606060\" id=\"lnum9\">   9:<\/span> Repeat this test at least 10 times<\/pre>\n<p><!--CRLF--><\/div>\n<\/div>\n<p>Now, the \u201cautomator\u201d comes along and writes this test:<\/p>\n<div style=\"border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &quot;Courier New&quot;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px\" id=\"codeSnippetWrapper\">\n<div style=\"border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &quot;Courier New&quot;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px\" id=\"codeSnippet\">\n<pre style=\"border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &quot;Courier New&quot;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px\"><span style=\"color: #606060\" id=\"lnum1\">   1:<\/span> Loop 10 times<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &quot;Courier New&quot;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px\"><span style=\"color: #606060\" id=\"lnum2\">   2:<\/span>   App.Launch (\u201cnumberz.exe\u201d)<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &quot;Courier New&quot;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px\"><span style=\"color: #606060\" id=\"lnum3\">   3:<\/span>   Button.Click(\u201cRoll\u201d)<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &quot;Courier New&quot;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px\"><span style=\"color: #606060\" id=\"lnum4\">   4:<\/span>   \/\/ Validate numbers are within range <\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &quot;Courier New&quot;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px\"><span style=\"color: #606060\" id=\"lnum5\">   5:<\/span>   \/\/ Validate correct total<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &quot;Courier New&quot;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px\"><span style=\"color: #606060\" id=\"lnum6\">   6:<\/span> End Loop<\/pre>\n<p><!--CRLF--><\/div>\n<\/div>\n<p>From what little context I have from the interwebs, this appears to be a common scenario &#8212; but we\u2019ve missed the critical aspects of testing this app (testing randomness \/ predictability). <em>What we haven\u2019t done at all in this situation is <strong>test design<\/strong><\/em>. To me, test design is far more holistic than thinking through a few sets of user tasks. You need to ask, \u201cwhat\u2019s really going on here?\u201d, and \u201cwhat do we really need to know?\u201d. Automating a bunch of user tasks rarely answers those questions. (Note \u2013 it does answer <em>some<\/em> questions, so if you have a good system and tests you can trust, by all means don\u2019t stop what you\u2019re doing).<\/p>\n<p>Where I think I have my big disconnect is in the definition of test automation. When I think of test automation, I don\u2019t think of automating user tasks. I think, \u201cHow can I use the power of a computer to answer the testing questions I have?\u201d, \u201cHow can I use the power of a computer to help me discover what I don\u2019t know I don\u2019t know?\u201d, and \u201cWhat scenarios do I need to investigate where using a computer is the only practical solution?\u201d. <\/p>\n<p>Perhaps test automation is purely the automation of manual tasks, and I\u2019m attempting to overload the word. I know some folks prefer the term \u201ccomputer assisted testing\u201d, and I suppose that\u2019s fine too.<\/p>\n<p>To me (and I\u2019m sure I\u2019ve used this line before), <i>it\u2019s just testing<\/i>. But please <strong>stop<\/strong> thinking of test automation as the step that follows test design, and start thinking of test design first.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#160; I try to read a lot about testing in blogs, articles, books etc. A few days ago, I came across this quote, and it struck me in an odd way. \u201cCommonly, test automation involves automating a manual process already in place that uses a formalized testing process\u201d The source doesn\u2019t matter, as it turns&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1],"tags":[],"class_list":["post-412","post","type-post","status-publish","format-standard","hentry","category-allposts"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/angryweasel.com\/blog\/wp-json\/wp\/v2\/posts\/412","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/angryweasel.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/angryweasel.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/angryweasel.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/angryweasel.com\/blog\/wp-json\/wp\/v2\/comments?post=412"}],"version-history":[{"count":0,"href":"https:\/\/angryweasel.com\/blog\/wp-json\/wp\/v2\/posts\/412\/revisions"}],"wp:attachment":[{"href":"https:\/\/angryweasel.com\/blog\/wp-json\/wp\/v2\/media?parent=412"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/angryweasel.com\/blog\/wp-json\/wp\/v2\/categories?post=412"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/angryweasel.com\/blog\/wp-json\/wp\/v2\/tags?post=412"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}