Should Automated Acceptance Tests Use the GUI the Application Provides

Introduction

As a consultant and trainer, I am often asked by my clients and students how to deal with automated acceptance tests. One common question is whether automated acceptance tests should use the graphical user interface (GUI) provided by the application.

Consider the Context

Like all testing questions, this is a question that can only be answered well when we consider context – the missions and the givens of the project and the product. We do that by asking more questions.

  • What questions are we trying to ask and answer with automated tests?
  • To what extent has testing been done at lower levels of the application?
  • To what extent are we trying to confirm known behavior vs. trying to discover or investigate as-yet-unrecognized problems?
  • What tools do we have available? What tools will we have to obtain?
  • What is our team’s perceived level of experience and skills with the tools?
  • Has the application been developed for testability? Does it have an easily scriptable interface below the GUI? Does it provide log files?
  • Can we get changes to the product and support from the developers when the application is insufficiently testable (e.g. when HTML elements are missing id tags)?
  • How might we value speed, precision, and volume of tests? Is the GUI the place where we will obtain optimal automation value for those considerations?
  • To what extent do we need to model real users and observe what they observe? To what extent is automation capable of making such observations? What things will a conscious, conscientious human – a skilled tester – be likely to notice that automation might miss?
  • How might we create or use oracles that will allow the tool to help us to recognize a problem? (For more on oracles see Doug Hoffman’s three part article “Using Oracles in Testing and Test Automation” (1))
  • Is a need to vary the data that is being used in a productive way (systematically, pseudo-randomly, or randomly)?
  • How might we leverage GUI automation to drive the application quickly to a point where human testers can take over?
  • How might automated GUI tests drive us toward confirmation bias – that is, the tendency to design and execute tests that confirm existing beliefs about the product?
  • How might automated GUI tests lead us towards automation bias – the tendency to view results from automated processes as superior to human processes.

This might look like a long list, but you don’t have to answer these questions in great detail, nor do you have to get each one of them exactly right. A couple of moments of reflection on each one – a couple of minutes altogether – is likely rather than forgetting to consider it at all. If you are uncertain or stuck, a few more minutes of investigation or exploration could provide a huge return on investment. As you are in the middle of the project, continue to ask these questions periodically as a means of ensuring that the value of what you’re doing exceeds the cost.

Experience and Observation

In general, my experience and observation has been that as testing gets closer to the GUI, the cost of automating tests increases while the value derived from automated tests decreases.

Automated tests at the unit level tend to be:

  • Simpler to automate
  • Easier to comprehend and maintain
  • More subject to falsifiable assertions that machines can evaluate
  • Appropriately specific, where specificity matters
  • Revealing for problems that are easier to troubleshoot and debug
  • More immediately responsive to developers (since the developers tend to be the ones writing and running them)
  • Confirmatory, in a place where confirmation is more useful and important

Automated tests at the GUI level tend to be:

  • Complex and difficult to program
  • Hard to understand and maintain
  • Inadequate for recognizing problems that humans can easily identify
  • Overly specific in places where ambiguity can be tolerated by people
  • Revealing for problems that are more difficult to troubleshoot and debug
  • Less immediately responsive to developers
  • Confirmatory, at a level where investigation and discovery are more important

Now: I’ve said that this is a question that we can only answer well in context – but there is another question entirely: what do we mean by “acceptance tests”, and depending on what we mean, do we want to automate them at all? You might like to check “User Acceptance Testing – A Context-Driven Perspective” for some thoughts on that (2).

Michael Bolton

Michael Bolton provides training and consulting services in software testing and is a co-author with James Bach of Rapid Software Testing, a course and methodology on how to do testing more quickly, less expensively, and with excellent results. Contact Michael at mb@developsense.com.

Notes:

  1. Hoffman, Doug: “Using Oracles in Test Automation“. LogiGear Newsletter, 2006. Available free at:
    Using Oracles in Testing and Test Automation (Part 1 of 3);
    Using Oracles in Testing and Test Automation (Part 2 of 3);
    Using Oracles in Testing and Test Automation (Part 3 of 3).
  2. Bolton, Michael: “User Acceptance Testing – A Context-Driven Perspective”. Proceedings of the Pacific Northwest Software Quality Conference 2007, page 535.
Michael Bolton
Michael Bolton provides training and consulting services in software testing and is a co-author with James Bach of Rapid Software Testing, a course and methodology on how to do testing more quickly, less expensively, and with excellent results.

The Related Post

Introduction In many of the Test Automation projects that we are involved with using our Action-Based Testing methodology, management has expressed a need to relate tests and test results to system requirements. The underlying thought is that automation will create extra possibilities to control the level of compliance to requirements of the system under test. ...
Developers of large data-intensive software often notice an interesting — though not surprising — phenomenon: When usage of an application jumps dramatically, components that have operated for months without trouble suddenly develop previously undetected errors. For example, the application may have been installed on a different OS-hardware-DBMS-networking platform, or newly added customers may have account ...
One of the basic challenges with test automation is adoption. I can’t tell you how many times I’ve cataloged licenses for a company and found out they already have many different automation software packages, none of which is being used. Traditionally I’ve been told that is because the tools don’t work and that the teams ...
Cross-Browser Testing is an integral part of the Software Testing world today. When we need to test the functionality of a website or web application, we need to do so on multiple browsers for a multitude of reasons.
Over the years, we’ve provided an extensive number of articles that provide a wealth of knowledge about Test Automation. Below is a compilation of some of those articles. Guide to Automated Voice Apps Testing This article explores some of the basic test tools you’ll need and how to blend the use different automated testing tools ...
Take 5 and test your knowledge on the Software Testing essentials covered in our March 2019 issue. Good luck!
I got some comments on my post “Test Everything all the Time” — most notably people commenting that it’s impossible to test “everything”. I can’t agree more. The intention of the post was to make the point that we need to be able to test “everything we can” all the time. That is, you should ...
Investing in Test Automation training will increase your team’s productivity. The availability of reliable jobs in a competitive US market seems to be constantly embattled with competition and replacements of artificial intelligence (AI). In 2016, Foxconn replaced 60,000 employees with robots. However, the growth of Test Automation as an occupation has highlighted an intriguing option ...
Elfriede Dustin of Innovative Defense Technology, is the author of various books including Automated Software Testing, Quality Web Systems, and her latest book Effective Software Testing. Dustin discusses her views on test design, scaling automation and the current state of test automation tools. LogiGear: With Test Design being an important ingredient to successful test automation, ...
A short-list of selection criteria and popular automation tools. There are a lot of test automation tools available in the market, from heavy-duty enterprise level tools to quick and dirty playback-and-record tools for browser testing. For anyone just starting their research we’ve put together a short list of requirements and tools to consider.
Test automation can provide great benefits to the software testing process and improve the quality of the results…. but its use must be justified and its methods effective. The reasons to automate software testing lie in the pitfalls of manual software testing… As we all know too well, the average manual software testing program:
This is part 2 of a 2-part article series; part 1 was featured in the September 2020 issue of the LogiGear Magazine, and you can check it out here. Part 1 discussed the mindset required for Agile, as well as explored the various quadrants of the Agile Testing Quadrants model. Part 2 will delve into ...

Leave a Reply

Your email address will not be published.

Stay in the loop with the lastest
software testing news

Subscribe