The top 10 test cases that benefit from AI power
Modern web applications need a different approach to testing. Here, we see how AI-powered solutions increase the number and type of tests you can automate.
Test automation has come a long way since Selenium appeared two decades ago. AI and machine learning have revolutionized test creation, maintenance, execution, and analysis. But many people are still unsure how AI-powered solutions can help them. Here, we present the top 10 test cases where AI-powered test automation really makes a difference.
Testing additional functionality
One of the most exciting gains from AI is the ability to test functionality that Selenium wasn’t designed for. AI-powered test platforms have been designed from the start with modern web applications in mind.
1. End-to-end functionality
Modern web applications are often just a part of a complex chain of integrated applications. Imagine a simple customer-facing website. This may include gated content to capture customer leads into your CMS. Often, it will be connected to your customer support ticketing system so users can report issues. It could even have an intelligent chatbot embedded in it. The website itself may function perfectly, but if any of these integrations doesn’t work, then the website is broken. This testing is a real challenge for scripted frameworks because they cannot see what’s happening e2e. By contrast, AI-powered solutions like Functionize make it easy to do end-to-end testing of complex integrations.
2. Multi-factor authentication
Nowadays, users expect you to implement multi-factor authentication (MFA) to keep their data safe. However, such tests are almost impossible to automate. If your login requires an email verification code or SMS, then you’re stuck with manual testing. Or you have to disable 2FA for your automated testing. Functionize Architect solves this in a neat way. When you record a login test, you can specify that you need to include either email or SMS verification. The system generates a real email address or SMS number and allows you easy access to any messages. The system then copies the received code into the login window automagically.
3. Need to test generated content (PDF, etc)
Many applications generate output files, such as PDFs, word documents or spreadsheets. Often, the output file is the most critical part of the whole process. For instance, travel sites that generate plane tickets or hotel vouchers. The traditional approach to testing this was pretty basic. You just wrote a script that verifies that a file was created with the appropriate filename. At Functionize, we go a step further. Our approach uses AI techniques like NLP and computer vision to verify the contents of the file are correct.
4. Testing business-critical processes
Not all web apps are customer-facing. For instance, you may use Salesforce for your back office functions or a custom system for invoicing. These applications are typically specialized and specific to your business. They are also mission-critical. That makes it imperative that you test them well. But tests like these need to be designed and created by the team that actually understands the system. This is where Functionize Architect comes into its own. Architect is an AI-powered test recorder that allows anyone to create fully-functional smart tests without needing to write any code. This differs from Selenium IDE, which outputs scripts that are not fully executable without additional scripting logic. As a result, your domain experts can help create tests that ensure your systems are working.
Reducing test maintenance
For years, test engineers have viewed test maintenance as a necessary evil—if you create test scripts, you just have to maintain them. However, we take a different view. We believe test maintenance is one of the biggest sources of test debt. In other words, it is an unnecessary time sink that prevents you from increasing your test automation coverage. Here are some use cases where AI powered testing drastically reduces test maintenance.
5. UI changes often
One of the biggest triggers for test failure is UI changes. These are a nightmare for any script-based test automation system. Test scripts rely on selectors to find parts of your UI and interact with them. For instance, you might tell the script to click on the “home” button, or to enter a username in the login field. The problem is, any time you change your UI, these selectors change in subtle ways. That causes your tests to break in one of two ways. Either, the test can no longer find the element it's looking for, and fails. Or, worse, it selects the wrong element instead and fails randomly many steps later! At Functionize we use machine-learning to avoid this problem. Every time your test runs, our system records millions of data points. These allow us to build an in-depth model of how your UI works. In turn, this allows us to use Smart Element Recognition to identify elements regardless of whether they moved, changed style, or were even renamed.
6. Dynamic content
Dynamic content is another test maintenance nightmare. However, modern web applications are almost always dynamic. That means large elements of the application change every time the site loads. If you aren’t careful, this triggers unpredictable test failures. The typical approach is to create test scripts that accept large variances between test runs. For instance, checking that there is a positive floating point dollar amount for a stock price ticker. Or checking that there are the right number of items added to a shopping cart. The problem is, unspecific validations result in tests that can’t fail. In other words, you may as well not bother with running the test. By contrast, AI-powered testing allows you to create smart tests that understand what is happening. That means they can be both low-maintenance and give useful test results.
7. Embedded content
Embedded content is increasingly popular in web applications. Think of all those advertising banners, news tickers, Twitter feeds, etc. Many developers also embed functionality like credit-card payments, PayPal Buy Now buttons, or other functions that are complex to create by themselves. The problem is, embedded content can cause unpredictable test failures. Imagine for instance that an advertising banner fails to load. Thus, all the calculated CSS on the page changes. The net result is that your tests now fail because all the selectors return the wrong items. Functionize’s Smart Element Recognition will ensure your tests don’t break just because an ad banner didn’t load.
Expanding the scope of your testing
Script-based testing was developed in a bygone era. Back then, no one had heard of CI/CD. Apps were released on red-letter days twice a year. Companies ran their own servers or provided monolithic applications. Nowadays, applications are delivered over the cloud and CI/CD means new features are released constantly. As a result, we need to shift the way we think about testing. Here is how AI helps with continuous testing.
8. Shift left
The first shift was to move testing earlier in the software development lifecycle. This became known as shift-left testing—testing new features as early and as often as possible. The earlier you test, the sooner you can find any problems. In turn, this allows your developers to fix bugs more efficiently and you speed up the overall delivery lifecycle. The problem is, shifting left is really hard unless you rely on an AI-powered test automation platform. That’s because creating new test scripts takes so long that it is hard to keep up with the pace of new features. Also, test scripts are fragile as we already saw. As a rule, new features are unstable, so tests for them are more likely to break and need maintenance. Something that isn’t a problem for AI-powered solutions.
9. Tests need to run in production
Modern web applications are often mission critical. If the application fails, you upset your users, damage your reputation, and may even lose money. The solution is to shift your testing into production—also known as shifting right. That may sound easy, but scripted test frameworks are not designed for testing production environments. They run on your own infrastructure behind the company firewall. Whereas production runs in the public cloud, which you may not even be able to connect to. AI-powered test solutions are themselves cloud-based. Moreover, they leverage the cloud to allow testing to run at a huge scale against your production servers. With the Functionize Test Cloud, you can even launch your tests from anywhere in the world.
10. Localization and internationalization
The final shift in testing comes because modern applications have to work across multiple cultures and countries. As a result, you need localization and internationalization. This means two users accessing your web app from different locations will see different versions. For instance, a shopper accessing an eCommerce site in Germany sees prices in Euros where a US user sees dollars. Ideally, your test solution has to be able to verify all these differences. In turn, that means replicating the same test dozens of times with different input data and checking the results are correct. This is known as data-driven testing and it needs skilled test engineers to set up. But, thanks to our cloud-based AI solution, Functionize allows anyone to set up complex data-driven tests in minutes.
Making the right choice
The above are just some of the test cases where modern AI-powered test solutions make a difference. However, it’s important to point out that not all tests are ideally suited for AI systems. For instance, one-off tests are still best done manually. Likewise, trying to define the steps to reproduce a bug. But if you want to see how Functionize’s AI will transform your automated testing, book a demo today.