当前位置:网站首页>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 )
边栏推荐
- Play with concurrency: draw a thread state transition diagram
- 二叉树解题(一)
- 【ClickHouse】How to create index for Map Type Column or one key of it?
- Vmware安装win10报错:operating system not found
- Ognl和EL表达式以及内存马的安全研究
- There is no prompt for SQL in idea XML, and the dialect setting is useless.
- 深圳打造全球“鸿蒙欧拉之城”将加快培育生态,优秀项目最高资助 1000 万元
- Alibaba cloud polkit pkexec local rights lifting vulnerability
- IDEA xml中sql没提示,且方言设置没用。
- Arbre binaire pour résoudre le problème (2)
猜你喜欢

Tawang food industry insight | current situation, consumption data and trend analysis of domestic infant complementary food market

Markdown编辑语法

Ten thousand volumes are known to all, and one page of a book is always relevant. TVP reading club will take you through the reading puzzle!

C language practice - binary search (half search)

Federal learning: dividing non IID samples according to Dirichlet distribution

Win10 disk management compressed volume cannot be started

Acelems Expressway microgrid energy efficiency management platform and intelligent lighting solution intelligent lighting tunnel

Play with concurrency: what's the use of interruptedexception?

Play with concurrency: draw a thread state transition diagram

One click generation and conversion of markdown directory to word format
随机推荐
Ruby replaces gem Alibaba image
Learn what definitelytyped is through the typescript development environment of SAP ui5
Three years of experience in Android development interview (I regret that I didn't get n+1, Android bottom development tutorial
Play with concurrency: what's the use of interruptedexception?
Playing with concurrency: what are the ways of communication between threads?
Let genuine SMS pressure measurement open source code
Pytorch---使用Pytorch进行鸟类的预测
Summary of common string processing functions in C language
Ognl和EL表达式以及内存马的安全研究
Pytorch---使用Pytorch进行图像定位
idea自动导包和自动删包设置
Gin framework learning code
Pytoch --- use pytoch to predict birds
Common locks in MySQL
A summary of common interview questions in 2022, including 25 technology stacks, has helped me successfully get an offer from Tencent
DC-1靶场搭建及渗透实战详细过程(DC靶场系列)
My first experience of shadowless cloud computer
Several methods of capturing packets under CS framework
Mapping location after kotlin confusion
What are the rules and trading hours of agricultural futures contracts? How much is the handling fee deposit?