Welcome to MSDN Blogs Sign in | Join | Help

GUI Automation and ROI

It seems that many test automation efforts around the industry tend to focus on GUI automation, or automating functional tests primarily by manipulating GUI objects. In general, GUI automation tends to be a very expensive approach to test automation, and the automation efforts often end in failure or achieve less than satisfactory results.

The majority of automated tests at Microsoft are below the GUI; however, automated tests that manipulate GUI objects are quite useful within specific contexts. Unfortunately, many testers attempt to develop automated GUI tests way too early in the project cycle while the user interface design is still unstable. I guess the assumption is that constantly maintaining automated tests is somehow better then executing manual tests. But, in general, when the UI is in flux it is usually counter-productive and a loss of return to automate GUI level tests too soon in the development lifecycle.

Dan Mosley and Bruce Posey (Just Enough Software Test Automation) suggest that on average an automated test must run approximately 17 times in order to break even. But, this doesn’t imply that we break even if we simply run the same test on a daily build for the next 17 days. The presumption underlying the ROI after 17 runs of a test is that something changed in the build that is covered by that particular test, and so by executing that (regression) test we are providing important information (changes in the build did not destabilize that area) to the team. Steve Rowe also has an excellent blog post on Too Much Test Automation that you should consider reading, and Dustin Andrews also has an excellent blog post on getting great results from test automation with an 8-minute video.

The cost of test automation is never easy to figure out and is certainly not a straight forward comparison of automated time versus manual time. Comparing automation time versus manual execution time is an overly simplistic measure that rarely takes into consideration the design and the development time of the initial tests (or the overall costs of building and enhancing test frameworks or drivers), or the time required to identify false negatives, troubleshoot the cause, fix the problem, verify the fix (manually), and then check the source back in for the next run. (And, there are other tangible costs, and intangible costs such as loss of confidence that must also be considered in any cost model.)

So, in general any automation that requires constant maintenance is usually not cost effective, and the more our test automation throws false negatives the less our management team views automation as a viable resource to provide us with valuable and reliable information for improved risk analysis. Ultimately the decision comes down to how much perceived and measurable value a test has in providing important information for improved risk assessment and quality measurement.

Just because we can automate something, doesn’t always mean we should!

Published Friday, March 28, 2008 2:13 AM by I.M.Testy

Comments

# re: GUI Automation and ROI

Hi,

I agree with your statements and it would be much easier if you could skip the GUI in automation. Unfortunate it is for many applications "necessary evil" since errors in the GUI level directly affects the end user (even if the error itself is minor, most users often is not that happy about it). In addition, some applications has a lot of exclusive functionality/business logic in the GUI layer (not recommended from my point of view, but for example AJAX seems popular these days).

So the trick is to find a cost effective way to do it. Good skills, tools and a robust framework will get you decent ROI I guess even for GUI automation. You could always considering what automation effort ratio that is appropriate for the different UIs in an application but at least I want to exercise all the UIs including GUIs in a new build to some degree automaticly even though my tests mainly aims at the business logic layer via Web Services or other "non-graphical" UIs.

Regards,

/Stefan

Friday, March 28, 2008 8:49 AM by stth10

# re: GUI Automation and ROI

Hi I,

I also agree -- automation is a tool that must be carefully wielded to get the best results. GUI automation is dangerous for the reasons stated, as well as for other hidden dangers such as forcing the GUI architecture (if your automation says to push a button, but UI design wants to change it to a click-image, the change may be canceled because of the impact to the test framework) or the simple idea that "more is better."

I take the approach that GUI automation can work for testing the GUI. I mean, you can sift down to other functional components from the GUI automation, but if that's the first line of test then you are really setting yourself up for a headache. As the presentation layers become more complicated (i.e. the previous poster's 'AJAX' comment), there will be a need for robust GUI-layer testing and automation; but I would hope that the underlying web service calls have already been thoroughly tested.

Regards,

/Erich

Friday, March 28, 2008 11:13 AM by trainer_erich

# re: GUI Automation and ROI

Hi Stefan,

Spot on! I didn't mean to suggest that GUI automation should be avoided, but that we need to be smarter about how and when to do it.

I absolutely concur that GUI automation is a great approach to simulate end user interaction; especially if we model the UI,  define use cases as actions, and use a model based testing approach to simulate an even greater number of scenarios.

Good class design should separate the core logic and functionality from the GUI layer. But, of course it is easy to write poorly designed code, which is why there will always be jobs in testing. :-)

As you say there are some automation frameworks that provide an abstraction layer to help 'ease the pain' or improve ROI a bit, but timing and balance are key.

Friday, March 28, 2008 11:18 AM by I.M.Testy

# re: GUI Automation and ROI

Hi Erich,

The other day I read an article about how the industry spent so much time studying usability and getting consistency into the GUI of client applications, and then came the Internet and standardization and usability of the UI went right out the window. I guess there is a parallel with OOP design and some scripting languages such as AJAX. :-)

This is not to suggest AJAX is a bad thing...it just complciates things a bit...and sometimes complication keeps things interesting, or at least gives us something to talk about. :-)

Friday, March 28, 2008 11:37 AM by I.M.Testy

# re: GUI Automation and ROI

I understand the frustration with GUI automation. Unfortunately, after humans, that's the method that seems to most consistently produce useful information about bugs.

Much of the frustration is inexperience and poor practices. Few shops seemed to have faced up to the the task of parsing their .rc files, design files or web pages to keep up with, and automate, their test scripts to reflect interface changes. More advanced systems (e.g. QuickTestPro) already address this in a semi-automated fashion. Fewer still get their interface stable before they write the underlying code.

Bottom line. Don't blame the GUI automation system. Look in the mirror. If maintenance is eating you alive, it's because you didn't plan ahead.

Friday, March 28, 2008 11:42 AM by ian807

# re: GUI Automation and ROI

Hi Ian,

Great points regarding the inexperience and poor practices, and that was the intent of my message. I suspect that many people simply attempt to automate from the GUI too soon in the project.

However, I don't necessarily agree with your comment that [the GUI] "seems to most consistently produce useful infomration about bugs."

I suspect most testing approaches over the past few years have tended to focus on testing from the GUI; however, there is a lot of evidence that demonstrates the single most effective means of identifying funcitonal and security issues is code reviews or inspections, and well designed unit testing can also consistently produce information about functional problems.

I do agree that GUI testing is useful in identifying usability type issues, but a lot of functional issues could be identified much earlier in the process...of course it all depends on how much an organization is willing to invest in testing.

Friday, March 28, 2008 12:29 PM by I.M.Testy

# re: GUI Automation and ROI

I stand corrected. I should have qualified this with "at our company, where we don't have a system of code reviews."

I'm still on the fence with about unit testing. It's got maintenance problems too.

Could you point me to the evidence - some objective measures of each type of testing? I haven't seem much in the way of objective measures of unit testing ROI on the web.

Personally, I'd *love* to go with more unit testing, however, I'm afraid that I want to because I like to code, not because it identifies a maximum number of important, fixable problems. I frequently suspect this is why developers like it, in general.

Friday, March 28, 2008 12:54 PM by ian807

# re: GUI Automation and ROI

As a quick data point, OneNote moved recently to a non_UI based automation system.

Short story: everyone involved in the process (test, dev, and PM) concurred, spurious failures fell from (some random number between 10-50% per run) to <1%.  Best quote from a tester: “I no longer get a knot in my stomach when I have to do automation investigations.”

I feel justified with this decision and "losing" the UI based tests.  After all, if I click the button to "make it green" and it is made gold instead, our dogfood use will hit that.  We cna automate the functional test of making it green and gold separately.

John Guin

OneNote Test

Wednesday, April 02, 2008 5:46 PM by JohnGuin

# re: GUI Automation and ROI

Good post BJ .. I really liked it ....

I often hear people saying in GUI automation world in IT scenario (where there is always pressure to less of testing hence more automation is pushed as possible way to achieve less testing ... read human testing)...

Test automation cuts down test cycle time and enables faster time to market...

Yes it depends on what one mean by cycle time and how good the product is and how good the developers are  and so on ....

Under what circumstances it is possible to achieve reduction in test cycle time?

Another things... I look ROI is three parts "Return", "Investment" and "timeline".

Articulating "return" is where most of us have challenges in attaching a $ value.

Most of GUI tool vendors claim  (in IT scenario) that ROI can be achieved in definite time frame or number of test cycle without looking at release cycles etc ... Pl note that it is a not a product scenario (daily build etc) like Microsoft. In IT, the test cycles are decided on the basis of high level business plan and release calendar hence without getting into the specifics of this ... it is nearly impossible to predict breakeven and other things.

Unfortunately ... such things happen and customers are taken for a ride.

Another perspective that I would like to share about IT scenario is lack know-how and support for building testability features so that automation can be built at a level bellow GUI.

When I talk about testability features ... people ask "what"? Same goes with formalized unit testing ... proliferation of xUnit frameworks and rigor on unit testing is by and large missing in IT kind of environment. Offshoring and development/testing split between multiple vendors complicates this issue ... we reach a situation where no good unit testing can happen ...

Now look at skill level, Testers in IT organizations and those in offshore services providers - typically lack skills to code at sub-GUI level. So they happily go with "easy-to-use" tools like QuickTestPro. Very few understand why is bad idea on the long run to code at GUI level.

So where does this take Testing and automation in IT ... Do more GUI automation and cut down testing costs ... It is kind of going in vicious circle of death ...

>>> I do agree that GUI testing is useful in identifying usability type issues.

Let me reiterate here .. when you say GUI testing is useful in identifiying usability type issues ... you are referring to human testing not test execution by machine (automation). I will not be surprised if some one states that they can perform usability tests by automation  (without human users interacting with the application)

Let us not mix up - "usability testing/issues", "GUI testing", "Human testing" and "machine testing".

Shrini

Friday, April 04, 2008 3:46 PM by Shrini

# I.M. Testy talks about UI automation and ROI

Friday, April 04, 2008 4:17 PM by I am filled with solutions

# re: GUI Automation and ROI

Hi Shrini,

Agreed. In my opinion many people make too many incorrect assumptions about the value a good automation effort provides to an organization.

I would also say that automated GUI testing can be useful in identifying certain types of usability issues. For example, missing key mnemonics, tab order, layout errors such as control overlap, truncation, etc. can be highly automated. (So, I guess I am that someone. :-)

But, I also agree there are other aspects of usability testing such as the 'ease of use' perspective may never be automated, nor should it be.

Friday, April 04, 2008 5:24 PM by I.M.Testy

# re: GUI Automation and ROI

BJ,

What do you say about this?

>>> Under what circumstances it is possible to achieve reduction in test cycle time by automation?

Shrini

Friday, April 04, 2008 11:30 PM by Shrini

# re: GUI Automation and ROI

Hi Shrini,

Reducing test cycle time with automation occurs within the overall product cycle. For example, when I wrote the automated BVT for the international versions of Windows 95 it ran approximately 1000 functional tests on 4 different language versions simultaneously within approximately 30 minutes. This automated BVT/BAT test suite saved more 15 hours per build in BVT/BAT time which then provided the test team additional time to design and execute an increased number of tests to expand depth and breadth of coverage.

There is a common myth that test automation will reduce the product development lifecycle. However, this is a foolish assumption for 2 reasons.

First, there are a greater number of all possible tests in any complex system then can be feasibly accomplished within any reasonable timeframe to make exhaustive testing virtually impossible. (The single biggest challenge in testing is to reduce the nearly infinate number of tests to a very small subset of tests that is going to provide the decision makers with the appropriate qualified information that will allow them to better analyze risks and make more informed business decisions.)

The second reason increased test automation typically does not impact the total development lifecycle is a result of Parkinson's Law; "work expands so as to fill the time available for its completion." Test automation may indeed reduce specific testing cycles within the overall development lifecycle; however because the potential test burden is so large the overall schedule will unlikely be effected to any large degree.

Saturday, April 05, 2008 5:06 AM by I.M.Testy

# re: GUI Automation and ROI

>>There is a common myth that test automation will reduce the product development lifecycle. However, this is a foolish assumption for 2 reasons.

Here are my reasons...

1. You would do lots of things "extra" in a automation cycle (automation setup, automation script failures/investigation/fix/rerun, analysis of results) that are not presenting in a pure manual testing cycle. Depending upon how good is your automation environment, Application under test and automation code - some times these extra items eat up time and net-net your overall cycle time with automation "might" be higher than pure manual testing time.  Not withstanding the fact that any comparison between manual testing cycle and automation cycle are really vague and stupid.

2. What would you do if automation test cycle throws up some interesting bugs and development struggles to fix them ... will you take your product to market faster than before?

We need to understand every cycle of testing reveals a set of bugs that need to be addressed so there is some development/testing work to be done after every testing cycle. Will automation reduce or eliminate that time? Not likely - those tasks are out of purview of automation

The fact that there is automation, you can gain some time and "accomplish" more testing but not faster time to market as there are other things to take care of anyway.

I always say "with good automation, you will do more testing (accomplish more) than before". This has taken many IT managers by surprise. Some told me that they bought automation tool so that they can do less testing and believed the promise given by sales person of the tool vendor/offshore service provider !!! Funny but true

Shrini

Sunday, April 06, 2008 2:21 PM by Shrini

# re: GUI Automation and ROI

Shrini,

I really like your statement "with good automation, you will do more testing (accomplish more) than before." I couldn't agree with you more. Well-designed automated tests can provide accurate evaluations of functionality and allow a tester to design and/or execute different tests to increase overall coverage.

Some of those 'extra' things in an automation cycle that you mention are also in manual testing. For example setup of unique environments, and of course I there will always be a maintenance cost for formalized test cases (tests that are written).

Of course, there are some breakthoughs in test automation and manual testing to reduce setup costs such as virtual machines. Also, a test automation framework can distribute tests across the wire to any networked computer that matches a particular setup, or recreate that setup from an image (if it exists) much quicker than manual testing. For example, at Microsoft an SDET may have anywhere from 2 to 6 machines in his or her office. However, once thier automated test gets checked in to source control it can be distributed to any computer in that team's lab (and with approx 120,000 lab machines around the company that automated test has the potential to execute on a lot more hardware and softwaer configurations than can be accomplished via manual testing within the same period.

We are also doing a lot of work with smarter deterministic and declarative type oracles, and also automated test result analysis. I talked a bit about this last year at some conferences. And we are starting to see these areas mature and providing increased value to our testing efforts.

I am well aware of the glorious stories told by automated test tool hucksters. In some cases, these tools provide what the customers need (and that is good), but in some cases I think customers are mislead, or perhaps the customer doesn't really understand testing, or perhaps some managers are attempting to use a tool to perhaps solve a much larger systemic problem.

Oh, and I also agree with you that any comparison between manual and automated testing is usually vague and meaningless. Manual testing gives us information that an automated test can't, and there is some information that an automated test can provide more accurately, or more timely as compared to a manual test. We must learn to use both approaches to their greatest benefit rather than view them as competing approaches.

Sunday, April 06, 2008 2:57 PM by I.M.Testy

# UI Automation Tesing?

做軟體測試的人, 大多會希望把所有的測試都自動化, 就算沒辦法全部 (事實上, 全部自動化在目前是不可能的...), 至少也要愈多自動化測試愈好, 畢竟, 自動化測試的好處很多, 使用得當, 絶對能大大幫助軟體測試人員的效率,

Saturday, June 07, 2008 7:35 PM by Eric Hu's Weblog
Anonymous comments are disabled
 
Page view tracker