web test repair.pptx

Automated Fixing of Web UI Tests
via Iterative Element Matching
1
Yuanzhang Lin∗
Beihang University
Beijing, China
linyz2020@gmail.com
Guoyao Wen
Huawei Technologies Co., Ltd.
Shenzhen, China
wenguoyao@huawei.com
Xiang Gao
Beihang University
Beijing, China
xiang_gao@buaa.edu.cn
∗This work was primarily undertaken by the author during his internship at Huawei while studying at the
Southern University of Science and Technology.
We greatly appreciate the suggestions and effort provided by Shin Hwei Tan.
ASE 2023
Why do we need automated UI test case repair?
Web
application
Test
cases
Write
Tester
s
Click
2
Click
By.xpath("//a[text()='Admin']")
Why do we need automated UI test case repair?
Web
application
Test
cases
Write
Tester
s
Click
Find the new locator.
Modify the broken tests.
Make sure the
repaired test cases
run correctly.
3
Click
By.xpath("//a[text()='Admin']") By.xpath("//a[text()=‘Rooms']
")
Why do we need automated UI test case repair?
Web
application
Test
cases
Write
Tester
s
Click
Manual test case repair is time-consuming and labor-intensive.
There is a hope for automated tools to assist in repairing test cases.
Find the new locator.
Modify the broken tests.
Make sure the
repaired test cases
run correctly.
4
Click
By.xpath("//a[text()='Admin']") By.xpath("//a[text()=‘Rooms']
")
Why do existing algorithms have insufficient matching accuracy?
driver.findElement(By.xpath("/html/body/form/input[3]")).click();
Thread.sleep(2000);
driver.findElement(By.xpath("//a[text()='Admin']")).click();
....
Assert.assertEquals(driver.findElement(By.xpath("//a[@href='admi
n.php']")).getText(), "Back to Admin");
2
1
3
1
version
1.2.6.1
Part of the broken test case
“DeleteNegativeAreaTest”.
5
3
Why do existing algorithms have insufficient matching accuracy?
driver.findElement(By.xpath("/html/body/form/input[3]")).click();
Thread.sleep(2000);
driver.findElement(By.xpath("//a[text()='Admin']")).click();
....
Assert.assertEquals(driver.findElement(By.xpath("//a[@href='admi
n.php']")).getText(), "Back to Admin");
2
1
3
1
1
version
1.2.6.1
version
1.4.9
1. Visual change (background
color).
2. Text change.
3. Properties change.
Part of the broken test case
“DeleteNegativeAreaTest”.
Self-information:
6
3 3
Part of HTML in the version 1.2.6.1
Part of HTML in the version
1.4.9
Why do existing tools have insufficient matching accuracy?
To improve accuracy ,
SFTM simply uses the
parent node’s properties
to assist in matching the
child nodes.
7
[1] Brisset, Sacha, et al. "SFTM: Fast matching of web pages using Similarity-based Flexible Tree Matching. " Information Systems 112
(2023): 102126.
Part of HTML in the version 1.2.6.1
Part of HTML in the version
1.4.9
the properties of
parent nodes have
also changed
How would a human match these two elements?
1 Match elements with high similarity:
8
Matching elements by
multiple steps.
How would a human match these two elements?
1
2
Match elements with high similarity:
Match the group of three elements because two
elements in this group have already been matched:
9
Matching elements by
multiple steps.
How would a human match these two elements?
1
2
3
“admin.php?day=28;month=01”
Match elements with high similarity:
Match the group of three elements because two
elements in this group have already been matched:
Infer that Admin and Rooms button match because
they have certain similar properties and are
located within the matching region:
10
Matching elements by
multiple steps.
How would a human match these two elements?
 I1: Elements with closer matched
ancestors are more similar.
 I2: Ancestors with more common
leaf elements are more similar.
 I3: Matching elements by multiple
iterations.
Our tool UITESTFIX
based on the following
idea:
11
ancestor
leaf elements
close
r
1 1
2
3
2
We further propose two similarity based on I1 and I2, which will updated
iteratively.
Id Similarity.
The most straightforward similarity metric is
the exact matching of n.id.
To calculate the similarity of text properties,
we use Levenshtein distance.
Property Similarity.
We use TF-IDF to calculate property
similarity, where text, tag and attribute
are used as tokens.
Text Similarity.
01
02
03
Initialize the similarity
matrix.
12
Help Help
Levenshtein distance
Old version New version
TF-IDF
id="chips" id="chips"
Exact
matching
Methodology - Similarity Metrics
13
Closest
matched
ancestors
The length from the
root node element
to the closer
matched ancestors.
Closer matched
ancestors
Matching
relationship
 I1: Elements with closer matched ancestors are more similar.
Methodology - Path Similarity
Region Similarity:
 The proportion of matching
leaf node elements in two
region elements
Old Region Element:
New Region Element:
14
matched
Old leaf node elements:
New leaf node elements:
More matched leaf elements
 I2: Ancestors with more common leaf elements are more similar.
Methodology - Region Similarity
15
Other elements…
Other elements…
I3: Matching elements by multiple iterations.
Methodology - Iterative matching process.
16
1 1
1 1
1
Other elements…
Other elements…
I3: Matching elements by multiple iterations.
Methodology - Iterative matching process.
17
1 1
1 1
1
Other elements…
Other elements…
I3: Matching elements by multiple iterations.
Methodology - Iterative matching process.
18
1 1
1 1
1
2
2
2
2
Other elements…
Other elements…
I3: Matching elements by multiple iterations.
Methodology - Iterative matching process.
19
1 1
1 1
1
2
2
2
2
3
3
Other elements…
Other elements…
The iteration stops at the fourth round since the matching results are no longer
updated.
I3: Matching elements by multiple iterations.
Methodology - Iterative matching process.
Grouping
old
new
Path
Similarity
Region
Similarity
Match Result
Dynamic Repair
GetTopMatch
Id
Similarity
Prop
Simialrity
Text
Similarity
Element Match
Test
Query
Iterative
NoSuchElementException
InvalidElementStateException
Execute the broken action on the matched
element to complete the dynamic repair.
Build the initial similarity matrix.
Iteratively updates similarity.
Outputs the final matching results.
20
Methodology - How does UITESTFIX work?
Evaluation
 UI Match Dataset:  UI Test Dataset:
Effectiveness on Matching Elements. Effectiveness on Repairing UI Tests.
[1] F. Shao, R. Xu, W. Haque, J. Xu, Y. Zhang, W. Yang, Y. Ye, and X. Xiao, “Webevo: taming web application evolution via detecting
semantic structure changes,” in Proceedings of the 30th ACM SIGSOFT International Symposium on Software Testing and Analysis, 2021,
pp. 16–28. 21
Evaluation
Effectiveness on Matching Elements.
22
Publicly
available
web pages.
Industrial
web pages.
Evaluation
 UITESTFIX improved by 16.1% compared to the best existing algorithm.
 With improved accuracy, we believe it is acceptable to take <1s to generate
matching results for each web page.
Effectiveness on Matching Elements.
23
Publicly
available
web pages.
Industrial
web pages.
Evaluation
Effectiveness on Repairing UI Tests.
24
Publicly
available
test
cases.
Industrial
test
cases.
Evaluation
In total, UITESTFIX successfully fixes 113(68%) broken tests, while the best
existing tool only fixes 73(44%) of them.
Effectiveness on Repairing UI Tests.
25
Publicly
available
test
cases.
Industrial
test
cases.
Conclusion
02
A novel iterative matching
algorithm.
We evaluate algorithms on
publicly available and
industrial datasets
26
01
1 of 26

Recommended

React patterns by
React patternsReact patterns
React patternsNaimish Verma
17 views22 slides
AN ENVIRONMENT FOR NON-DUPLICATE TEST GENERATION FOR WEB BASED APPLICATION by
AN ENVIRONMENT FOR NON-DUPLICATE TEST GENERATION FOR WEB BASED APPLICATIONAN ENVIRONMENT FOR NON-DUPLICATE TEST GENERATION FOR WEB BASED APPLICATION
AN ENVIRONMENT FOR NON-DUPLICATE TEST GENERATION FOR WEB BASED APPLICATIONecij
44 views9 slides
Algorithm by
AlgorithmAlgorithm
Algorithmnivlayalat
262 views28 slides
Final ppt by
Final pptFinal ppt
Final pptGyandeep Kansal
169 views22 slides
NEr using N-Gram techniqueppt by
NEr using N-Gram techniquepptNEr using N-Gram techniqueppt
NEr using N-Gram techniquepptGyandeep Kansal
287 views22 slides
Indianapolis mule soft_meetup_14_apr_2021-Review a complex Dataweave Transfor... by
Indianapolis mule soft_meetup_14_apr_2021-Review a complex Dataweave Transfor...Indianapolis mule soft_meetup_14_apr_2021-Review a complex Dataweave Transfor...
Indianapolis mule soft_meetup_14_apr_2021-Review a complex Dataweave Transfor...ikram_ahamed
303 views33 slides

More Related Content

Similar to web test repair.pptx

How AI Helps Students Solve Math Problems by
How AI Helps Students Solve Math ProblemsHow AI Helps Students Solve Math Problems
How AI Helps Students Solve Math ProblemsAmazon Web Services
616 views31 slides
Exp2003 exl ppt_02-continued by
Exp2003 exl ppt_02-continuedExp2003 exl ppt_02-continued
Exp2003 exl ppt_02-continuedlonetree
411 views24 slides
Server Controls of ASP.Net by
Server Controls of ASP.NetServer Controls of ASP.Net
Server Controls of ASP.NetHitesh Santani
8K views151 slides
2310 b 05 by
2310 b 052310 b 05
2310 b 05Krazy Koder
996 views26 slides
Lab1-android by
Lab1-androidLab1-android
Lab1-androidLilia Sfaxi
529 views10 slides
Multi Similarity Measure based Result Merging Strategies in Meta Search Engine by
Multi Similarity Measure based Result Merging Strategies in Meta Search EngineMulti Similarity Measure based Result Merging Strategies in Meta Search Engine
Multi Similarity Measure based Result Merging Strategies in Meta Search EngineIDES Editor
586 views8 slides

Similar to web test repair.pptx(20)

Exp2003 exl ppt_02-continued by lonetree
Exp2003 exl ppt_02-continuedExp2003 exl ppt_02-continued
Exp2003 exl ppt_02-continued
lonetree411 views
Multi Similarity Measure based Result Merging Strategies in Meta Search Engine by IDES Editor
Multi Similarity Measure based Result Merging Strategies in Meta Search EngineMulti Similarity Measure based Result Merging Strategies in Meta Search Engine
Multi Similarity Measure based Result Merging Strategies in Meta Search Engine
IDES Editor586 views
Web Rec Final Report by weichen
Web Rec Final ReportWeb Rec Final Report
Web Rec Final Report
weichen440 views
Object Oriented PHP - PART-1 by Jalpesh Vasa
Object Oriented PHP - PART-1Object Oriented PHP - PART-1
Object Oriented PHP - PART-1
Jalpesh Vasa504 views
Having Fun Building Web Applications (Day 1 Slides) by Clarence Ngoh
Having Fun Building Web Applications (Day 1 Slides)Having Fun Building Web Applications (Day 1 Slides)
Having Fun Building Web Applications (Day 1 Slides)
Clarence Ngoh82 views
IRJET- Semantics based Document Clustering by IRJET Journal
IRJET- Semantics based Document ClusteringIRJET- Semantics based Document Clustering
IRJET- Semantics based Document Clustering
IRJET Journal14 views
IRJET- Machine Learning: Survey, Types and Challenges by IRJET Journal
IRJET- Machine Learning: Survey, Types and ChallengesIRJET- Machine Learning: Survey, Types and Challenges
IRJET- Machine Learning: Survey, Types and Challenges
IRJET Journal47 views
Iisrt zz mamatha by IISRT
Iisrt zz mamathaIisrt zz mamatha
Iisrt zz mamatha
IISRT286 views
ATAGTR2017 The way to recover the issue faced in IoT regression Testing by Agile Testing Alliance
ATAGTR2017 The way to recover the issue faced in IoT regression TestingATAGTR2017 The way to recover the issue faced in IoT regression Testing
ATAGTR2017 The way to recover the issue faced in IoT regression Testing
computer notes - Linked list inside computer memory by ecomputernotes
computer notes - Linked list inside computer memorycomputer notes - Linked list inside computer memory
computer notes - Linked list inside computer memory
ecomputernotes1.1K views

Recently uploaded

Ransomware is Knocking your Door_Final.pdf by
Ransomware is Knocking your Door_Final.pdfRansomware is Knocking your Door_Final.pdf
Ransomware is Knocking your Door_Final.pdfSecurity Bootcamp
96 views46 slides
KVM Security Groups Under the Hood - Wido den Hollander - Your.Online by
KVM Security Groups Under the Hood - Wido den Hollander - Your.OnlineKVM Security Groups Under the Hood - Wido den Hollander - Your.Online
KVM Security Groups Under the Hood - Wido den Hollander - Your.OnlineShapeBlue
221 views19 slides
The Power of Heat Decarbonisation Plans in the Built Environment by
The Power of Heat Decarbonisation Plans in the Built EnvironmentThe Power of Heat Decarbonisation Plans in the Built Environment
The Power of Heat Decarbonisation Plans in the Built EnvironmentIES VE
79 views20 slides
NTGapps NTG LowCode Platform by
NTGapps NTG LowCode Platform NTGapps NTG LowCode Platform
NTGapps NTG LowCode Platform Mustafa Kuğu
423 views30 slides
Confidence in CloudStack - Aron Wagner, Nathan Gleason - Americ by
Confidence in CloudStack - Aron Wagner, Nathan Gleason - AmericConfidence in CloudStack - Aron Wagner, Nathan Gleason - Americ
Confidence in CloudStack - Aron Wagner, Nathan Gleason - AmericShapeBlue
130 views9 slides
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas... by
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...Bernd Ruecker
54 views69 slides

Recently uploaded(20)

KVM Security Groups Under the Hood - Wido den Hollander - Your.Online by ShapeBlue
KVM Security Groups Under the Hood - Wido den Hollander - Your.OnlineKVM Security Groups Under the Hood - Wido den Hollander - Your.Online
KVM Security Groups Under the Hood - Wido den Hollander - Your.Online
ShapeBlue221 views
The Power of Heat Decarbonisation Plans in the Built Environment by IES VE
The Power of Heat Decarbonisation Plans in the Built EnvironmentThe Power of Heat Decarbonisation Plans in the Built Environment
The Power of Heat Decarbonisation Plans in the Built Environment
IES VE79 views
NTGapps NTG LowCode Platform by Mustafa Kuğu
NTGapps NTG LowCode Platform NTGapps NTG LowCode Platform
NTGapps NTG LowCode Platform
Mustafa Kuğu423 views
Confidence in CloudStack - Aron Wagner, Nathan Gleason - Americ by ShapeBlue
Confidence in CloudStack - Aron Wagner, Nathan Gleason - AmericConfidence in CloudStack - Aron Wagner, Nathan Gleason - Americ
Confidence in CloudStack - Aron Wagner, Nathan Gleason - Americ
ShapeBlue130 views
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas... by Bernd Ruecker
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
Bernd Ruecker54 views
Elevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlue by ShapeBlue
Elevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlueElevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlue
Elevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlue
ShapeBlue222 views
Business Analyst Series 2023 - Week 4 Session 8 by DianaGray10
Business Analyst Series 2023 -  Week 4 Session 8Business Analyst Series 2023 -  Week 4 Session 8
Business Analyst Series 2023 - Week 4 Session 8
DianaGray10123 views
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N... by James Anderson
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
James Anderson160 views
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue by ShapeBlue
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlueCloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue
ShapeBlue138 views
Backroll, News and Demo - Pierre Charton, Matthias Dhellin, Ousmane Diarra - ... by ShapeBlue
Backroll, News and Demo - Pierre Charton, Matthias Dhellin, Ousmane Diarra - ...Backroll, News and Demo - Pierre Charton, Matthias Dhellin, Ousmane Diarra - ...
Backroll, News and Demo - Pierre Charton, Matthias Dhellin, Ousmane Diarra - ...
ShapeBlue186 views
Business Analyst Series 2023 - Week 4 Session 7 by DianaGray10
Business Analyst Series 2023 -  Week 4 Session 7Business Analyst Series 2023 -  Week 4 Session 7
Business Analyst Series 2023 - Week 4 Session 7
DianaGray10139 views
Declarative Kubernetes Cluster Deployment with Cloudstack and Cluster API - O... by ShapeBlue
Declarative Kubernetes Cluster Deployment with Cloudstack and Cluster API - O...Declarative Kubernetes Cluster Deployment with Cloudstack and Cluster API - O...
Declarative Kubernetes Cluster Deployment with Cloudstack and Cluster API - O...
ShapeBlue132 views
State of the Union - Rohit Yadav - Apache CloudStack by ShapeBlue
State of the Union - Rohit Yadav - Apache CloudStackState of the Union - Rohit Yadav - Apache CloudStack
State of the Union - Rohit Yadav - Apache CloudStack
ShapeBlue297 views
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ... by ShapeBlue
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...
ShapeBlue184 views
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT by ShapeBlue
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBITUpdates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT
ShapeBlue206 views
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P... by ShapeBlue
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...
ShapeBlue194 views
"Surviving highload with Node.js", Andrii Shumada by Fwdays
"Surviving highload with Node.js", Andrii Shumada "Surviving highload with Node.js", Andrii Shumada
"Surviving highload with Node.js", Andrii Shumada
Fwdays56 views

web test repair.pptx

  • 1. Automated Fixing of Web UI Tests via Iterative Element Matching 1 Yuanzhang Lin∗ Beihang University Beijing, China linyz2020@gmail.com Guoyao Wen Huawei Technologies Co., Ltd. Shenzhen, China wenguoyao@huawei.com Xiang Gao Beihang University Beijing, China xiang_gao@buaa.edu.cn ∗This work was primarily undertaken by the author during his internship at Huawei while studying at the Southern University of Science and Technology. We greatly appreciate the suggestions and effort provided by Shin Hwei Tan. ASE 2023
  • 2. Why do we need automated UI test case repair? Web application Test cases Write Tester s Click 2 Click By.xpath("//a[text()='Admin']")
  • 3. Why do we need automated UI test case repair? Web application Test cases Write Tester s Click Find the new locator. Modify the broken tests. Make sure the repaired test cases run correctly. 3 Click By.xpath("//a[text()='Admin']") By.xpath("//a[text()=‘Rooms'] ")
  • 4. Why do we need automated UI test case repair? Web application Test cases Write Tester s Click Manual test case repair is time-consuming and labor-intensive. There is a hope for automated tools to assist in repairing test cases. Find the new locator. Modify the broken tests. Make sure the repaired test cases run correctly. 4 Click By.xpath("//a[text()='Admin']") By.xpath("//a[text()=‘Rooms'] ")
  • 5. Why do existing algorithms have insufficient matching accuracy? driver.findElement(By.xpath("/html/body/form/input[3]")).click(); Thread.sleep(2000); driver.findElement(By.xpath("//a[text()='Admin']")).click(); .... Assert.assertEquals(driver.findElement(By.xpath("//a[@href='admi n.php']")).getText(), "Back to Admin"); 2 1 3 1 version 1.2.6.1 Part of the broken test case “DeleteNegativeAreaTest”. 5 3
  • 6. Why do existing algorithms have insufficient matching accuracy? driver.findElement(By.xpath("/html/body/form/input[3]")).click(); Thread.sleep(2000); driver.findElement(By.xpath("//a[text()='Admin']")).click(); .... Assert.assertEquals(driver.findElement(By.xpath("//a[@href='admi n.php']")).getText(), "Back to Admin"); 2 1 3 1 1 version 1.2.6.1 version 1.4.9 1. Visual change (background color). 2. Text change. 3. Properties change. Part of the broken test case “DeleteNegativeAreaTest”. Self-information: 6 3 3 Part of HTML in the version 1.2.6.1 Part of HTML in the version 1.4.9
  • 7. Why do existing tools have insufficient matching accuracy? To improve accuracy , SFTM simply uses the parent node’s properties to assist in matching the child nodes. 7 [1] Brisset, Sacha, et al. "SFTM: Fast matching of web pages using Similarity-based Flexible Tree Matching. " Information Systems 112 (2023): 102126. Part of HTML in the version 1.2.6.1 Part of HTML in the version 1.4.9 the properties of parent nodes have also changed
  • 8. How would a human match these two elements? 1 Match elements with high similarity: 8 Matching elements by multiple steps.
  • 9. How would a human match these two elements? 1 2 Match elements with high similarity: Match the group of three elements because two elements in this group have already been matched: 9 Matching elements by multiple steps.
  • 10. How would a human match these two elements? 1 2 3 “admin.php?day=28;month=01” Match elements with high similarity: Match the group of three elements because two elements in this group have already been matched: Infer that Admin and Rooms button match because they have certain similar properties and are located within the matching region: 10 Matching elements by multiple steps.
  • 11. How would a human match these two elements?  I1: Elements with closer matched ancestors are more similar.  I2: Ancestors with more common leaf elements are more similar.  I3: Matching elements by multiple iterations. Our tool UITESTFIX based on the following idea: 11 ancestor leaf elements close r 1 1 2 3 2 We further propose two similarity based on I1 and I2, which will updated iteratively.
  • 12. Id Similarity. The most straightforward similarity metric is the exact matching of n.id. To calculate the similarity of text properties, we use Levenshtein distance. Property Similarity. We use TF-IDF to calculate property similarity, where text, tag and attribute are used as tokens. Text Similarity. 01 02 03 Initialize the similarity matrix. 12 Help Help Levenshtein distance Old version New version TF-IDF id="chips" id="chips" Exact matching Methodology - Similarity Metrics
  • 13. 13 Closest matched ancestors The length from the root node element to the closer matched ancestors. Closer matched ancestors Matching relationship  I1: Elements with closer matched ancestors are more similar. Methodology - Path Similarity
  • 14. Region Similarity:  The proportion of matching leaf node elements in two region elements Old Region Element: New Region Element: 14 matched Old leaf node elements: New leaf node elements: More matched leaf elements  I2: Ancestors with more common leaf elements are more similar. Methodology - Region Similarity
  • 15. 15 Other elements… Other elements… I3: Matching elements by multiple iterations. Methodology - Iterative matching process.
  • 16. 16 1 1 1 1 1 Other elements… Other elements… I3: Matching elements by multiple iterations. Methodology - Iterative matching process.
  • 17. 17 1 1 1 1 1 Other elements… Other elements… I3: Matching elements by multiple iterations. Methodology - Iterative matching process.
  • 18. 18 1 1 1 1 1 2 2 2 2 Other elements… Other elements… I3: Matching elements by multiple iterations. Methodology - Iterative matching process.
  • 19. 19 1 1 1 1 1 2 2 2 2 3 3 Other elements… Other elements… The iteration stops at the fourth round since the matching results are no longer updated. I3: Matching elements by multiple iterations. Methodology - Iterative matching process.
  • 20. Grouping old new Path Similarity Region Similarity Match Result Dynamic Repair GetTopMatch Id Similarity Prop Simialrity Text Similarity Element Match Test Query Iterative NoSuchElementException InvalidElementStateException Execute the broken action on the matched element to complete the dynamic repair. Build the initial similarity matrix. Iteratively updates similarity. Outputs the final matching results. 20 Methodology - How does UITESTFIX work?
  • 21. Evaluation  UI Match Dataset:  UI Test Dataset: Effectiveness on Matching Elements. Effectiveness on Repairing UI Tests. [1] F. Shao, R. Xu, W. Haque, J. Xu, Y. Zhang, W. Yang, Y. Ye, and X. Xiao, “Webevo: taming web application evolution via detecting semantic structure changes,” in Proceedings of the 30th ACM SIGSOFT International Symposium on Software Testing and Analysis, 2021, pp. 16–28. 21
  • 22. Evaluation Effectiveness on Matching Elements. 22 Publicly available web pages. Industrial web pages.
  • 23. Evaluation  UITESTFIX improved by 16.1% compared to the best existing algorithm.  With improved accuracy, we believe it is acceptable to take <1s to generate matching results for each web page. Effectiveness on Matching Elements. 23 Publicly available web pages. Industrial web pages.
  • 24. Evaluation Effectiveness on Repairing UI Tests. 24 Publicly available test cases. Industrial test cases.
  • 25. Evaluation In total, UITESTFIX successfully fixes 113(68%) broken tests, while the best existing tool only fixes 73(44%) of them. Effectiveness on Repairing UI Tests. 25 Publicly available test cases. Industrial test cases.
  • 26. Conclusion 02 A novel iterative matching algorithm. We evaluate algorithms on publicly available and industrial datasets 26 01

Editor's Notes

  1. Hello! everyone. I'm yuanzhang lin from beihang university. I'm going to present our work "Automated Fixing of Web UI Tests via Iterative Element Matching". This work is a collaboration between Beihang University , Sustech and Huawei. I greatly appreciate the suggestions and effort provided by my master supervsor Shin Hwei Tan.
  2. Generally, testers write UI test cases for testing a web application. The test case will use the locator to find the element and do action on it.
  3. When the version is updated, some actions will crash because the original locator cannot find the element. The testers needs to find the new locator, use it to replace the crashed locator, and make sure the repaired test cases run correctly.
  4. But manual test case repair is time-consuming and labor-intensive. These is a hope for automated tools to assist in repairing test cases.
  5. There are currently some existing work for UI test cases, and we hope to use an example to explain why existing algorithms have insufficient matching accuracy. This is a part of the broken test case. The test case will click the Admin button in the third step.
  6. However, in the new version, the "Admin" button has changed to the "Rooms" button. Some information of the element, such as visual information, text, and properties, has been changed. For example, the background color of this button changes from light blue to dark blue. Therefore, some exsiting algorithms , such as WATER、 VISTA and WEBEVO, based on these information can not match this element.
  7. To improve accuracy , SFTM simply uses the parent node's attributes to assist in matching the child nodes. In this picture, parent node is the td element, Since the td element in the new version has no properties, the similarity between td elements is very low. So, the parent nodes can not help the these elements to match and SFTM fails to match these elements.
  8. To further improve accuracy, let us first to see how human match these two elements. Firstly, match elements with high similarity, such as the Help element and the Report element.
  9. Secondly, Match the group of three elements because two elements in this group have already been matched.
  10. Finally, infer that these two buttons match because they have certain similar properties and are located in the matching regions. We can find that human match element by multiple steps.
  11. So, Inspired by human matching methods, we proposed our tool UITESTFIX based on the following idea: The first idea is that elements with closer matched ancestors are more similar. The second idea is that ancestors with more common leaf elements are more similar. The third idea is that matching elements by multiple iterations. We further propose two similarity based on I1 and I2, and them will updated iteratively.
  12. Next we will introduce our method UITESTFIX in more detail. At first, to evaluate similarity of two elements , we use Id similarity, Properties Similarity and Text similarity to initialize the similarity matrix.
  13. Beyond these three similarities, we propose two similarities to use matched elements to help the unmatched element. We proposed path similarity based on idea 1. Given the element, we first collect the path from the root node to the target element, and evaluate the similarity of two path. If the elements with closer matched ancestors, them will have higher path similarity.
  14. We proposed region similarity based on idea 2. Region similarity is the proportion of matching leaf node elements in two region elements. The more leaf elements matched in these two region, the higher the similarity of the region elements. For example, in this picture, the search element has been matched and it will increase the similarity of these two region elements.
  15. The core idea of UITESTFIX is the iterative matching process, which is based on the idea 3.
  16. During the first iteration, some highly similar elements successfully matched.
  17. Based on the existing matching results, the similarity of some elements improved. For example, the similarity of this element improved because all of its leaf nodes successfully matched.
  18. Therefore, these is the the matching results after the second iteration .
  19. The second iteration's matching results increased the path similarity of the Admin button and the input element, leading to a successful match. The iteration stops at the fourth round since the matching results are no longer updated.
  20. So, let's look at how UITESTFIX works in totally. When a test case throws an exception during the execution, UITESTFIX will catch this exception. Subsequently, UITESTFIX uses three similarities to build the initial similarity, iteratively updates similarity and outputs the final matching results. UITESTFIX will execute the broken action on the matched element to complete the dynamic repair.
  21. We use two datasets to evaluate algorithms. The UI match dataset is used to evaluate the performance of element matching, while the UI test dataset is used to evaluate the performance of test case repair.
  22. First, we want to know the effectiveness on matching elements. From the experimental results, we can see that UITESTFIX improved by 16.1% compared to the best existing algorithm. With improved accuracy, we believe it is acceptable to take less than one second to generate matching result.
  23. First, we want to know the effectiveness on matching elements. From the experimental results, we can see that UITESTFIX improved by 16.1% compared to the best existing algorithm. With improved accuracy, we believe it is acceptable to take less than one second to generate matching result.
  24. The table shows the effectiveness on repairing UI tests, UITESTFIX successfully fixes 113 broken test cases, while the best existing tool only fixes 73 of them.
  25. The table shows the effectiveness on repairing UI tests, UITESTFIX successfully fixes 113 broken test cases, while the best existing tool only fixes 73 of them.
  26. In conclusion, we proposed UITESTFIX, an approach based on a novel iterative matching algorithm for fixing broken UI tests. Then, we evaluate algorithms on publicly available and industrial datasets. UITESTFIX outperforms four existing approaches in producing more accurate matching and correct repairs. That’s all of my presentation, thank you for your listening.