3 Ways for Faster Software Testing: Selenium, Appium, Serenity
By: Johnston Harris
Tags: Software Testing, Appium Testing, Selenium Test Automation, Serenity, Devops Tool

Introduction

Opensource automated test frameworks such as Selenium, Appium, Serenity, etc, can take a long time to complete. No wonder why development teams are frequently researching methods for faster automated testing.

Whether your test suite consists of Unit tests, Integration tests, and or Functional tests (UI), any amount of time the team spends waiting on test results hurts output. It’s no surprise automated test suites are the culprit for slower cycle times, delayed releases, laborious rework,…and ultimately team frustration.

After 15 years in the software testing space, here we will dive into three options available in the market we’ve implemented in the past to improve timely feedback from testing. Parallel Testing, Machine Learning for Prioritized Testing, and Narrow-Scope Testing.

1. Running your tests in Parallel or Multi-threaded:

Parallel testing is a method to execute several test scripts concurrently, with each test consuming different resources. The objective of parallel testing is to resolve the constraints of time by distributing tests across available resources. In theory, the more threads you have the more tests you can run simultaneously. Speed, Better Coverage, Optimization of your CI/CD Processes are all accomplished when parallelism is meticulously executed. This method works especially well with opensource test frameworks, such as Selenium, Appium, and or Serenity.

CON:

Many testers find it difficult to run tests in parallel because of dependencies between various test cases. If tests are dependent on each other, they need to be run in a particular order — AKA not in parallel or else things begin to break. So even if you wanted multiple threads running tests in sync, it doesn’t do much good because many tests rely on each other passing. Therefore there is a cap on how much you can test in parallel. And the more threads you open make no difference in time saved.

CON:

The more threads you have running, be prepared for a major resource demand from your test infrastructure. To achieve faster feedback by running more processes simultaneously, something’s gotta give. And in this case it’s very high CPU and Memory utilization. If you are testing locally, allocate additional resources and make sure systems are up to date. If you push up to the cloud, expect high utilization and a sobering monthly bill.

2. Use Machine Learning to Prioritize your Automated Tests:

There’s been vast improvements in leveraging machine learning in the QA software testing space in the last 18–24 months. One area of significant value ML can play is building out a classification model that learns from prior test failures. By analyzing failures, ML can build a surprisingly accurate risk-based model to predict the likelihood of future failures. After any change to the code, the ML model can accurately predict and automatically run just the subset of affected tests associated with the code change area. Essentially saying, why run 500 Serenity tests when only 50–60 were affected?

Teams now only run a small portion of their full test suite after each developer commit for faster automated software testing. For example, by only running 10% of their Selenium test-suite after each change, teams can expect to get results back in 90% less time than it would take for the whole test-suite to complete.

Additionally, ML adds value to pre-existing test strategies such as Parallelism and Narrow-Scope Testing. There are certain ML tools currently available, such as TestBrain, that are completely agonistic to current test practices. TestBrain can simply plug into the background for faster smarter software testing.

CON:

Software testers will likely be concerned the ML model will miss defects.

ML tools are meant to help QA get higher quality feedback to the team rapidly after each commit — thereby saving precious downtime waiting for results and alleviating the bottleneck test suites create. The tradeoff occurs at the confidence level you want to select the ML model tool to run. TestBrain, for example, is able to catch 98.5% of bugs by only running 10% of the test-suite.

A good ML tool for testing is meant to enhance existing test practices so that QA can test more frequently and accurately throughout the day. Best practice would have teams running the prioritized tests throughout the day, and then only running the whole test suite once a week, or month, or before major release. This is how tech titans, such as Google and Facebook, conduct their testing.

3. Narrow Scope Testing:

If time is something your team has, then reducing the scope of what you are testing helps speed up results.

Software testers target important features of the application and build test scripts around them. This method reduces the amount of tests that need to be run on a frequent basis, and helps get feedback to the team in a more orderly fashion. For this method to be performed accurately, the QA team should look into investing in strong Test Management Tools to help prioritize areas of focus for all contributing members.

CON:

Nothing says these narrow scripts will remain relevant. If a change takes place, prepare for the test scope to be adjusted. To reliably and consistently yield strong results, the scope needs to be routinely monitored and updated. This can take more time and resources than originally anticipated.

Carving out target areas and building test scripts around them is a very manual, high maintenance, and time-intensive process for opensource frameworks, such as Selenium, Appium, and Serenity.

In Conclusion

Various strategies exist to enhance current test practices and speed up results from opensource test frameworks. Some may be more advanced, realistic, and easier to adopt than others for their open source test frameworks. After years of experience with Selenium, Appium, and Serenity, we’ve found either parallelism, narrow-scope, and or ML to be the more economical and effective approaches.

With so many issues arising from long test suites, adopting one of these strategies will only help your productivity. Delayed feedback, context switching, flaky failures, can all be alleviated through enhanced software testing practices. ML has the potential to address the bulk of these issues in an economical and easily implemented fashion. TestBrain was developed to give time and resources back to the software development community.