{"id":302,"date":"2011-05-04T21:30:27","date_gmt":"2011-05-05T04:30:27","guid":{"rendered":"http:\/\/angryweasel.com\/blog\/?p=302"},"modified":"2011-05-04T21:30:27","modified_gmt":"2011-05-05T04:30:27","slug":"to-automate","status":"publish","type":"post","link":"https:\/\/angryweasel.com\/blog\/to-automate\/","title":{"rendered":"To Automate&hellip;?"},"content":{"rendered":"<p>To Automate, or not to Automate, that is the question that confuses testers around the world. One tester may say, &quot;I automate everything, I am a test automation ninja!&quot;. Another tester may say, &quot;I do not automate, if I automate I fail to engage my brain properly in the testing effort!&quot;. Another may say, \u201cI automate that which is given to me to automate.\u201d Yet another may say, &quot;I try to automate everything, but what I cannot automate I test manually.&quot;<\/p>\n<p>All of these testers are wrong (in my opinion, of course). So wrong, that if I had the power, I&#8217;d put them in the tester penalty box (sorry, hockey playoffs on my brain) until they came to their senses.<\/p>\n<p>Good testers test first \u2013 or at the very least they think of tests first. I think great testers (or at least the testers I consider great) first think about how they&#8217;re going to approach a testing problem, then figure out what&#8217;s suitable for automation, and what&#8217;s not suitable. I say that like it&#8217;s easy &#8211; it&#8217;s not. My stock automation phrase is &quot;<strong><em>You should automate 100% of the tests that should be automated<\/em><\/strong>&quot;. nearly every tester knows that, but finding the automation line can be tricky business.<\/p>\n<p>I have my own heuristic for figuring this out &#8211; I call it the &quot;I&#8217;m Bored&quot; heuristic. I don&#8217;t like to be bored, so when I get bored, I automate what I&#8217;m doing. When I&#8217;m designing tests, I try to be more proactive and <em>predict<\/em> where I&#8217;ll get bored and automate those tasks. <\/p>\n<p>Just today, I was fixing some errors reported by a static analysis tool and found myself doing the following.<\/p>\n<ul>\n<li>copy the file path from the log<\/li>\n<li>check out the file from source control<\/li>\n<li>load the file in an editor<\/li>\n<li>make the fix (or fixes)<\/li>\n<li>rebuild to ensure the error was fixed<\/li>\n<\/ul>\n<p>After the third time, I was bored. I spent the next two minutes and fifty-one seconds writing a doskey macro that would pull the file name from the log, print it to the console (for easy copying), check out the file, and finally, load the file into the currently open editor. Given that I had another 40 files to go through, I consider that a good automation investment. <\/p>\n<p>In <a href=\"http:\/\/www.hwtsam.com\">HWTSAM<\/a>, I think I told the story about my first week at Microsoft. My manager handed me a list of test cases (in excel) and told me to run the tests. I glanced at the list of eighty or so tests and asked when he expected me to finish automating them. He said, &quot;Oh no, we don&#8217;t have time to automate those tests, you just need to run them every day.&quot;<\/p>\n<p>As an aside, let me say that I think scripted manual tests are one of the most wasteful efforts any tester &#8211; no, anyone in the world &#8211; can take on. I know that some readers will cite examples of where manual scripted tests are valuable, but for the record, I despise them more than my daughter despises brussel sprouts (you don&#8217;t know my daughter, but you may have heard her screams of dismay across the country the last time I tried sneaking a few on to her plate). <\/p>\n<p>So anyway, I started work on a Monday, got bored running those tests by Tuesday, and automated all eighty tests on Wednesday. I used my new found spare time to find all sorts of other issues (and to automate other scenarios). I don&#8217;t know if I ever told my manager that I automated those tests, but he was pretty dang happy with my results. <\/p>\n<p>Not all automation efforts work this way (I&#8217;m talking to you, pointy haired manager). The dream panacea of automation for some folks is that testers will write a plethora of automation, then they\u2019ll have time to do all kinds of additional testing while the automation runs seamlessly in the background. If all automation efforts were created equal (and by that, I mean equally simple), and if testers took the time to write reliable and maintainable code, this <em>could<\/em> be possible, but I don&#8217;t know anyone that lives in that world. Some things are difficult to automate, and we can waste our time trying to automate those tasks. Sometimes we write fragile tests because they appear to work (the illusion of progress). Then reality sets in and we discover we&#8217;re spending a big chunk of our time investigating and fixing failed tests (but that\u2019s another story).<\/p>\n<p>My parting advice is to remind you all that as software testers, our job is to test software. That probably sounds stupid (it sounds stupid to me as I type it), but test automation is just one tool from our tester toolbox that we can use to solve a specific set of testing problems. Like most tools, it works extremely well in some situations, and horribly in others. Use your brain and make the right choices.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To Automate, or not to Automate, that is the question that confuses testers around the world. One tester may say, &quot;I automate everything, I am a test automation ninja!&quot;. Another tester may say, &quot;I do not automate, if I automate I fail to engage my brain properly in the testing effort!&quot;. Another may say, \u201cI&#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-302","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\/302","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=302"}],"version-history":[{"count":0,"href":"https:\/\/angryweasel.com\/blog\/wp-json\/wp\/v2\/posts\/302\/revisions"}],"wp:attachment":[{"href":"https:\/\/angryweasel.com\/blog\/wp-json\/wp\/v2\/media?parent=302"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/angryweasel.com\/blog\/wp-json\/wp\/v2\/categories?post=302"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/angryweasel.com\/blog\/wp-json\/wp\/v2\/tags?post=302"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}