Why User Interface Test Automation Is Worth Doing Well
Let’s be honest: User interface test automation isn’t always the most glamorous work. It tends to be repetitive. No end-user of your product will ever interact with test automation code. It can also be hard to produce reliable, stable UI tests compared to other kinds of automated tests. Given these conditions, it is understandable why UI test automation efforts sometimes fail—either by falling into disrepair due to a lack of maintenance, or by not being undertaken at all.
I propose that in spite of the above, UI test automation is worth doing, and worth doing well—with the same high standards we would hold our application code to. Let’s talk about a few reasons why I believe this.
First, UI tests deliver true value and are a key part of evaluating the quality of your software. Among all types of automated tests, UI tests come the closest to simulating the actions of a real user. Instead of simply testing that each individual component is working, they help ensure that your product works as a cohesive system.
Granted, being mindful of the test automation pyramid, your test strategy would suffer greatly for focusing solely on UI tests at the expense of unit and service-level tests. But it’s hard to imagine a good test strategy that didn’t include at least some automated tests at the UI level.
Second, poorly factored, repetitive test automation code will eventually die when the effort required to maintain it is greater than the value it provides. In other words, the cost of not doing UI automation well is high. By not giving adequate attention to the quality of the tests being written, you risk losing the benefits of those tests. While it might be better to have no tests at all than to have bad ones, of course it’s best to have good ones, and that takes work.
Lastly, UI test automation is worth doing well because it has never been easier to do so. Producing UI test automation that will stand the test of time does not require reinventing the wheel. It simply requires applying many of the same object-oriented patterns you would use in the application code itself, and enough knowledge of the application under test to provide the right automation hooks to enable reliable tests. In the web space, there is a wealth of existing frameworks to help you.
While it’s generally true that mobile UI automation has not entirely caught up to web in terms of framework maturity, that is changing quickly, to the degree that high-quality mobile UI automation can be produced even without third-party libraries. Using only basic native tools, it’s now easier than ever to build high-value, maintainable automation into your project to test the user interface.
Jason Hagglund is presenting the session Scalable and Collaborative iOS UI Test Automation in Swift at the 2016 Mobile Dev + Test conference. Learn more at https://mobiledevtest.techwell.com.