Is AI the key to improving speed, testing, and even your personal state?
Testing is Still in the Dark Ages
The hard truth is that testers, test engineers and developers all spend too much of their working life “waiting”. Even when teams are moving towards continuous everything (testing, integration, delivery deployment) there is still too much inefficiency in the delivery process; too much waste, too much complexity, too many bottlenecks, and too much waiting. All of this leads to frustration for testers and developers alike.
We wait because the software delivery process is inefficient, regardless of whether you are using automated pipelines or waterfall processes. Any process has choke points and the biggest culprit for bottlenecks in software delivery is, you’ve guessed it; testing.
Software testing really became a discipline in its own right in the 1990s and, despite advances in automation as well as tooling and skills, fundamentally, not that much has changed. We continue to do things in the same way because the application under test is still a black box and we, as testers, don’t often get to peek inside.
We cast a broad testing net because we think that that is the way to catch the bugs. The reality is that the holes in the net are often too big and the defects escape, or we are casting the net in the wrong direction. We rely on our ever-growing test suites to prove non-regression and validate new features. The efficient way to run these growing test suites is through increased automation. However, there is a point where further automation itself becomes inefficient. Where the cost and effort spent on maintaining tests, outweigh the benefits of the automation itself. This is when we need to focus on the principles of less is more and, quite often, more can be less.
What if I tell you that 90%+ of the testing that you carry out for each iteration at any test stage (unit, integration, system, user acceptance) is wasted. You probably also won’t be surprised to hear that applications are typically deployed to production with quality risks due to gaps in untested areas of code because of the complexity and lack of visibility into modern applications.
AI can fix this. AI can illuminate testing. AI turns bug hunting from trawling with a big net into spearfishing, and that’s much more fun!
How AI can Illuminate Testing
A dictionary definition of Artificial Intelligence reads: “the theory and development of computer systems able to perform tasks normally requiring human intelligence, such as visual perception, speech recognition, decision-making, and translation between languages.”
AI works best when it has many data points to analyse, find trends, make predictions and identify solutions to problems. What better input than the millions of lines of code and thousands of test cases that make up today’s complex application landscapes. For example, the Google Chrome browser consists of 6.7 million lines of code; that is the equivalent of 120,600 pages of printed text. How can humans possibly begin to analyse and understand that amount of data and make split-second decisions on where to focus QA time and effort to build tests, and selectively run effective tests every time that there is a new build?
Therefore, AI and quality analytics are becoming a game-changer for QA. By understanding how code is executed and observing interactions with the application under test, millions of data points can be gathered across these interactions. AI can then process this data in seconds, to turn the data into actionable insights to deliver quality analytics and make recommendations. These insights can include where test investment should be made to plug quality risks, as well as what specific test executions should occur to adequately validate the specific changes made to an application.
Reducing Quality Risks through AI
Even with Continuous Delivery pipelines, applications have to pass through a minimum of three test stages as they progress through to production. Although most development teams use code coverage tools for static code analysis, few delivery teams understand how the actual code is executed and validated by tests across the various test stages. This lack of understanding leads to quality risks and any test gaps can result in escaping defects due to a lack of test execution coverage and appropriate validation.
By understanding every interaction and the “footprints” that each test leaves across the application, AI can process the millions of data points to show the highest risk areas of the application, where these test gap traps lie and can guide prioritisation of resources to plug the gaps.
Reducing Test Execution Times through AI
The reality is that you will not find defects in over 99% of the code that you are testing for any regression test cycle, mainly because the code and the logical flow through the application has not changed during the current build. If that is the case, why bother running all of your tests all of the time. If you can run a subset of your tests based on AI and quality analytics, it is possible to reduce test time and commit-to-deploy times by over 90%.
AI can provide better visibility into what tests should be executed for each test cycle. By using the data gathered from previous test executions, AI can identify which code has changed and automatically define test suites based on application risk. This could include tests selected based on recent changes; flaky tests; which parts of the application are used most frequently in production; which code changes have significant complexity and warrant special attention; which tests have the highest probability of failure and therefore should run more frequently and at the start of a test cycle.
This approach to “targeted testing” will find defects faster and will allow faster feedback loops for delivery teams. In turn, this will provide more instant gratification for testers when a defect is found.
Embrace AI and its future
Today’s applications and microservices are incredibly complex with millions of lines of code and thousands of associated test cases that have been built up over time. It is impossible to process this amount of complexity and information without using AI.
As demands increase on faster releases and shorter cycle times, adding AI to your testing arsenal is the only way to maintain velocity, remove drudgery and increase tester happiness. Embrace the future.
Written by Scott Dainty, Head of Enterprise Sales at Software Quality Intelligence Platform, SeaLights.