This post is the second in a seven part series covering my seven tenets of software testing.
Original post (31 Jan 2005)
Automation explained
Test automation means different things to different people in different contexts. When I talk about automated testing I am referring to; A method of executing a test without human intervention, that would otherwise require it. In practical terms that may mean a nUnit test, a GUI test using a commercial testing tool, or a test written using an application’s internal scripting language. The technology is not the key concern, the fact that the test can be run 100% without any human involvement is the key.
Why automate?
The primary reason to automate tests is time. As a tester, you always need more time.
Automation can provide immense reductions in the amount of time required to execute tests. My first introduction to automated testing, in 1997, managed to condense 5 days of manual testing effort into 1 hour of automated execution for a 97.5% reduction in execution time.
Think about that for a moment, by automating our tests, we have achieved the equivalent of adding 40 additional testers to the team, for a fraction of the price. In addition I had taken the drudgery from my teams work day, increasing morale. More importantly, it lets your testers perform more ad-hoc testing which is much more effective than performing the same manual test over and over again.
So that’s it then, should we just retrench all our testers, and use automation instead? Well, no.
Despite a recent example where Microsoft retrenched 62 Longhorn testers, citing automation as the cause. Test automaton is generally used to help increase the amount of test coverage that can be achieved with a given schedule and resources, not reduce testing head-count.
When implemented correctly, with enough hardware, automating your tests allows you to execute all your tests, at least once a day, every day. When combined with a daily build, you have one (if not the), most powerful testing tool on the planet.
Build Verification or smoke testing
Every night after a successful compile, the daily build should automatically be packaged and deployed into a test environment, and smoke tested with an automated build verification test (BVT). The term “smoke” test is derived from the idea of quickly plugging in some electronics to test them, checking that no smoke comes out. While ideally you would run all your tests, typically the smoke test is a carefully selected subset of your full automated tests that can be run in about 10-20 minutes or so.
Automated regression testing
regression n. “[To] relapse to a less perfect or developed state.”
Regression testing has the goal of ensuring that the quality of an application doesn’t decline as features are added. Regression testing has a significant challenge. When an application needs it most, there is less time and resources available to perform all the tests that were executed when the product first shipped.
Without automation, the typical approach is to perform localised regression testing, which is limited to directly testing the area around the changes.
With an automation suite in hand, it is simply a matter of executing all the tests that were developed previously. This allows the maintenance programmers to make frequent releases, and allows the quality of the application to improve over time.
This is particularly important in light of trend that Fred Brooks suggests in his classic work, the mythical man-month, where each defect that is fixed has a 20-50% chance of introducing another.
The largest automation project that I have personally worked on was a huge effort which my client ran their $1M+ investment of tests on a rack of 25 dedicated machines that pounded away relentlessly, shortening their regression testing cycle by 75%, and that was partially automated to begin with!
Update (Tue, 8 Feb 2005)
Sara Ford, a tester in the Visual Studio team at Microsoft has blogged about this topic as well here.
Update (Wed, 2 Aug 2006)
A recent post by Bj Rollison, For those of you dreaming the 100% automation dream…please wake up! makes a very good point that, an goal 100% automated tests is completely unrealistic. I agree with his post, feel that I need to add a clarification to this one.
With any form of testing, you have to focus on what is important. Blindly trying to automate everything just to reach an arbitrary automation goal is contrary to that tenet. Does that mean that this tenet is wrong then? No, I don’t think so. There is a significant difference between should be automated and must be automated. In my experience, most projects need a heck of a lot more automation than they have. If this tenet was called, “you must automate what you can”, the whole point of this tenet would have been lost. Personally, the highest I have ever achieved on a project was 95% automated, and that lasted for all of 1 day, before we added more tests.
The #1 priority for a tester on any project, should always be to finding and log issues, however you find them. However, investing in the right amount of automation can make that a whole lot more effective.

August 2nd, 2007 at 4:53 am
Interesting post.
TesterQA
http://www.testerqa.com
October 30th, 2008 at 5:12 am
onestly i don’t understand your opinion…i give an example:I am testing an application which is used by a wholesaler company.They can manage orders,see details about customers ,manage employees ,planning of the employees etc.How can i use in this case automation testing?The only bugs that could appear are :a form return an error when you save,a filter error etc…
it might be too late for the comment…but i’m trying…
October 30th, 2008 at 8:00 am
Ok here is an example. You have a form that works fine. You develop a test that fills in the form and submits form data based on your requirements. Maybe you have to enter a date in the form dd/mm/yyyy. A new requirement introduces a bug where the date validator is changed and only accepts dd/mm/yy instead. Having this test automated and run every day would find this regression bug for you. That is why you need to automate your tests and run them every day whilst an application is being developed or maintained.
February 19th, 2009 at 11:27 am
Bruce, do you know of any way to clear IE’s temporary internet file cache before (or during) a WatiN test?
I’m trying to use WatiN to drive a JSunit test of my JavaScript code, but when I make changes to the JavaScript (behind an Ajax enabled control), the old javascript files still seem to be used.
Thanks!
March 24th, 2009 at 10:40 am
This is a good post. To add to Bruce example – We do extensive backend testing. Information provided on front-end, we automate a test to make sure it is being saved correctly. We started off by creating smoke test by choosing very common and simple scenario and then added few more regression scripts. Automation script does require maintains but not much if your approach is right.
March 31st, 2009 at 8:50 pm
This is something that WatiN can’t do. You would need to use White or something similar to automate the IE UI.
April 7th, 2009 at 7:33 pm
I am not a sales guy but IBM Rational Functional Tester gives us that flexibility.