For decades Artificial Intelligence has been a dream for researchers and the stuff of dystopian nightmares for the general public. AI has been alternately described as a potential savior of mankind or as the technology that will finally destroy us.
When it was released in 1984, The Terminator painted a grim vision of a world where the machines had become sentient and had decided to destroy their human former-masters. At the time, such complex forms of artificial intelligence seemed like pure Science Fiction, but in recent years this has started to look more like Science Fact.
Many commentators and great men, including Henry A. Kissinger, have painted a bleak picture of a future in which AI stifles the very intelligence and creativity we seek to recreate artificially. Other experts, such as IFIP IP3 Board Director Stephen Ibaraki, claim that AI will be instrumental in helping the UN achieve its Sustainable Development Goals. As a result, people don’t know whether to embrace the benefits of AI or run scared of the possible consequences.
In this blog we look at the real impact AI will have on you as a QA Engineer. We seek to separate fact from fiction and hype from reality.
What is AI?
Artificial Intelligence is a generic phrase for a group of technologies that seek to replicate human-like intelligence in computers. The three most common forms of AI are Machine Learning, Natural Language Processing, and Machine Perception. Most technologies that describe themselves as using AI are employing one or more of these.
Machine Learning, or ML, is about teaching a computer to recognize patterns in data. These patterns can then be used to make decisions. ML relies on constructs such as artificial neural networks which need to be carefully trained before they are deployed.
Natural Language Processing, or NLP, aims to teach computers how to parse, interpret and understand natural language, be it spoken or written. This is the basis of Voice Assistants like Amazon’s Alexa, Apple’s Siri and Google’s Assistant.
Machine Perception (sometimes called image recognition) is about teaching a computer to recognize what is being shown in an image, or more complexly, a video. It generally uses specialized forms of neural network to deconstruct the image and categorize each constituent element.
What is AI best suited for?
Many of the most promising applications of AI rely on its ability to spot patterns and to learn the optimal choice to take given a set of choices. In particular, AI works well where there are well-defined rules or aims. This is why self-driving cars function really well on highways but struggle at driving downtown. Of course, there have been AIs that have been taught to go well beyond this. For instance, learning how to become a World-class go player. However, the computing power needed for that means it is still in the realms of specialist research.
So currently, the most promising applications of AI are in the automation of repetitive tasks, the identification of hard-to-spot patterns and for speech-to-text and text-to-speech based applications. As an example, AIs can be taught to process medical images and become better than doctors at diagnosing skin cancer. AI is also widely used in so-called algorithmic trading – seeking to predict changes in share and commodity prices at sub-microsecond timescales. The other thing AI can do particularly well is process vast quantities of data in order to extract what is important. For instance, AI can be used in eCommerce to improve customer recommendations, or for flagging potential fraudulent transactions.
How is AI being applied to testing?
Testing and test automation are particularly well-suited for applying AI. This is because a lot of testing involves relatively repetitive tasks where you are repeatedly running a test and comparing the result against a known expected outcome (which is why so much testing can be automated). Let’s look at each of the AI technologies above and see how these can be applied to testing.
Machine Learning. One of the inherent abilities of AI is to learn and spot patterns. This can be used to spot any problems or failures when the test runs. You could even imagine AI test suites that observe how users interact with the system under test and use these observations to construct better tests.
NLP. Using NLP, where a computer understands what you are asking it to do, means the computer can take a test plan written in “natural” language (e.g. in plain English) and generate a functioning test script from this.
Machine Perception. A key aspect of testing any frontend is seeing whether the screen looks as expected. AI image recognition can be used to compare the results of a new test with those from previous tests in order to identify where things have changed on the screen.
How will AI help me do my job?
Functionize’s system uses AI in several ways that are all designed to make your job easier. Our NLP test-creation engine allows you to take a test plan written in normal English and use this to generate a fully-functioning automated test. This greatly speeds up the process of creating tests, and has the advantage that it can define tests before the frontend system is fully operational. Our system instruments your frontend, allowing you to use live user data to refine and improve tests.
As tests are created or user interactions monitored, the AI in the background fingerprints every action to learn what the underlying system is actually doing as users navigate through it. It records thousands of pieces of data for every action. When any test is re-run the system can cope with changes such as re-styled pages, buttons that have moved and even buttons that have been renamed. It can even cope with the deep nesting of DOMs that happens in any dynamic site.
When a test fails, often the cause is a change that happened several screens earlier, such as a wrong selection being made on screen following a data re-ordering. Our AEA™ (Adaptive Event Analysis) engine includes Root Cause Analysis and Self-Heal functions that can be used to track back the actual cause of the failure. If it’s a failure in the test script then the system will make intelligent suggestions for how to correct it and lets you correct it with a single click.
But is my job under threat?
One of the most common assertions is that AI will replace humans in many jobs. Whenever a disruptive technology comes along it will cause changes and people will be scared of losing their job. But should you really be worried about losing your job? Well, yes, some commentators make a good case for this, but they fail to highlight that you still need human input to create the best results, however good your AI is. So, our view is that AI is simply another tool like test automation or cross-browser test platforms. When those came along, many manual testers feared for their jobs, but actually if anything the role of testers has grown.
Throughout our products, Functionize aims to simplify the boring and repetitive bits of your job, trying to make routine testing as frictionless as possible. If you are an advanced test automation engineer you may feel your job is directly at threat. But ultimately, every technology still needs humans in the loop. For instance, all the results from our RCA and self-heal functions need to be reviewed. Sometimes there may be an actual problem that needs resolving, other times the problem may be with the test. Ultimately it needs a human to make a decision. Even if the test needs to be updated, often the correct update has to be selected from several suggestions our system makes.
When reviewing test failures our system uses screenshots to show the likely problems, but ultimately it’s still you as a human that decides whether something has gone wrong. Equally, our NLP system is great at taking a test plan and producing a test script from it. But the real skill in testing lies in producing the plan. Determining what exactly needs to be tested, defining the expected output and deciding how best to try and trigger failures is still critical. It’s just that now a machine does the time-consuming part of creating a script to implement the plan.
At the end of the day, there will always need to be a human involved somewhere. Humans are needed to ensure the correct things are being tested by the automated system. As of now exploratory and manual testing definitely need a human to be done properly. And, of course, diagnostic testing of bugs based on user reports still needs the skills of a (human) detective. Conclusions
Artificial Intelligence is an incredibly powerful tool which, used properly, can simplify your life by removing the repetitive and mundane tasks. In effect, it’s the logical next step beyond automation. Test automation allowed testing to become far more efficient, but the cost was in endless hours of wasted time trying to maintain tests. AI now offers you an easy way to create tests that are maintenance free as well as giving you advanced tools for monitoring the performance of your tests. AI is the future, and it’s here already. At the end of the day, agile organizations are going to adopt AI autonomous testing because it will speed up delivery. This is going to see the rise of a new breed of test engineer – the AI engineer in test. Now is the time to embrace the opportunity, not to run scared like the saboteurs in 18th Century France!