Test Automation Strategy

The search for quality in a software product is the most important activity after the creation of said software and yet, there is so much we have to learn and to define. As time passes, the industry has also come up with a variety of ways to optimize testing tasks, one of them being testing automation.

A misconception is that UI Test Automation would suppress the need for Manual Testing and reduce development costs in a short period of time; far from the truth, manual testing is still a very important (if not the most) part of the software development process and will continue to be so in the foreseeable future.

The Problem

A project without an automation strategy would suffer from delayed releases, fragile functionalities and low morale among the team members. In order to implement test automation successfully, we have to identify problematic areas, below is a list of the most common ones:

• Test Maintenance:
Even though UI Automation can save time and money, it is also expensive to build, maintain and execute compared to other ways of automation such as API or Unitary tests.

• Test Flakiness:
Flakiness means unreliable and fragile tests that either don't always return the same result when given input or suddenly fail due to changes in the project's implementation. Tests based on UI comparison are the most affected to flakiness due to their reliance on a given configuration of the user interface which tends to change the most.

• Data Management:
A data management strategy attempts to organize the inputs of our project under test, it can be categorized as real data, generated in a controlled environment or randomized data. When the team lacks a proper strategy, test execution history can become useless for predicting future performance and it also makes it more difficult for developers to fix any failing test.

• Tool fragmentation:
In recent years, the progress made in the field of Artificial Intelligence has spurred a variety of new tools that attempt to fix the toughest challenges for test automation. Selenium no longer has the spotlight it had regarding test automation, proprietary and open-source alternatives now compete for the market.

• Unmotivated Testing team:
We tend to find testing experts that are not interested in automation as a career option, which is usually the reason that automation of UI requires programming skills.

Proposed Solutions

Having a test strategy in place will help us fix long term problems without losing sight of the day to day tasks.

• Test Plan
Write a document describing the test strategy and activities the team will follow throughout the development process, including tasks executed at an early stage, like document testing, as well as post-release actions like crash report gathering.

• The Automation Pyramid
It's a widely accepted theory regarding test automation that distributes the different tests in 3 levels depending on the cost of implementation, maintenance, and execution. These three levels are Unitary Testing, API Testing and User Interface Testing, all of them part of the Automation spectrum, being Unitary the less expensive and therefore the most numerous going up through API Testing which increases in cost up to User Interface Testing, this last category is the most expensive of them and it's recommended that less test are developed on it.

• Define your test data use cases:
Create data profiles based on use cases and define expected behavior that your tests will verify. Define when the use of Randomized data can be of benefit for the project.

• Tool Selection:
Keep it Simple, select the tool you're most familiar with (via usage or recommendation) that covers the most important requirements (test implementation, CI/CD integration and reporting), avoid hazarding your project with newer solutions that are still to be tested by the market.

Finally, keep in mind that software testing is a still-growing discipline, there are many styles and interpretations on how to achieve product quality. So keep an open mind and apply the techniques that better fit your project needs.