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 de 26

Recomendados

React patterns por
React patternsReact patterns
React patternsNaimish Verma
17 visualizações22 slides
AN ENVIRONMENT FOR NON-DUPLICATE TEST GENERATION FOR WEB BASED APPLICATION por
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 visualizações9 slides
Algorithm por
AlgorithmAlgorithm
Algorithmnivlayalat
262 visualizações28 slides
Final ppt por
Final pptFinal ppt
Final pptGyandeep Kansal
169 visualizações22 slides
NEr using N-Gram techniqueppt por
NEr using N-Gram techniquepptNEr using N-Gram techniqueppt
NEr using N-Gram techniquepptGyandeep Kansal
287 visualizações22 slides
Indianapolis mule soft_meetup_14_apr_2021-Review a complex Dataweave Transfor... por
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
301 visualizações33 slides

Mais conteúdo relacionado

Similar a web test repair.pptx

How AI Helps Students Solve Math Problems por
How AI Helps Students Solve Math ProblemsHow AI Helps Students Solve Math Problems
How AI Helps Students Solve Math ProblemsAmazon Web Services
615 visualizações31 slides
Exp2003 exl ppt_02-continued por
Exp2003 exl ppt_02-continuedExp2003 exl ppt_02-continued
Exp2003 exl ppt_02-continuedlonetree
411 visualizações24 slides
Server Controls of ASP.Net por
Server Controls of ASP.NetServer Controls of ASP.Net
Server Controls of ASP.NetHitesh Santani
8K visualizações151 slides
2310 b 05 por
2310 b 052310 b 05
2310 b 05Krazy Koder
996 visualizações26 slides
Lab1-android por
Lab1-androidLab1-android
Lab1-androidLilia Sfaxi
524 visualizações10 slides
Multi Similarity Measure based Result Merging Strategies in Meta Search Engine por
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 visualizações8 slides

Similar a web test repair.pptx(20)

How AI Helps Students Solve Math Problems por Amazon Web Services
How AI Helps Students Solve Math ProblemsHow AI Helps Students Solve Math Problems
How AI Helps Students Solve Math Problems
Amazon Web Services615 visualizações
Exp2003 exl ppt_02-continued por lonetree
Exp2003 exl ppt_02-continuedExp2003 exl ppt_02-continued
Exp2003 exl ppt_02-continued
lonetree411 visualizações
Server Controls of ASP.Net por Hitesh Santani
Server Controls of ASP.NetServer Controls of ASP.Net
Server Controls of ASP.Net
Hitesh Santani8K visualizações
2310 b 05 por Krazy Koder
2310 b 052310 b 05
2310 b 05
Krazy Koder996 visualizações
Lab1-android por Lilia Sfaxi
Lab1-androidLab1-android
Lab1-android
Lilia Sfaxi524 visualizações
Multi Similarity Measure based Result Merging Strategies in Meta Search Engine por 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 visualizações
Web Rec Final Report por weichen
Web Rec Final ReportWeb Rec Final Report
Web Rec Final Report
weichen440 visualizações
Object Oriented PHP - PART-1 por Jalpesh Vasa
Object Oriented PHP - PART-1Object Oriented PHP - PART-1
Object Oriented PHP - PART-1
Jalpesh Vasa503 visualizações
Having Fun Building Web Applications (Day 1 Slides) por 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 Ngoh81 visualizações
Automation frameworks por Vishwanath KC
Automation frameworksAutomation frameworks
Automation frameworks
Vishwanath KC78 visualizações
Page object pattern por Petro Konopelko
Page object patternPage object pattern
Page object pattern
Petro Konopelko1.3K visualizações
IRJET- Semantics based Document Clustering por IRJET Journal
IRJET- Semantics based Document ClusteringIRJET- Semantics based Document Clustering
IRJET- Semantics based Document Clustering
IRJET Journal14 visualizações
IRJET- Machine Learning: Survey, Types and Challenges por IRJET Journal
IRJET- Machine Learning: Survey, Types and ChallengesIRJET- Machine Learning: Survey, Types and Challenges
IRJET- Machine Learning: Survey, Types and Challenges
IRJET Journal47 visualizações
Iisrt zz mamatha por IISRT
Iisrt zz mamathaIisrt zz mamatha
Iisrt zz mamatha
IISRT286 visualizações
Aj35198205 por IJERA Editor
Aj35198205Aj35198205
Aj35198205
IJERA Editor513 visualizações
OOP Assignment 03.pdf por ARSLANMEHMOOD47
OOP Assignment 03.pdfOOP Assignment 03.pdf
OOP Assignment 03.pdf
ARSLANMEHMOOD471.4K visualizações
ATAGTR2017 The way to recover the issue faced in IoT regression Testing por 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
Agile Testing Alliance632 visualizações
computer notes - Linked list inside computer memory por ecomputernotes
computer notes - Linked list inside computer memorycomputer notes - Linked list inside computer memory
computer notes - Linked list inside computer memory
ecomputernotes1.1K visualizações

Último

Empathic Computing: Delivering the Potential of the Metaverse por
Empathic Computing: Delivering  the Potential of the MetaverseEmpathic Computing: Delivering  the Potential of the Metaverse
Empathic Computing: Delivering the Potential of the MetaverseMark Billinghurst
476 visualizações80 slides
SUPPLIER SOURCING.pptx por
SUPPLIER SOURCING.pptxSUPPLIER SOURCING.pptx
SUPPLIER SOURCING.pptxangelicacueva6
14 visualizações1 slide
virtual reality.pptx por
virtual reality.pptxvirtual reality.pptx
virtual reality.pptxG036GaikwadSnehal
11 visualizações15 slides
Kyo - Functional Scala 2023.pdf por
Kyo - Functional Scala 2023.pdfKyo - Functional Scala 2023.pdf
Kyo - Functional Scala 2023.pdfFlavio W. Brasil
298 visualizações92 slides
Transcript: The Details of Description Techniques tips and tangents on altern... por
Transcript: The Details of Description Techniques tips and tangents on altern...Transcript: The Details of Description Techniques tips and tangents on altern...
Transcript: The Details of Description Techniques tips and tangents on altern...BookNet Canada
135 visualizações15 slides
20231123_Camunda Meetup Vienna.pdf por
20231123_Camunda Meetup Vienna.pdf20231123_Camunda Meetup Vienna.pdf
20231123_Camunda Meetup Vienna.pdfPhactum Softwareentwicklung GmbH
33 visualizações73 slides

Último(20)

Empathic Computing: Delivering the Potential of the Metaverse por Mark Billinghurst
Empathic Computing: Delivering  the Potential of the MetaverseEmpathic Computing: Delivering  the Potential of the Metaverse
Empathic Computing: Delivering the Potential of the Metaverse
Mark Billinghurst476 visualizações
SUPPLIER SOURCING.pptx por angelicacueva6
SUPPLIER SOURCING.pptxSUPPLIER SOURCING.pptx
SUPPLIER SOURCING.pptx
angelicacueva614 visualizações
virtual reality.pptx por G036GaikwadSnehal
virtual reality.pptxvirtual reality.pptx
virtual reality.pptx
G036GaikwadSnehal11 visualizações
Kyo - Functional Scala 2023.pdf por Flavio W. Brasil
Kyo - Functional Scala 2023.pdfKyo - Functional Scala 2023.pdf
Kyo - Functional Scala 2023.pdf
Flavio W. Brasil298 visualizações
Transcript: The Details of Description Techniques tips and tangents on altern... por BookNet Canada
Transcript: The Details of Description Techniques tips and tangents on altern...Transcript: The Details of Description Techniques tips and tangents on altern...
Transcript: The Details of Description Techniques tips and tangents on altern...
BookNet Canada135 visualizações
PharoJS - Zürich Smalltalk Group Meetup November 2023 por Noury Bouraqadi
PharoJS - Zürich Smalltalk Group Meetup November 2023PharoJS - Zürich Smalltalk Group Meetup November 2023
PharoJS - Zürich Smalltalk Group Meetup November 2023
Noury Bouraqadi126 visualizações
Network Source of Truth and Infrastructure as Code revisited por Network Automation Forum
Network Source of Truth and Infrastructure as Code revisitedNetwork Source of Truth and Infrastructure as Code revisited
Network Source of Truth and Infrastructure as Code revisited
Network Automation Forum25 visualizações
Tunable Laser (1).pptx por Hajira Mahmood
Tunable Laser (1).pptxTunable Laser (1).pptx
Tunable Laser (1).pptx
Hajira Mahmood24 visualizações
Scaling Knowledge Graph Architectures with AI por Enterprise Knowledge
Scaling Knowledge Graph Architectures with AIScaling Knowledge Graph Architectures with AI
Scaling Knowledge Graph Architectures with AI
Enterprise Knowledge28 visualizações
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ... por Jasper Oosterveld
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...
Jasper Oosterveld13 visualizações
Voice Logger - Telephony Integration Solution at Aegis por Nirmal Sharma
Voice Logger - Telephony Integration Solution at AegisVoice Logger - Telephony Integration Solution at Aegis
Voice Logger - Telephony Integration Solution at Aegis
Nirmal Sharma31 visualizações
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive por Network Automation Forum
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLiveAutomating a World-Class Technology Conference; Behind the Scenes of CiscoLive
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive
Network Automation Forum30 visualizações
Data Integrity for Banking and Financial Services por Precisely
Data Integrity for Banking and Financial ServicesData Integrity for Banking and Financial Services
Data Integrity for Banking and Financial Services
Precisely12 visualizações
Attacking IoT Devices from a Web Perspective - Linux Day por Simone Onofri
Attacking IoT Devices from a Web Perspective - Linux Day Attacking IoT Devices from a Web Perspective - Linux Day
Attacking IoT Devices from a Web Perspective - Linux Day
Simone Onofri15 visualizações
Igniting Next Level Productivity with AI-Infused Data Integration Workflows por Safe Software
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Safe Software257 visualizações
STPI OctaNE CoE Brochure.pdf por madhurjyapb
STPI OctaNE CoE Brochure.pdfSTPI OctaNE CoE Brochure.pdf
STPI OctaNE CoE Brochure.pdf
madhurjyapb13 visualizações

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

Notas do Editor

  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.