当前位置:网站首页>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 )
边栏推荐
- Pytorch---使用Pytorch进行图像定位
- Oracle stored procedure and job task setting
- cs架构下抓包的几种方法
- Shenzhen will speed up the cultivation of ecology to build a global "Hongmeng Oula city", with a maximum subsidy of 10million yuan for excellent projects
- Exposure X8 Standard Version picture post filter PS, LR and other software plug-ins
- Binary tree problem solving (1)
- 面试会问的 Promise.all()
- ThinkPHP kernel work order system source code commercial open source version multi user + multi customer service + SMS + email notification
- Yyds dry goods inventory kubernetes introduction foundation pod concept and related operations
- Mysql中常见的锁
猜你喜欢
解决:代理抛出异常错误
Orthogonal test method and function diagram method for test case design
Lm09 Fisher inverse transform inversion mesh strategy
Analyze the space occupied by the table according to segments, clusters and pages
VMware installation win10 reports an error: operating system not found
Free drawing software recommended - draw io
How to write a client-side technical solution
Mapping location after kotlin confusion
Pytoch --- use pytoch to realize u-net semantic segmentation
[C language] Dynamic Planning --- from entry to standing up
随机推荐
Playing with concurrency: what are the ways of communication between threads?
Analyze the space occupied by the table according to segments, clusters and pages
Learn BeanShell before you dare to say you know JMeter
Alibaba cloud polkit pkexec local rights lifting vulnerability
06 装饰(Decorator)模式
Rhcsa --- work on the third day
How muddy is the water in the medical beauty industry with a market scale of 100 billion?
[graduation season · advanced technology Er] young people have dreams, why are they afraid of hesitation
Ruby replaces gem Alibaba image
2022-003arts: recursive routine of binary tree
Mouse events in JS
idea自動導包和自動删包設置
How to modify data file path in DM database
Arbre binaire pour résoudre le problème (2)
Deeply understand the concepts of synchronization and asynchrony, blocking and non blocking, parallel and serial
汇编语言中的标志位:CF、PF、AF、ZF、SF、TF、IF、DF、OF
Embedded-c language-8-character pointer array / large program implementation
One click generation and conversion of markdown directory to word format
面试会问的 Promise.all()
Tawang food industry insight | current situation, consumption data and trend analysis of domestic infant complementary food market