SlideShare a Scribd company logo
Leveraging Existing Tests in 
Automated 
Test Generation for Web 
Applications 
Amin Milani Fard Mehdi Mirzaaghaei Ali Mesbah 
ASE 2014
2 
Testing web applications
3
Manual DOM-based testing 
Very useful because of the domain knowledge of test developers, but … 
4 
Incomplete
Automated testing 
Challenges of automated methods: 
• Proper input values 
• Choosing paths to explore 
• Generating effective assertions 
5
Combining manual and automated 
tests 
- Input data and sequence 
- DOM elements to be 
asserted 
6 
- Automated crawling 
- Automated test case 
generation
7 
IDEA 
Initial State-Flow Graph 
Extended State-Flow Graph 
Human-written 
test cases 
Generated 
test cases
Testilizer: our technique and tool 
Eliminate 
failing 
assertions 
10
Exploring alternative paths 
13 
• Remain close to the manual-test paths. 
• Randomly select a manual-test state with 
unexercised candidate clickables and 
navigates the application through that state. 
• Rationale: Diverging too much from the 
manual-test paths makes the human-written 
assertions too disparate and less 
useful.
14 
Initial State-Flow Graph 
Extended State-Flow Graph
Regenerating assertions 
Leveraging asserted DOM patterns in existing test suites: 
1) Reusing the same assertion 
2) Regenerating assertions for exact DOM element/region match 
3) Generating assertions for similar DOM region match 
15
Assertion reuse 
An assertion on a shared state can be reused for a new test 
case. 
16
Assertion regeneration 
Repetition-based assertion regeneration 
1. exact element-based assertions 
2. exact region-based assertions 
17 
Checked Element 
Checked Element Region
Generating similar region 
assertions 
Inexact element/region repetition of a checked element/region can also be 
important for testing. 
18 
<div id="header"> 
<div id="nav"> 
<div id="article"> <div id="sidebar"> 
<div id="section"> 
<div id="footer"> 
<div id="header"> 
<div id="nav"> 
<span id="main"> <span 
<div id="footer"> 
id="menue"> 
<span id="content">
Learning assertions for similar 
regions 
A classification problem: 
• Is a block level DOM element important to be checked by an 
assertion? 
We apply machine learning to train a classier 
• Features: BlockCenterX*, BlockCenterY*, BlockWidth*, BlockHeight*, 
TextImportance, InnerHtmlLength,* LinkNum, ChildrenNum 
19 
* Song et al. [SIGKDD Explorations’04]
Assertion minimization 
Assertions should be reduced for maintainability 
• Avoiding redundant assertions 
• Prioritizing assertions 
1. Original assertions 
2. Reused, and exact element/region assertions 
3. Similar region assertions 
20
Implementation 
21 
Instrument Test suite 
State-space exploration 
Learning assertions
22 
Evaluation 
• Effectiveness of the generated assertions 
• Original test suite information (input data, 
sequences, and assertions) usage 
• Code coverage improvement
23 
Controlled experiment 
Test Suite Sequence Generation Assertion Generation 
ORIG Manual Manual 
Testilizer (EXND+AR) 
Traversing extended SFG 
EXND+RND 
Traversing extended SFG 
RAND+RND 
Traversing random SFG 
Objects: 4 open source web apps 
(EXND) 
Assertion regeneration 
(AR) 
(EXND) 
Random (RND) 
(RAND) 
Random (RND) 
Applied DOM, jQuery, and XHR mutation operators at the JavaScript code 
level 
Constraints: 5 minutes exploration time, max 5 generated assertions per 
state
24 
Fault detection capability
Test model and info usage stats 
25 
65 
54 
43 
32 
21 
10 
ORIG RAND EXND (ours) 
# States 
# Transitions 
# Test Cases 
125% 
100% 
75% 
50% 
25% 
0% 
ORIG RAND EXND (ours) 
Orig State Coverage 
Orig Transition 
Coverage 
Orig Input Data Usage 
Orig Assertion Usage 
11% 
12% 
31% 
45% 
Original 
Reused 
Exact Generated 
Similar Generated 
Avg % of generated assertions by Testilizer
Code coverage 
Increasing client-side code coverage was not the main goal. 
26 
33% 
26% 
20% 
13% 
7% 
0% 
ORIG RAND EXND (ours) 
Code coverge
27 
Summary

More Related Content

What's hot

Ppt Qtp
Ppt QtpPpt Qtp
Ppt Qtp
rosaleenm
 
Qtp Presentation
Qtp PresentationQtp Presentation
Qtp Presentation
techgajanan
 
QTP Power Point Presentation
QTP Power Point PresentationQTP Power Point Presentation
QTP Power Point Presentation
SVRTechnologies
 
Qtp
QtpQtp
Qtp
mindq
 
Tests and Testability: Apex Structure and Strategy
Tests and Testability: Apex Structure and StrategyTests and Testability: Apex Structure and Strategy
Tests and Testability: Apex Structure and Strategy
Salesforce Developers
 
Unit Testing
Unit TestingUnit Testing
Unit Testing
Sergey Podolsky
 
Unit test
Unit testUnit test
Unit test
Tran Duc
 
Hp quick test professional 10
Hp quick test professional 10Hp quick test professional 10
Hp quick test professional 10
Sap Tao Bpt
 
Unit testing - the hard parts
Unit testing - the hard partsUnit testing - the hard parts
Unit testing - the hard parts
Shaun Abram
 
Unit Testing And Mocking
Unit Testing And MockingUnit Testing And Mocking
Unit Testing And Mocking
Joe Wilson
 
Unit testing and mocking in Python - PyCon 2018 - Kenya
Unit testing and mocking in Python - PyCon 2018 - KenyaUnit testing and mocking in Python - PyCon 2018 - Kenya
Unit testing and mocking in Python - PyCon 2018 - Kenya
Erick M'bwana
 
Tdd & unit test
Tdd & unit testTdd & unit test
Tdd & unit test
GomathiNayagam S
 
White Box Testing
White Box TestingWhite Box Testing
White Box Testing
Alisha Roy
 
Best practices unit testing
Best practices unit testing Best practices unit testing
Best practices unit testing
Tricode (part of Dept)
 
What Do the Asserts in a Unit Test Tell Us About Code Quality? (CSMR2013)
What Do the Asserts in a Unit Test Tell Us About Code Quality? (CSMR2013)What Do the Asserts in a Unit Test Tell Us About Code Quality? (CSMR2013)
What Do the Asserts in a Unit Test Tell Us About Code Quality? (CSMR2013)
Maurício Aniche
 
Unit Testing Concepts and Best Practices
Unit Testing Concepts and Best PracticesUnit Testing Concepts and Best Practices
Unit Testing Concepts and Best Practices
Derek Smith
 
Pitfalls Of Tdd Adoption by Bartosz Bankowski
Pitfalls Of Tdd Adoption by Bartosz BankowskiPitfalls Of Tdd Adoption by Bartosz Bankowski
Pitfalls Of Tdd Adoption by Bartosz Bankowski
Agileee
 
Workshop unit test
Workshop   unit testWorkshop   unit test
Workshop unit test
Francesco Garavaglia
 
Software testdesign
Software testdesignSoftware testdesign
Software testdesign
柏宇 陳
 
Moq presentation
Moq presentationMoq presentation
Moq presentation
LynxStar
 

What's hot (20)

Ppt Qtp
Ppt QtpPpt Qtp
Ppt Qtp
 
Qtp Presentation
Qtp PresentationQtp Presentation
Qtp Presentation
 
QTP Power Point Presentation
QTP Power Point PresentationQTP Power Point Presentation
QTP Power Point Presentation
 
Qtp
QtpQtp
Qtp
 
Tests and Testability: Apex Structure and Strategy
Tests and Testability: Apex Structure and StrategyTests and Testability: Apex Structure and Strategy
Tests and Testability: Apex Structure and Strategy
 
Unit Testing
Unit TestingUnit Testing
Unit Testing
 
Unit test
Unit testUnit test
Unit test
 
Hp quick test professional 10
Hp quick test professional 10Hp quick test professional 10
Hp quick test professional 10
 
Unit testing - the hard parts
Unit testing - the hard partsUnit testing - the hard parts
Unit testing - the hard parts
 
Unit Testing And Mocking
Unit Testing And MockingUnit Testing And Mocking
Unit Testing And Mocking
 
Unit testing and mocking in Python - PyCon 2018 - Kenya
Unit testing and mocking in Python - PyCon 2018 - KenyaUnit testing and mocking in Python - PyCon 2018 - Kenya
Unit testing and mocking in Python - PyCon 2018 - Kenya
 
Tdd & unit test
Tdd & unit testTdd & unit test
Tdd & unit test
 
White Box Testing
White Box TestingWhite Box Testing
White Box Testing
 
Best practices unit testing
Best practices unit testing Best practices unit testing
Best practices unit testing
 
What Do the Asserts in a Unit Test Tell Us About Code Quality? (CSMR2013)
What Do the Asserts in a Unit Test Tell Us About Code Quality? (CSMR2013)What Do the Asserts in a Unit Test Tell Us About Code Quality? (CSMR2013)
What Do the Asserts in a Unit Test Tell Us About Code Quality? (CSMR2013)
 
Unit Testing Concepts and Best Practices
Unit Testing Concepts and Best PracticesUnit Testing Concepts and Best Practices
Unit Testing Concepts and Best Practices
 
Pitfalls Of Tdd Adoption by Bartosz Bankowski
Pitfalls Of Tdd Adoption by Bartosz BankowskiPitfalls Of Tdd Adoption by Bartosz Bankowski
Pitfalls Of Tdd Adoption by Bartosz Bankowski
 
Workshop unit test
Workshop   unit testWorkshop   unit test
Workshop unit test
 
Software testdesign
Software testdesignSoftware testdesign
Software testdesign
 
Moq presentation
Moq presentationMoq presentation
Moq presentation
 

Viewers also liked

Web services testing
Web services testingWeb services testing
Web services testing
rammikn
 
Unbox yourself Into Testing
Unbox yourself Into TestingUnbox yourself Into Testing
Unbox yourself Into Testing
vodqancr
 
Automated Testing Of Web Applications Using XML
Automated  Testing Of  Web  Applications Using  XMLAutomated  Testing Of  Web  Applications Using  XML
Automated Testing Of Web Applications Using XML
diongillard
 
Inverting The Testing Pyramid
Inverting The Testing PyramidInverting The Testing Pyramid
Inverting The Testing Pyramid
Naresh Jain
 
Web Application Penetration Testing Introduction
Web Application Penetration Testing IntroductionWeb Application Penetration Testing Introduction
Web Application Penetration Testing Introduction
gbud7
 
Test-Driven Development (TDD)
Test-Driven Development (TDD)Test-Driven Development (TDD)
Test-Driven Development (TDD)
Brian Rasmussen
 
Testing web application
Testing web applicationTesting web application
Testing web application
jayashreesaravanan
 
Web Application Testing
Web Application TestingWeb Application Testing
Web Application Testing
Richa Goel
 
Agile Testing Framework - The Art of Automated Testing
Agile Testing Framework - The Art of Automated TestingAgile Testing Framework - The Art of Automated Testing
Agile Testing Framework - The Art of Automated Testing
Dimitri Ponomareff
 
Introduction to Back End Automation Testing - Nguyen Vu Hoang, Hoang Phi
Introduction to Back End Automation Testing - Nguyen Vu Hoang, Hoang PhiIntroduction to Back End Automation Testing - Nguyen Vu Hoang, Hoang Phi
Introduction to Back End Automation Testing - Nguyen Vu Hoang, Hoang Phi
Ho Chi Minh City Software Testing Club
 
Web application testing with Selenium
Web application testing with SeleniumWeb application testing with Selenium
Web application testing with Selenium
Kerry Buckley
 

Viewers also liked (11)

Web services testing
Web services testingWeb services testing
Web services testing
 
Unbox yourself Into Testing
Unbox yourself Into TestingUnbox yourself Into Testing
Unbox yourself Into Testing
 
Automated Testing Of Web Applications Using XML
Automated  Testing Of  Web  Applications Using  XMLAutomated  Testing Of  Web  Applications Using  XML
Automated Testing Of Web Applications Using XML
 
Inverting The Testing Pyramid
Inverting The Testing PyramidInverting The Testing Pyramid
Inverting The Testing Pyramid
 
Web Application Penetration Testing Introduction
Web Application Penetration Testing IntroductionWeb Application Penetration Testing Introduction
Web Application Penetration Testing Introduction
 
Test-Driven Development (TDD)
Test-Driven Development (TDD)Test-Driven Development (TDD)
Test-Driven Development (TDD)
 
Testing web application
Testing web applicationTesting web application
Testing web application
 
Web Application Testing
Web Application TestingWeb Application Testing
Web Application Testing
 
Agile Testing Framework - The Art of Automated Testing
Agile Testing Framework - The Art of Automated TestingAgile Testing Framework - The Art of Automated Testing
Agile Testing Framework - The Art of Automated Testing
 
Introduction to Back End Automation Testing - Nguyen Vu Hoang, Hoang Phi
Introduction to Back End Automation Testing - Nguyen Vu Hoang, Hoang PhiIntroduction to Back End Automation Testing - Nguyen Vu Hoang, Hoang Phi
Introduction to Back End Automation Testing - Nguyen Vu Hoang, Hoang Phi
 
Web application testing with Selenium
Web application testing with SeleniumWeb application testing with Selenium
Web application testing with Selenium
 

Similar to Leveraging Existing Tests in Automated Test Generation for Web Applications

Search-Based Robustness Testing of Data Processing Systems
Search-Based Robustness Testing of Data Processing SystemsSearch-Based Robustness Testing of Data Processing Systems
Search-Based Robustness Testing of Data Processing Systems
Lionel Briand
 
Software Testing: Application And Script Independent Automation Framework: Th...
Software Testing: Application And Script Independent Automation Framework: Th...Software Testing: Application And Script Independent Automation Framework: Th...
Software Testing: Application And Script Independent Automation Framework: Th...
guest0efb5e
 
Enabling Automated Software Testing with Artificial Intelligence
Enabling Automated Software Testing with Artificial IntelligenceEnabling Automated Software Testing with Artificial Intelligence
Enabling Automated Software Testing with Artificial Intelligence
Lionel Briand
 
Automated Testing of Autonomous Driving Assistance Systems
Automated Testing of Autonomous Driving Assistance SystemsAutomated Testing of Autonomous Driving Assistance Systems
Automated Testing of Autonomous Driving Assistance Systems
Lionel Briand
 
Scalable Software Testing and Verification of Non-Functional Properties throu...
Scalable Software Testing and Verification of Non-Functional Properties throu...Scalable Software Testing and Verification of Non-Functional Properties throu...
Scalable Software Testing and Verification of Non-Functional Properties throu...
Lionel Briand
 
Softwar tetesting basic
Softwar tetesting basicSoftwar tetesting basic
Softwar tetesting basic
parekhjigarh
 
Database Unit Testing Made Easy with VSTS
Database Unit Testing Made Easy with VSTSDatabase Unit Testing Made Easy with VSTS
Database Unit Testing Made Easy with VSTS
Sanil Mhatre
 
Testing the Untestable
Testing the UntestableTesting the Untestable
Testing the Untestable
Mark Baker
 
Towards a Macrobenchmark Framework for Performance Analysis of Java Applications
Towards a Macrobenchmark Framework for Performance Analysis of Java ApplicationsTowards a Macrobenchmark Framework for Performance Analysis of Java Applications
Towards a Macrobenchmark Framework for Performance Analysis of Java Applications
Gábor Szárnyas
 
Efficient Validation of Large Models using the Mogwaï Tool
Efficient Validation of Large Models using the Mogwaï ToolEfficient Validation of Large Models using the Mogwaï Tool
Efficient Validation of Large Models using the Mogwaï Tool
Gwendal Daniel
 
Architecture of automated test cases for legacy applications
Architecture of automated test cases for legacy applicationsArchitecture of automated test cases for legacy applications
Architecture of automated test cases for legacy applications
Mikhail Vasylchenko
 
Curiosity and Xray present - In sprint testing: Aligning tests and teams to r...
Curiosity and Xray present - In sprint testing: Aligning tests and teams to r...Curiosity and Xray present - In sprint testing: Aligning tests and teams to r...
Curiosity and Xray present - In sprint testing: Aligning tests and teams to r...
Curiosity Software Ireland
 
Test in action – week 1
Test in action – week 1Test in action – week 1
Test in action – week 1
Yi-Huan Chan
 
Extreme
ExtremeExtreme
Extreme
ESUG
 
Hands-on Experience Model based testing with spec explorer
Hands-on Experience Model based testing with spec explorer Hands-on Experience Model based testing with spec explorer
Hands-on Experience Model based testing with spec explorer
Rachid Kherrazi
 
Mt s11 test_design
Mt s11 test_designMt s11 test_design
Mt s11 test_design
TestingGeeks
 
Javascript-heavy Salesforce Applications
Javascript-heavy Salesforce ApplicationsJavascript-heavy Salesforce Applications
Javascript-heavy Salesforce Applications
Salesforce Developers
 
A Software Testing Intro
A Software Testing IntroA Software Testing Intro
A Software Testing Intro
Evozon Test Lab
 
Automated Acceptance Tests & Tool choice
Automated Acceptance Tests & Tool choiceAutomated Acceptance Tests & Tool choice
Automated Acceptance Tests & Tool choice
toddbr
 
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...
DicodingEvent
 

Similar to Leveraging Existing Tests in Automated Test Generation for Web Applications (20)

Search-Based Robustness Testing of Data Processing Systems
Search-Based Robustness Testing of Data Processing SystemsSearch-Based Robustness Testing of Data Processing Systems
Search-Based Robustness Testing of Data Processing Systems
 
Software Testing: Application And Script Independent Automation Framework: Th...
Software Testing: Application And Script Independent Automation Framework: Th...Software Testing: Application And Script Independent Automation Framework: Th...
Software Testing: Application And Script Independent Automation Framework: Th...
 
Enabling Automated Software Testing with Artificial Intelligence
Enabling Automated Software Testing with Artificial IntelligenceEnabling Automated Software Testing with Artificial Intelligence
Enabling Automated Software Testing with Artificial Intelligence
 
Automated Testing of Autonomous Driving Assistance Systems
Automated Testing of Autonomous Driving Assistance SystemsAutomated Testing of Autonomous Driving Assistance Systems
Automated Testing of Autonomous Driving Assistance Systems
 
Scalable Software Testing and Verification of Non-Functional Properties throu...
Scalable Software Testing and Verification of Non-Functional Properties throu...Scalable Software Testing and Verification of Non-Functional Properties throu...
Scalable Software Testing and Verification of Non-Functional Properties throu...
 
Softwar tetesting basic
Softwar tetesting basicSoftwar tetesting basic
Softwar tetesting basic
 
Database Unit Testing Made Easy with VSTS
Database Unit Testing Made Easy with VSTSDatabase Unit Testing Made Easy with VSTS
Database Unit Testing Made Easy with VSTS
 
Testing the Untestable
Testing the UntestableTesting the Untestable
Testing the Untestable
 
Towards a Macrobenchmark Framework for Performance Analysis of Java Applications
Towards a Macrobenchmark Framework for Performance Analysis of Java ApplicationsTowards a Macrobenchmark Framework for Performance Analysis of Java Applications
Towards a Macrobenchmark Framework for Performance Analysis of Java Applications
 
Efficient Validation of Large Models using the Mogwaï Tool
Efficient Validation of Large Models using the Mogwaï ToolEfficient Validation of Large Models using the Mogwaï Tool
Efficient Validation of Large Models using the Mogwaï Tool
 
Architecture of automated test cases for legacy applications
Architecture of automated test cases for legacy applicationsArchitecture of automated test cases for legacy applications
Architecture of automated test cases for legacy applications
 
Curiosity and Xray present - In sprint testing: Aligning tests and teams to r...
Curiosity and Xray present - In sprint testing: Aligning tests and teams to r...Curiosity and Xray present - In sprint testing: Aligning tests and teams to r...
Curiosity and Xray present - In sprint testing: Aligning tests and teams to r...
 
Test in action – week 1
Test in action – week 1Test in action – week 1
Test in action – week 1
 
Extreme
ExtremeExtreme
Extreme
 
Hands-on Experience Model based testing with spec explorer
Hands-on Experience Model based testing with spec explorer Hands-on Experience Model based testing with spec explorer
Hands-on Experience Model based testing with spec explorer
 
Mt s11 test_design
Mt s11 test_designMt s11 test_design
Mt s11 test_design
 
Javascript-heavy Salesforce Applications
Javascript-heavy Salesforce ApplicationsJavascript-heavy Salesforce Applications
Javascript-heavy Salesforce Applications
 
A Software Testing Intro
A Software Testing IntroA Software Testing Intro
A Software Testing Intro
 
Automated Acceptance Tests & Tool choice
Automated Acceptance Tests & Tool choiceAutomated Acceptance Tests & Tool choice
Automated Acceptance Tests & Tool choice
 
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...
 

More from SALT Lab @ UBC

Hidden-Web Induced by Client-Side Scripting: An Empirical Study
Hidden-Web Induced by Client-Side Scripting: An Empirical StudyHidden-Web Induced by Client-Side Scripting: An Empirical Study
Hidden-Web Induced by Client-Side Scripting: An Empirical Study
SALT Lab @ UBC
 
Efficient JavaScript Mutation Testing
Efficient JavaScript Mutation TestingEfficient JavaScript Mutation Testing
Efficient JavaScript Mutation Testing
SALT Lab @ UBC
 
Automated Analysis of CSS Rules to Support Style Maintenance
Automated Analysis of CSS Rules to Support Style MaintenanceAutomated Analysis of CSS Rules to Support Style Maintenance
Automated Analysis of CSS Rules to Support Style Maintenance
SALT Lab @ UBC
 
Mining Questions Asked by Web Developers
Mining Questions Asked by Web DevelopersMining Questions Asked by Web Developers
Mining Questions Asked by Web Developers
SALT Lab @ UBC
 
Works For Me! Characterizing Non-Reproducible Bug Reports
Works For Me! Characterizing Non-Reproducible Bug ReportsWorks For Me! Characterizing Non-Reproducible Bug Reports
Works For Me! Characterizing Non-Reproducible Bug Reports
SALT Lab @ UBC
 
Vejovis: Suggesting Fixes for JavaScript Faults
Vejovis: Suggesting Fixes for JavaScript FaultsVejovis: Suggesting Fixes for JavaScript Faults
Vejovis: Suggesting Fixes for JavaScript Faults
SALT Lab @ UBC
 
Understanding JavaScript Event-based Interactions
Understanding JavaScript Event-based InteractionsUnderstanding JavaScript Event-based Interactions
Understanding JavaScript Event-based Interactions
SALT Lab @ UBC
 
DOM-based Test Adequacy Criteria for Web Applications
DOM-based Test Adequacy Criteria for Web ApplicationsDOM-based Test Adequacy Criteria for Web Applications
DOM-based Test Adequacy Criteria for Web Applications
SALT Lab @ UBC
 
Dompletion: DOM-Aware JavaScript Code Completion
Dompletion: DOM-Aware JavaScript Code CompletionDompletion: DOM-Aware JavaScript Code Completion
Dompletion: DOM-Aware JavaScript Code Completion
SALT Lab @ UBC
 

More from SALT Lab @ UBC (9)

Hidden-Web Induced by Client-Side Scripting: An Empirical Study
Hidden-Web Induced by Client-Side Scripting: An Empirical StudyHidden-Web Induced by Client-Side Scripting: An Empirical Study
Hidden-Web Induced by Client-Side Scripting: An Empirical Study
 
Efficient JavaScript Mutation Testing
Efficient JavaScript Mutation TestingEfficient JavaScript Mutation Testing
Efficient JavaScript Mutation Testing
 
Automated Analysis of CSS Rules to Support Style Maintenance
Automated Analysis of CSS Rules to Support Style MaintenanceAutomated Analysis of CSS Rules to Support Style Maintenance
Automated Analysis of CSS Rules to Support Style Maintenance
 
Mining Questions Asked by Web Developers
Mining Questions Asked by Web DevelopersMining Questions Asked by Web Developers
Mining Questions Asked by Web Developers
 
Works For Me! Characterizing Non-Reproducible Bug Reports
Works For Me! Characterizing Non-Reproducible Bug ReportsWorks For Me! Characterizing Non-Reproducible Bug Reports
Works For Me! Characterizing Non-Reproducible Bug Reports
 
Vejovis: Suggesting Fixes for JavaScript Faults
Vejovis: Suggesting Fixes for JavaScript FaultsVejovis: Suggesting Fixes for JavaScript Faults
Vejovis: Suggesting Fixes for JavaScript Faults
 
Understanding JavaScript Event-based Interactions
Understanding JavaScript Event-based InteractionsUnderstanding JavaScript Event-based Interactions
Understanding JavaScript Event-based Interactions
 
DOM-based Test Adequacy Criteria for Web Applications
DOM-based Test Adequacy Criteria for Web ApplicationsDOM-based Test Adequacy Criteria for Web Applications
DOM-based Test Adequacy Criteria for Web Applications
 
Dompletion: DOM-Aware JavaScript Code Completion
Dompletion: DOM-Aware JavaScript Code CompletionDompletion: DOM-Aware JavaScript Code Completion
Dompletion: DOM-Aware JavaScript Code Completion
 

Recently uploaded

ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
Green Software Development
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
 
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise EditionWhy Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Envertis Software Solutions
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
Boni García
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
SOCRadar
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
Deuglo Infosystem Pvt Ltd
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
Alina Yurenko
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
Remote DBA Services
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
Hornet Dynamics
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
Rakesh Kumar R
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
Hironori Washizaki
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
Peter Muessig
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Neo4j
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
Gerardo Pardo-Castellote
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
Hornet Dynamics
 

Recently uploaded (20)

ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
 
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise EditionWhy Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
 

Leveraging Existing Tests in Automated Test Generation for Web Applications

  • 1. Leveraging Existing Tests in Automated Test Generation for Web Applications Amin Milani Fard Mehdi Mirzaaghaei Ali Mesbah ASE 2014
  • 2. 2 Testing web applications
  • 3. 3
  • 4. Manual DOM-based testing Very useful because of the domain knowledge of test developers, but … 4 Incomplete
  • 5. Automated testing Challenges of automated methods: • Proper input values • Choosing paths to explore • Generating effective assertions 5
  • 6. Combining manual and automated tests - Input data and sequence - DOM elements to be asserted 6 - Automated crawling - Automated test case generation
  • 7. 7 IDEA Initial State-Flow Graph Extended State-Flow Graph Human-written test cases Generated test cases
  • 8. Testilizer: our technique and tool Eliminate failing assertions 10
  • 9. Exploring alternative paths 13 • Remain close to the manual-test paths. • Randomly select a manual-test state with unexercised candidate clickables and navigates the application through that state. • Rationale: Diverging too much from the manual-test paths makes the human-written assertions too disparate and less useful.
  • 10. 14 Initial State-Flow Graph Extended State-Flow Graph
  • 11. Regenerating assertions Leveraging asserted DOM patterns in existing test suites: 1) Reusing the same assertion 2) Regenerating assertions for exact DOM element/region match 3) Generating assertions for similar DOM region match 15
  • 12. Assertion reuse An assertion on a shared state can be reused for a new test case. 16
  • 13. Assertion regeneration Repetition-based assertion regeneration 1. exact element-based assertions 2. exact region-based assertions 17 Checked Element Checked Element Region
  • 14. Generating similar region assertions Inexact element/region repetition of a checked element/region can also be important for testing. 18 <div id="header"> <div id="nav"> <div id="article"> <div id="sidebar"> <div id="section"> <div id="footer"> <div id="header"> <div id="nav"> <span id="main"> <span <div id="footer"> id="menue"> <span id="content">
  • 15. Learning assertions for similar regions A classification problem: • Is a block level DOM element important to be checked by an assertion? We apply machine learning to train a classier • Features: BlockCenterX*, BlockCenterY*, BlockWidth*, BlockHeight*, TextImportance, InnerHtmlLength,* LinkNum, ChildrenNum 19 * Song et al. [SIGKDD Explorations’04]
  • 16. Assertion minimization Assertions should be reduced for maintainability • Avoiding redundant assertions • Prioritizing assertions 1. Original assertions 2. Reused, and exact element/region assertions 3. Similar region assertions 20
  • 17. Implementation 21 Instrument Test suite State-space exploration Learning assertions
  • 18. 22 Evaluation • Effectiveness of the generated assertions • Original test suite information (input data, sequences, and assertions) usage • Code coverage improvement
  • 19. 23 Controlled experiment Test Suite Sequence Generation Assertion Generation ORIG Manual Manual Testilizer (EXND+AR) Traversing extended SFG EXND+RND Traversing extended SFG RAND+RND Traversing random SFG Objects: 4 open source web apps (EXND) Assertion regeneration (AR) (EXND) Random (RND) (RAND) Random (RND) Applied DOM, jQuery, and XHR mutation operators at the JavaScript code level Constraints: 5 minutes exploration time, max 5 generated assertions per state
  • 20. 24 Fault detection capability
  • 21. Test model and info usage stats 25 65 54 43 32 21 10 ORIG RAND EXND (ours) # States # Transitions # Test Cases 125% 100% 75% 50% 25% 0% ORIG RAND EXND (ours) Orig State Coverage Orig Transition Coverage Orig Input Data Usage Orig Assertion Usage 11% 12% 31% 45% Original Reused Exact Generated Similar Generated Avg % of generated assertions by Testilizer
  • 22. Code coverage Increasing client-side code coverage was not the main goal. 26 33% 26% 20% 13% 7% 0% ORIG RAND EXND (ours) Code coverge

Editor's Notes

  1. This is a join work with Mehdi Mirzaaghaei and Ali Mesbah at University of british Columbia, on leveraging existing test cases to generate new tests for web applications, which is also an industry demand.
  2. Modern web apps are composed of multiple languages such as HTML, JS, CSS, and server-side code which get rendered by a web browser to show the application’s runtime DOM. To avoid dealing with these interactions separately, developers test the correct behaviour of a web app through its manifested DOM, using testing frameworks such as Selenium or CasperJS. These frameworks provide APIs to write test scripts for functional testing of web applications.
  3. This is a test case for testing add note in the Organizer app.
  4. Manually written tests are valuable for their domain knowledge. Writing test cases manually, even by using record and replay tools, is very time consuming and the result is not complete. Therefore there is a need for automated tools.
  5. Many automated testing techniques are based on crawling to explore the state space of the application. Limitations: Input values: Generating proper input values (such as form data) automatically is challenging. Paths to explore: Which paths are more important for testing? Blind paths exploration may results in obtaining a partial coverage of a specific region of the application. Assertions: Generating proper assertions automatically without human knowledge is known to be challenging. Many web testing techniques rely on generic invariants or standard validators.
  6. Using the human domain knowledge in tests: provide valid input data know what DOM elements should be asserted and how. We propose to 1) mine the human knowledge existing in manually-written test cases 2) combine that knowledge with the power of automated crawling 3) extend the test suite for uncovered/unchecked portions of the app
  7. We instrument the test suite to collect information about DOM interactions such as elements accessed in actions (e.g., clicks) and assertions as well as the structure of the DOM states covered. We instrument all DOM related method calls and calls with arguments that have DOM element locaters. A test operation is a triple <action, target, input>, where action species an event-based action (e.g., a click), or an assertion (e.g., verifying a text), target pertains to the DOM element to perform the action on, and input species input values (e.g., data for filling a form). We make sure that the generated assertions are stable, i.e., do not falsely fail, when running the test suite on an unmodified version of the app. Some of these assertions are not only DOM related but also depend on the specific path through which the DOM state is reached. Our technique automatically identifies and filters these false positive cases from the generated test suite.
  8. We instrument the test suite to collect information about DOM interactions such as elements accessed in actions (e.g., clicks) and assertions as well as the structure of the DOM states covered. We instrument all DOM related method calls and calls with arguments that have DOM element locaters. A test operation is a triple <action, target, input>, where action species an event-based action (e.g., a click), or an assertion (e.g., verifying a text), target pertains to the DOM element to perform the action on, and input species input values (e.g., data for filling a form). We make sure that the generated assertions are stable, i.e., do not falsely fail, when running the test suite on an unmodified version of the app. Some of these assertions are not only DOM related but also depend on the specific path through which the DOM state is reached. Our technique automatically identifies and filters these false positive cases from the generated test suite.
  9. Regenerating assertions is a major contribution of this work. These assertions basically checks the existence of a DOM element or its attribute and textual values. Based on the concept of matching, partial matching, and similar matching, We generate new assertions by leveraging DOM patterns in test suites.
  10. s1 is shared among many other paths from Index to s5. Assertions on s1 can be exactly reused for generated test cases exercising alternative paths.
  11. Full exact match vs partial exact match region-based assertions
  12. Avoiding redundant assertions: Assertions that are subsumed by other assertions are redundant and safely eliminated Prioritizing assertions: We prioritize assertions in each state in the order of specification/constraint: the original assertions the reused, the exact element/region assertion assertions similar region assertions
  13. Our approach is implemented as an open source project available for download from out guithub repository
  14. To evaluate our approach we answer three research questions.
  15. Compared test suite generated by 1. human tester (ORIG) 2. Testilizer: traversing the extended SFG and generating assertions (EXND+AR) 3. traversing the extended SFG and random assertion generation (EXND+RND) 4. random exploration and random assertion generation (RAND+RND)
  16. Testilizer, on average: 12% original assertions, 11% reused assertions, 31% exact generated assertions, and 45% of similar learned assertions.
  17. summary