当前位置:网站首页>Future trend of automated testing ----- self healing technology
Future trend of automated testing ----- self healing technology
2022-07-02 04:42:00 【Peng Yuyan in the testing industry】
Automated testing future trend series : self-healing (Self-Healing) technology
1. Self healing technology
self-healing (Self-Healing) Technology in computer terminology means : A self-healing management mechanism .
Analogy to life , When a living body suffers some small damage , Their bodies can often achieve self-healing through their own repair mechanism , Without outside intervention . Such as gecko's broken tail regeneration , Or the body regeneration ability of crabs .
Back to the computer world , Self healing technology is also widely used , For example, the information channel of the chip is self-healing , Software system fault self-healing, etc . So what we want to introduce here is a self-healing technology in the direction of automated testing :
You can find unexpected errors in the execution of its test script and change them without human intervention , So as to restore itself to a better running state .
2. Technical principle
Problem domain : Using self-healing technology in automated testing mainly solves Object recognition problem .
Traditional automated testing frameworks and tools use application models to define application components and objects and their attributes . These definitions are then used to identify and manipulate application components . But applications change frequently when they are updated . May be intentional developer changes or immediate ( By the application system or build process ) the . These changes undermine our traditional automation approach based on static definitions .
natural language processing (NLP) And machine learning (ML) And other intelligent technologies have been developed to test scripts “ Study ” and “ To adapt to ” The point of . Use of self-healing test automation tools AI And machine learning technology , According to the user interface (UI) Or changes in the application environment can automatically update and adjust the test process .
When running tests , They scan the user interface of the application to see if there are any objects . Then they compare them with the application model previously generated for automated testing . If there are any changes to the application , There is a technology that allows tests to adapt and update automatically . This ability is called “ Self repair ”. Property changes are automatically sensed , Internal scripts repair themselves at run time by repairing themselves .
The self-healing function has the following characteristics :
- In the process of execution , If a test step locator cannot be detected by its default locator value , Other locator policies in the list will be automatically applied , No manual intervention by the tester is required . Execution will continue , It's like there's no fault .
- In the process of execution , If the test step locator fails and cannot be automatically detected using any other locator strategy , test Will be suspended , Allows the user to select the relevant element and continue . The new locator policy will be automatically updated the next time it is executed .
The following figure describes the main steps of self-healing technology :

The advantages of automatic test self-healing technology mainly include :
Reduce test failure rate
It is normal that the test execution fails , But sometimes the root cause of failure is simply because the user interface has changed and the test script has not changed synchronously . After using self-healing technology , It is unlikely that script execution failure will be affected by the object location that cannot be correctly recognized . The traditional automation framework cannot recognize these changes and update them automatically .
Prevent test instability
If we have flaky tests exist , It is difficult for us to determine whether our test is stable .”Nosuchelementexception“ Errors are one of the several errors that make test design unstable , It is very difficult for the test team to completely control such phenomena . When our test design is consistent with the application , The test is less likely to fail during execution , And the execution process is more smooth .
Improve script maintainability
The changes in the test code are proportional to the changes made by the developer in the application . Because the root cause may change and cannot reflect AUT True state and performance , Therefore, failed test results will limit testers' access to meaningful insights about their tests . By identifying and updating any changed test cases in the user interface , Self healing technology saves the time and energy of agile test and development teams . In addition to time and energy , Self repair in test automation also significantly reduces test maintenance costs .
3. Industry practice
We can see , There are already some good practices in the industry , such as Healenium project .
With Healenium Project as an example , See how automated test self-healing technology works :
Suppose we go through id To locate a button on our application interface , The positioner should be :#button

You can see from the above picture that , Elements can be correctly positioned to .Healnium Will save the correct positioner , As the benchmark value for the next test execution .
Now? , Let's assume that the developer changes the... Of the application UI Interface , Changed the of this button id attribute , from #button Changed to: #green_button. But for some reason , The test team was not notified of this change , So the test script has not been updated . So when we execute the script again , Trying to use #button When the old positioner goes to position the button , The script will report an error , Tips “NoSuchElement” The error exception of .

under these circumstances , standards-of-use Selenium The implementation test will fail , But use Healenium Will not be . Healenium Capture NoSuchElement abnormal , Trigger machine learning algorithm , Pass the current page status , Get the previously successful locator path , Compare them , And generate a list of fixed locators . It takes the locator with the highest score and uses it to perform operations . As we can see, the element was successfully found and passed the test .

After the test runs ,Healenium Generate a report , It contains information about repairing locators 、 Screenshot and all details of the repair success feedback button .

If the repair is successful , We can use Healenium Idea Plug in updates our automated test code : The plug-in uses the repair locator to find, repair, and update test code .

Healenium Use a machine learning algorithm to analyze the changes of the current web page : The longest common subsequence algorithm based on weight
More details about this project , You can visit the official website of this project :https://healenium.io/

The longest common subsequence algorithm based on weight
Through this case , Let's compare the differences in object maintenance between traditional automated testing methods and automated testing methods based on self-healing technology ( As shown in the figure below ):

Traditional automated testing methods and automated testing methods based on self-healing technology
4. Summary
The above briefly introduces the background and practice of automatic test self-healing technology . The future development trend of automated testing is bound to be more and more intelligent , Therefore, more intelligent technologies will be applied to the field of automated testing , So as to improve the efficiency of automated testing .
The following is the supporting information , For doing 【 software test 】 For our friends, it should be the most comprehensive and complete war preparation warehouse , This warehouse also accompanied me through the most difficult journey , I hope it can help you !
Last : It can be in the official account : Programmer Xiaohao ! Get a free copy of 216 Page software testing engineer interview guide document information . And the corresponding video learning tutorial is free to share !, It includes basic knowledge 、Linux necessary 、Shell、 The principles of the Internet 、Mysql database 、 Special topic of bag capturing tools 、 Interface testing tool 、 Test advanced -Python Programming 、Web automated testing 、APP automated testing 、 Interface automation testing 、 Testing advanced continuous integration 、 Test architecture development test framework 、 Performance testing 、 Safety test, etc. .
If my blog helps you 、 If you like my blog content , please “ give the thumbs-up ” “ Comment on ” “ Collection ” One button, three links ! Friends who like software testing , You can join our testing technology exchange group :779450660 There are various software testing resources and technical discussions )
边栏推荐
- [graduation season · advanced technology Er] young people have dreams, why are they afraid of hesitation
- 缓存一致性解决方案——改数据时如何保证缓存和数据库中数据的一致性
- 洛谷入门3【循环结构】题单题解
- 6.30年终小结,学生时代结束
- MySQL table insert Chinese change? Solution to the problem of No
- What methods should service define?
- Embedded-c language-8-character pointer array / large program implementation
- Binary tree problem solving (1)
- Yolov5网络修改教程(将backbone修改为EfficientNet、MobileNet3、RegNet等)
- Common errors of dmrman offline backup
猜你喜欢

Mysql database learning

社交媒体搜索引擎优化及其重要性

Free drawing software recommended - draw io

Playing with concurrency: what are the ways of communication between threads?

LM09丨费雪逆变换反转网格策略

cs架构下抓包的几种方法

面试会问的 Promise.all()
![[C language] Dynamic Planning --- from entry to standing up](/img/7e/29482c8f3970bb1a40240e975ef97f.png)
[C language] Dynamic Planning --- from entry to standing up
![Introduction to Luogu 3 [circular structure] problem list solution](/img/fd/c0c5687c7e6e74bd5c911b27c3e19c.png)
Introduction to Luogu 3 [circular structure] problem list solution

万卷共知,一书一页总关情,TVP读书会带你突围阅读迷障!
随机推荐
Idea automatic package import and automatic package deletion settings
6月书讯 | 9本新书上市,阵容强大,闭眼入!
DJB Hash
Ognl和EL表达式以及内存马的安全研究
win11安装pytorch-gpu遇到的坑
GeoTrust ov multi domain SSL certificate is 2100 yuan a year. How many domain names does it contain?
Orthogonal test method and function diagram method for test case design
idea自動導包和自動删包設置
What data does the main account of Zhengda Meiou 4 pay attention to?
06 装饰(Decorator)模式
Let正版短信测压开源源码
Mysql database learning
Pytoch --- use pytoch to predict birds
[understand one article] FD_ Use of set
万卷共知,一书一页总关情,TVP读书会带你突围阅读迷障!
Websites that it people often visit
Binary tree problem solving (2)
Read "the way to clean code" - function names should express their behavior
A summary of common interview questions in 2022, including 25 technology stacks, has helped me successfully get an offer from Tencent
LM09丨费雪逆变换反转网格策略