SlideShare a Scribd company logo
DOMPLETION 
DOM-Aware JavaScript Code Completion 
An approach to assist the Web Developers in 
writing DOM manipulating JavaScript code 
Kartik Bajaj, Karthik Pattabiraman, Ali Mesbah 
University of British Columbia 
{kbajaj, karthikp, amesbah}@ece.ubc.ca 1
Running Example (JavaScript) 
1. function add(a,b) { 
2. return a + b; 
3. } 
4. 
5. var input1 = 10; 
6. var input2 = 20; 
7. if(input1 != 0) { 
8. var sum = add(input1,input2); 
9. alert(sum); 
10. } else { 
11. var sum = input2; 
12. alert(sum); 
13. } 
2
Document Object Model (DOM) 
document.getElementsByTagName(“input”); 
3 
HTML 
BODY 
DIV 
id=“container” 
INPUT 
class=“val1” 
value=“10” 
INPUT 
class=“val2” 
value=“20” 
BUTTON 
id=“add” 
value=“Add” 
SPAN 
class=“result” 
html=“Result:” 
document.getElementsByClassName(“val1”); 
document.getElementsByClassName(“val2”); 
document.querySelector(“html body #container input”);
DOM JavaScript Interaction 
1. function add(a,b) { 
2. return a + b; 
3. } 
4. 
5. var input1 = 10; 
5’. var input1 = document.getElementsByClassName(“val1”)[0].value; 
6. var input2 = 20; 
6’. var input2 = document.getElementsByClassName(“val2”)[0].value; 
7. if(input1 != 0) { 
8. var sum= add(input1,input2); 
9. alert(sum); 
9’. var html = “<p id=‘true’> + add(input1,input2) + “</p>”; 
9’’. document.getElementById(“result”).innerHTML += html; 
10. } else { 
11. var sum = input2; 
12. alert(input2); 
12’. var html += “<p id=‘false’>” + sum+ “</p>”; 
12’’. document.getElementById(“result”).innerHTML += html; 
13. } 
4
Updated DOM State(s) 
Input 21 
DOM State 0  DOM State 1 
5 
true” 
30” 
HTML 
BODY 
DIV 
id=“container” 
INPUT 
class=“val1” 
value=“10” 
INPUT 
class=“val2” 
value=“20” 
BUTTON 
id=“add” 
value=“Add” 
SPAN 
class=“result” 
html=“Result:” 
P 
id=“false” 
html=“20” 
20 
2
DOM State Transition 
6 
S 2 
S 0 
S 1 
S 4 
S … S N 
S 3 
S 5 
User Input / User Action
Challenges 
7 
Is this class name correct? 
1. function add(a,b) { 
Does 2. return the element a + b; 
exist in DOM? 
3. } 
4. 
5. var input1 = document.getElementsByClassName(“val1”)[0].value; 
6. var input2 = document.getElementsByClassName(“val2”)[0].value; 
7. if(input1 != 0) { 
8. var sum= add(input1,input2); 
9. var html = “<p id=‘true’> + add(input1,input2) + “</p>”; 
10. document.getElementById(“result”).innerHTML += html; 
11. } else { 
12. var sum = input2; 
13. var html += “<p id=‘false’>” + sum+ “</p>”; 
14. document.getElementById(“result”).innerHTML += html; 
15. } 
Does it have the property “value”? 
What is the updated DOM structure?
Straw man Approach 
Manually inspect the DOM 
Develop, Execute, Repeat 
Tedious and time consuming 
8
Problem Statement 
• JavaScript code is challenging to develop and 
analyze 
– Handling interactions between JS and DOM 
[MSR’14][ESEM’13] 
• Lack of tool support [ESEM’13] 
– Instant feedback required 
9
Related Work 
10 
???
Proposed Solution 
Analyze each DOM state and assist the 
developer while writing JavaScript Code 
BUT 
Number of DOM states can be infinite!!! 
11
Intuition 
DOM states exhibit patterns 
12 
HTML 
BODY 
DIV 
id=“container” 
INPUT 
class=“val1” 
value=“10” 
INPUT 
class=“val2” 
value=“20” 
BUTTON 
id=“add” 
value=“Add” 
SPAN 
class=“result” 
html=“Result:” 
HTML 
BODY 
DIV 
id=“container” 
INPUT 
class=“val1” 
value=“10” 
INPUT 
class=“val2” 
value=“20” 
BUTTON 
id=“add” 
value=“Add” 
SPAN 
class=“result” 
html=“Result:” 
P 
id=“true” 
html=“30” 
S 0 S 1
DOM Element Locators 
13 
BODY 
DIV 
id=“container” 
INPUT 
class=“val” 
value=“10” 
INPUT 
class=“val” 
value=“20” 
BUTTON 
id=“add” 
value=“Add” 
SPAN 
class=“result” 
html=“Result:” 
html body div#container input.val1 
html body div#container input.val2 
html body div#container button#add 
html body div#container span.result 
html body div#container input.val1 
html body div#container input.val2 
html body div#container button#add 
html body div#container span.result p#true 
html body div#container input.val1 
html body div#container input.val2 
html body div#container button#add 
html body div#container span.result p#false 
HTML 
p 
id=“false” 
true” 
html=“30” 
S 012
Compression Techniques 
14 
html body div#container input.val1 
html body div#container input.val1.val2 
html body div#container input.val2 
html body div#container input.val{d} 
html body div#container button#add 
html body div#container span.result 
html body div#container input.val1 
html body div#container input.val2 
html body div#container button #add 
html body div#container span.result p#true 
html body div#container span.result 
p#true#flase 
html body div#container input.val1 
html body div#container input.val2 
html body div#container button #add 
Duplicates Removed 
Similar IDs combined 
Similar classes combined
DOM Analysis 
• Manual 
• Automatic 
• Crawl available DOM states. 
• Convert each DOM state to a list of DOM 
Element Locators. 
• Detect patterns in DOM Element Locators. 
15
JavaScript Code Analysis 
16 
1. function add(a,b) { 
2. return a + b; 
3. } 
4. 
5. var input1 = document.getElementsByClassName(“val1”)[0].value; 
6. var input2 = document.getElementsByClassName(“val2”)[0].value; 
7. if(input1 != 0) { 
8. var sum= add(input1,input2); 
9. var html = “<p id=‘true’> + add(input1,input2) + “</p>”; 
10. document.getElementById(“result”).innerHTML += html; 
11. } else { 
12. var sum = input2; 
13. var html += “<p id=‘false’>” + sum+ “</p>”; 
14. document.getElementById(“result”).innerHTML += html; 
15. } 
..... 
if(condition) { 
then-statements; 
} else { 
else-statements; 
..... 
HTML 
BODY 
..... 
condition; 
log true; 
then-statements; 
..... 
..... 
condition; 
then-statements; 
..... 
..... 
condition; 
log false 
else-statements; 
..... 
..... 
condition; 
else-statements; 
..... 
DIV 
id=“container” 
INPUT 
class=“val1” 
value=“10” 
INPUT 
class=“val2” 
value=“20” 
BUTTON 
id=“add” 
value=“Add” 
SPAN 
S0 
class=“result” 
html=“Result:”
HTML 
BODY 
DIV 
id=“container” 
INPUT 
class=“val” 
value=“10” 
INPUT 
class=“val” 
value=“20” 
BUTTON 
id=“add” 
value=“Add” 
SPAN 
class=“result” 
html=“Result:” 
p 
id=“false” 
html=“30” 
HTML 
BODY 
DIV 
id=“container” 
INPUT 
class=“val” 
value=“10” 
INPUT 
class=“val” 
value=“20” 
BUTTON 
id=“add” 
value=“Add” 
SPAN 
class=“result” 
html=“Result:” 
p 
id=“true” 
html=“30” 
Example 
17 
1. function add(a,b) { 
2. return a + b; 
3. } 
4. 
5. var input1 = document.getElementsByClassName(“val1”)[0].value; 
6. var input2 = document.getElementsByClassName(“val2”)[0].value; 
7. input1 != 0; 
8. dompleteLog(“main”,true); 
9. var sum= add(input1,input2); 
10. var html = “<p id=‘true’> + add(input1,input2) + “</p>”; 
11. document.getElementById(“result”).innerHTML += html; 
1. function add(a,b) { 
2. return a + b; 
3. } 
4. 
5. var input1 = document.getElementsByClassName(“val1”)[0].value; 
6. var input2 = document.getElementsByClassName(“val2”)[0].value; 
7. input1 != 0; 
8. dompleteLog(“main”,false); 
9. var sum = input2; 
10. var html += “<p id=‘false’>” + sum+ “</p>”; 
11. document.getElementById(“result”).innerHTML += html; 
S1 
S2
Code Analysis 
• Generate possible code paths 
• Execute JavaScript code 
• Intercept calls to DOM API 
• Analyze Logs 
18
Suggestion Generation 
19 
DOM Analysis 
Output 
CodeAnalysis 
Output 
Suggestions
Approach Summary 
20 
DOM Analysis 
(Phase 1) 
Code Analysis 
(Phase 2) 
Suggestion Generation 
(Phase 3) 
Webapp URL 
JavaScript Code 
Suggestions 
Executed only once 
Executed every time
DOMpletion 
(Brackets IDE Plugin) 
Brackets Live Development 
21 
https://github.com/saltlab/dompletion
Screenshot 
22
Evaluation 
RQ1: Do DOM element locators converge? 
RQ2: How accurate are the code completion suggestions? 
– Precision 
– Recall 
RQ3: What is the performance overhead incurred? 
23
Experimental Objects 
24
RQ1: Convergence 
Crawled each application randomly, until the 
number DOM element locators tend to stabilize. 
25
RQ1: Results 
26 
Phormer 
Number of DOM Element Locators
RQ2: Performance 
Performed code-completion in the existing 
JavaScript Code. 
Compared results with the existing values 
used in the code. 
27
RQ2: Execution 
Actual Suggestion 
28 
1. function add(a,b) { 
2. return a + b; 
“val2” 
3. } 
4. var input1 = document.getElementsByClassName(“val1”)[0].value; 
5. var input2 = document.getElementsByClassName(“val2”)[0].value; 
6. var input2 = document.getElementByClassName(“ 
7. if(input1 != 0) { 
8. var sum= add(input1,input2); 
9. var html = “<p id=‘true’> + add(input1,input2) + “</p>”; 
10. document.getElementById(“result”).innerHTML += html; 
11. } else { 
12. var sum = input2; 
13. var html += “<p id=‘false’>” + sum+ “</p>”; 
14. document.getElementById(“result”).innerHTML += html; 
15. }
RQ2: Results (Recall) 
29
RQ2: Results (Precision) 
30
RQ3: Performance 
DOM Analysis Phase 
• Crawled each web application until DOM element 
locators merge. 
• Recorded time elapsed by the end of each state 
Code Analysis Phase 
• Recorded time taken to list the suggestions 
31
RQ3: Results 
• DOM Analysis 
– 173 seconds (3 minutes approx.) 
• Code Analysis 
– Min time: 1 second 
– Max time: 6 seconds 
– Avg. time: 2.8 seconds 
32 
Incurred only once
User Study 
• 9 Participants 
Group A : Using DOMpletion 
Group B : Without DOMpletion 
• 4 Tasks to analyze the DOM JavaScript 
interactions 
103 
268 
Time (Seconds) 
Group A Group B 
97.50% 90.83% 
47.50% 
76.25% 
Recall Precision 
Group A Group B 33
Contributions 
1. Discussed challenges behind DOM based code completion. 
2. Fully automated code completion technique using static and 
dynamic analysis of JavaScript code and DOM. 
3. Implementation in an open source tool called DOMpletion. 
4. Empirical evaluation to assess DOMpletion. 
https://github.com/saltlab/dompletion 
34 
Up to 83 % Recall and 90% Precision 
2.8 seconds average time

More Related Content

What's hot

A (very) opinionated guide to MSBuild and Project Files
A (very) opinionated guide to MSBuild and Project FilesA (very) opinionated guide to MSBuild and Project Files
A (very) opinionated guide to MSBuild and Project Files
David Wengier
 
Declaring friend function with inline code
Declaring friend function with inline codeDeclaring friend function with inline code
Declaring friend function with inline codeRajeev Sharan
 
Laporan multiclient chatting client server
Laporan multiclient chatting client serverLaporan multiclient chatting client server
Laporan multiclient chatting client servertrilestari08
 
Christopher Latham Portfolio
Christopher Latham PortfolioChristopher Latham Portfolio
Christopher Latham Portfolio
lathamcl
 
GR8Conf 2011: Grails Webflow
GR8Conf 2011: Grails WebflowGR8Conf 2011: Grails Webflow
GR8Conf 2011: Grails WebflowGR8Conf
 
Automatically Repairing Test Cases for Evolving Method Declarations
Automatically Repairing Test Cases for Evolving Method DeclarationsAutomatically Repairing Test Cases for Evolving Method Declarations
Automatically Repairing Test Cases for Evolving Method DeclarationsICSM 2010
 
Let's JavaScript
Let's JavaScriptLet's JavaScript
Let's JavaScript
Paweł Dorofiejczyk
 
Scala on Your Phone
Scala on Your PhoneScala on Your Phone
Scala on Your Phone
Michael Galpin
 
Advanced javascript
Advanced javascriptAdvanced javascript
Advanced javascript
Doeun KOCH
 
Javascript The Good Parts v2
Javascript The Good Parts v2Javascript The Good Parts v2
Javascript The Good Parts v2
Federico Galassi
 
Advanced JavaScript Concepts
Advanced JavaScript ConceptsAdvanced JavaScript Concepts
Advanced JavaScript Concepts
Naresh Kumar
 
Grails transactions
Grails   transactionsGrails   transactions
Grails transactions
Husain Dalal
 
[4developers] The saga pattern v3- Robert Pankowiecki
[4developers] The saga pattern v3- Robert Pankowiecki[4developers] The saga pattern v3- Robert Pankowiecki
[4developers] The saga pattern v3- Robert Pankowiecki
PROIDEA
 
Andriy Slobodyanyk "How to Use Hibernate: Key Problems and Solutions"
Andriy Slobodyanyk "How to Use Hibernate: Key Problems and Solutions"Andriy Slobodyanyk "How to Use Hibernate: Key Problems and Solutions"
Andriy Slobodyanyk "How to Use Hibernate: Key Problems and Solutions"
LogeekNightUkraine
 
Christopher Latham Portfolio
Christopher Latham PortfolioChristopher Latham Portfolio
Christopher Latham Portfolio
lathamcl
 
Promise: async programming hero
Promise: async programming heroPromise: async programming hero
Promise: async programming hero
The Software House
 

What's hot (19)

A (very) opinionated guide to MSBuild and Project Files
A (very) opinionated guide to MSBuild and Project FilesA (very) opinionated guide to MSBuild and Project Files
A (very) opinionated guide to MSBuild and Project Files
 
Declaring friend function with inline code
Declaring friend function with inline codeDeclaring friend function with inline code
Declaring friend function with inline code
 
Laporan multiclient chatting client server
Laporan multiclient chatting client serverLaporan multiclient chatting client server
Laporan multiclient chatting client server
 
Christopher Latham Portfolio
Christopher Latham PortfolioChristopher Latham Portfolio
Christopher Latham Portfolio
 
GR8Conf 2011: Grails Webflow
GR8Conf 2011: Grails WebflowGR8Conf 2011: Grails Webflow
GR8Conf 2011: Grails Webflow
 
Automatically Repairing Test Cases for Evolving Method Declarations
Automatically Repairing Test Cases for Evolving Method DeclarationsAutomatically Repairing Test Cases for Evolving Method Declarations
Automatically Repairing Test Cases for Evolving Method Declarations
 
Let's JavaScript
Let's JavaScriptLet's JavaScript
Let's JavaScript
 
Scala on Your Phone
Scala on Your PhoneScala on Your Phone
Scala on Your Phone
 
Java day9n
Java day9nJava day9n
Java day9n
 
Advanced javascript
Advanced javascriptAdvanced javascript
Advanced javascript
 
Javascript The Good Parts v2
Javascript The Good Parts v2Javascript The Good Parts v2
Javascript The Good Parts v2
 
MaintainStaffTable
MaintainStaffTableMaintainStaffTable
MaintainStaffTable
 
Advanced JavaScript Concepts
Advanced JavaScript ConceptsAdvanced JavaScript Concepts
Advanced JavaScript Concepts
 
Grails transactions
Grails   transactionsGrails   transactions
Grails transactions
 
[4developers] The saga pattern v3- Robert Pankowiecki
[4developers] The saga pattern v3- Robert Pankowiecki[4developers] The saga pattern v3- Robert Pankowiecki
[4developers] The saga pattern v3- Robert Pankowiecki
 
Marcus Portfolio
Marcus  PortfolioMarcus  Portfolio
Marcus Portfolio
 
Andriy Slobodyanyk "How to Use Hibernate: Key Problems and Solutions"
Andriy Slobodyanyk "How to Use Hibernate: Key Problems and Solutions"Andriy Slobodyanyk "How to Use Hibernate: Key Problems and Solutions"
Andriy Slobodyanyk "How to Use Hibernate: Key Problems and Solutions"
 
Christopher Latham Portfolio
Christopher Latham PortfolioChristopher Latham Portfolio
Christopher Latham Portfolio
 
Promise: async programming hero
Promise: async programming heroPromise: async programming hero
Promise: async programming hero
 

Similar to Dompletion: DOM-Aware JavaScript Code Completion

Spicy javascript: Create your first Chrome extension for web analytics QA
Spicy javascript: Create your first Chrome extension for web analytics QASpicy javascript: Create your first Chrome extension for web analytics QA
Spicy javascript: Create your first Chrome extension for web analytics QA
Alban Gérôme
 
Introduction to ReasonML
Introduction to ReasonMLIntroduction to ReasonML
Introduction to ReasonML
Riza Fahmi
 
Perkenalan ReasonML
Perkenalan ReasonMLPerkenalan ReasonML
Perkenalan ReasonML
Riza Fahmi
 
The Beauty of Java Script
The Beauty of Java ScriptThe Beauty of Java Script
The Beauty of Java Script
Michael Girouard
 
The Beauty Of Java Script V5a
The Beauty Of Java Script V5aThe Beauty Of Java Script V5a
The Beauty Of Java Script V5arajivmordani
 
Model-View-Update, and Beyond!
Model-View-Update, and Beyond!Model-View-Update, and Beyond!
Model-View-Update, and Beyond!
Simon Fowler
 
Html5 For Jjugccc2009fall
Html5 For Jjugccc2009fallHtml5 For Jjugccc2009fall
Html5 For Jjugccc2009fall
Shumpei Shiraishi
 
The Ring programming language version 1.10 book - Part 50 of 212
The Ring programming language version 1.10 book - Part 50 of 212The Ring programming language version 1.10 book - Part 50 of 212
The Ring programming language version 1.10 book - Part 50 of 212
Mahmoud Samir Fayed
 
Ajax for dummies, and not only.
Ajax for dummies, and not only.Ajax for dummies, and not only.
Ajax for dummies, and not only.
Nerd Tzanetopoulos
 
Paris js extensions
Paris js extensionsParis js extensions
Paris js extensions
erwanl
 
Bare-knuckle web development
Bare-knuckle web developmentBare-knuckle web development
Bare-knuckle web development
Johannes Brodwall
 
Scti 2011 minicurso jquery
Scti 2011 minicurso jqueryScti 2011 minicurso jquery
Scti 2011 minicurso jquery
ciberglo
 
Novidades do c# 7 e 8
Novidades do c# 7 e 8Novidades do c# 7 e 8
Novidades do c# 7 e 8
Giovanni Bassi
 
Taking Web Apps Offline
Taking Web Apps OfflineTaking Web Apps Offline
Taking Web Apps OfflinePedro Morais
 
CouchDB on Android
CouchDB on AndroidCouchDB on Android
CouchDB on AndroidSven Haiges
 
Play!ng with scala
Play!ng with scalaPlay!ng with scala
Play!ng with scala
Siarzh Miadzvedzeu
 
Service Workers
Service WorkersService Workers
Service Workers
Artur Felipe Sousa
 

Similar to Dompletion: DOM-Aware JavaScript Code Completion (20)

Spicy javascript: Create your first Chrome extension for web analytics QA
Spicy javascript: Create your first Chrome extension for web analytics QASpicy javascript: Create your first Chrome extension for web analytics QA
Spicy javascript: Create your first Chrome extension for web analytics QA
 
Introduction to ReasonML
Introduction to ReasonMLIntroduction to ReasonML
Introduction to ReasonML
 
Perkenalan ReasonML
Perkenalan ReasonMLPerkenalan ReasonML
Perkenalan ReasonML
 
The Beauty of Java Script
The Beauty of Java ScriptThe Beauty of Java Script
The Beauty of Java Script
 
The Beauty Of Java Script V5a
The Beauty Of Java Script V5aThe Beauty Of Java Script V5a
The Beauty Of Java Script V5a
 
Model-View-Update, and Beyond!
Model-View-Update, and Beyond!Model-View-Update, and Beyond!
Model-View-Update, and Beyond!
 
Html5 For Jjugccc2009fall
Html5 For Jjugccc2009fallHtml5 For Jjugccc2009fall
Html5 For Jjugccc2009fall
 
The Ring programming language version 1.10 book - Part 50 of 212
The Ring programming language version 1.10 book - Part 50 of 212The Ring programming language version 1.10 book - Part 50 of 212
The Ring programming language version 1.10 book - Part 50 of 212
 
Ajax for dummies, and not only.
Ajax for dummies, and not only.Ajax for dummies, and not only.
Ajax for dummies, and not only.
 
Paris js extensions
Paris js extensionsParis js extensions
Paris js extensions
 
Bare-knuckle web development
Bare-knuckle web developmentBare-knuckle web development
Bare-knuckle web development
 
Scti 2011 minicurso jquery
Scti 2011 minicurso jqueryScti 2011 minicurso jquery
Scti 2011 minicurso jquery
 
Google Web Toolkit
Google Web ToolkitGoogle Web Toolkit
Google Web Toolkit
 
Novidades do c# 7 e 8
Novidades do c# 7 e 8Novidades do c# 7 e 8
Novidades do c# 7 e 8
 
jQuery introduction
jQuery introductionjQuery introduction
jQuery introduction
 
Taking Web Apps Offline
Taking Web Apps OfflineTaking Web Apps Offline
Taking Web Apps Offline
 
CouchDB on Android
CouchDB on AndroidCouchDB on Android
CouchDB on Android
 
Play!ng with scala
Play!ng with scalaPlay!ng with scala
Play!ng with scala
 
Django quickstart
Django quickstartDjango quickstart
Django quickstart
 
Service Workers
Service WorkersService Workers
Service Workers
 

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
 
Leveraging Existing Tests in Automated Test Generation for Web Applications
Leveraging Existing Tests in Automated Test Generation for Web ApplicationsLeveraging Existing Tests in Automated Test Generation for Web Applications
Leveraging Existing Tests in Automated Test Generation for Web Applications
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
 
Leveraging Existing Tests in Automated Test Generation for Web Applications
Leveraging Existing Tests in Automated Test Generation for Web ApplicationsLeveraging Existing Tests in Automated Test Generation for Web Applications
Leveraging Existing Tests in Automated Test Generation for Web Applications
 

Recently uploaded

Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
Cyanic lab
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
Tier1 app
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
Georgi Kodinov
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
Ortus Solutions, Corp
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
KrzysztofKkol1
 
Advanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should KnowAdvanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should Know
Peter Caitens
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Globus
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
WSO2
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
IES VE
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
Globus
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
Globus
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
informapgpstrackings
 
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Hivelance Technology
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
Software Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdfSoftware Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdf
MayankTawar1
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 
De mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEDe mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FME
Jelle | Nordend
 

Recently uploaded (20)

Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
 
Advanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should KnowAdvanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should Know
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
 
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
Software Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdfSoftware Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdf
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 
De mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEDe mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FME
 

Dompletion: DOM-Aware JavaScript Code Completion

  • 1. DOMPLETION DOM-Aware JavaScript Code Completion An approach to assist the Web Developers in writing DOM manipulating JavaScript code Kartik Bajaj, Karthik Pattabiraman, Ali Mesbah University of British Columbia {kbajaj, karthikp, amesbah}@ece.ubc.ca 1
  • 2. Running Example (JavaScript) 1. function add(a,b) { 2. return a + b; 3. } 4. 5. var input1 = 10; 6. var input2 = 20; 7. if(input1 != 0) { 8. var sum = add(input1,input2); 9. alert(sum); 10. } else { 11. var sum = input2; 12. alert(sum); 13. } 2
  • 3. Document Object Model (DOM) document.getElementsByTagName(“input”); 3 HTML BODY DIV id=“container” INPUT class=“val1” value=“10” INPUT class=“val2” value=“20” BUTTON id=“add” value=“Add” SPAN class=“result” html=“Result:” document.getElementsByClassName(“val1”); document.getElementsByClassName(“val2”); document.querySelector(“html body #container input”);
  • 4. DOM JavaScript Interaction 1. function add(a,b) { 2. return a + b; 3. } 4. 5. var input1 = 10; 5’. var input1 = document.getElementsByClassName(“val1”)[0].value; 6. var input2 = 20; 6’. var input2 = document.getElementsByClassName(“val2”)[0].value; 7. if(input1 != 0) { 8. var sum= add(input1,input2); 9. alert(sum); 9’. var html = “<p id=‘true’> + add(input1,input2) + “</p>”; 9’’. document.getElementById(“result”).innerHTML += html; 10. } else { 11. var sum = input2; 12. alert(input2); 12’. var html += “<p id=‘false’>” + sum+ “</p>”; 12’’. document.getElementById(“result”).innerHTML += html; 13. } 4
  • 5. Updated DOM State(s) Input 21 DOM State 0  DOM State 1 5 true” 30” HTML BODY DIV id=“container” INPUT class=“val1” value=“10” INPUT class=“val2” value=“20” BUTTON id=“add” value=“Add” SPAN class=“result” html=“Result:” P id=“false” html=“20” 20 2
  • 6. DOM State Transition 6 S 2 S 0 S 1 S 4 S … S N S 3 S 5 User Input / User Action
  • 7. Challenges 7 Is this class name correct? 1. function add(a,b) { Does 2. return the element a + b; exist in DOM? 3. } 4. 5. var input1 = document.getElementsByClassName(“val1”)[0].value; 6. var input2 = document.getElementsByClassName(“val2”)[0].value; 7. if(input1 != 0) { 8. var sum= add(input1,input2); 9. var html = “<p id=‘true’> + add(input1,input2) + “</p>”; 10. document.getElementById(“result”).innerHTML += html; 11. } else { 12. var sum = input2; 13. var html += “<p id=‘false’>” + sum+ “</p>”; 14. document.getElementById(“result”).innerHTML += html; 15. } Does it have the property “value”? What is the updated DOM structure?
  • 8. Straw man Approach Manually inspect the DOM Develop, Execute, Repeat Tedious and time consuming 8
  • 9. Problem Statement • JavaScript code is challenging to develop and analyze – Handling interactions between JS and DOM [MSR’14][ESEM’13] • Lack of tool support [ESEM’13] – Instant feedback required 9
  • 11. Proposed Solution Analyze each DOM state and assist the developer while writing JavaScript Code BUT Number of DOM states can be infinite!!! 11
  • 12. Intuition DOM states exhibit patterns 12 HTML BODY DIV id=“container” INPUT class=“val1” value=“10” INPUT class=“val2” value=“20” BUTTON id=“add” value=“Add” SPAN class=“result” html=“Result:” HTML BODY DIV id=“container” INPUT class=“val1” value=“10” INPUT class=“val2” value=“20” BUTTON id=“add” value=“Add” SPAN class=“result” html=“Result:” P id=“true” html=“30” S 0 S 1
  • 13. DOM Element Locators 13 BODY DIV id=“container” INPUT class=“val” value=“10” INPUT class=“val” value=“20” BUTTON id=“add” value=“Add” SPAN class=“result” html=“Result:” html body div#container input.val1 html body div#container input.val2 html body div#container button#add html body div#container span.result html body div#container input.val1 html body div#container input.val2 html body div#container button#add html body div#container span.result p#true html body div#container input.val1 html body div#container input.val2 html body div#container button#add html body div#container span.result p#false HTML p id=“false” true” html=“30” S 012
  • 14. Compression Techniques 14 html body div#container input.val1 html body div#container input.val1.val2 html body div#container input.val2 html body div#container input.val{d} html body div#container button#add html body div#container span.result html body div#container input.val1 html body div#container input.val2 html body div#container button #add html body div#container span.result p#true html body div#container span.result p#true#flase html body div#container input.val1 html body div#container input.val2 html body div#container button #add Duplicates Removed Similar IDs combined Similar classes combined
  • 15. DOM Analysis • Manual • Automatic • Crawl available DOM states. • Convert each DOM state to a list of DOM Element Locators. • Detect patterns in DOM Element Locators. 15
  • 16. JavaScript Code Analysis 16 1. function add(a,b) { 2. return a + b; 3. } 4. 5. var input1 = document.getElementsByClassName(“val1”)[0].value; 6. var input2 = document.getElementsByClassName(“val2”)[0].value; 7. if(input1 != 0) { 8. var sum= add(input1,input2); 9. var html = “<p id=‘true’> + add(input1,input2) + “</p>”; 10. document.getElementById(“result”).innerHTML += html; 11. } else { 12. var sum = input2; 13. var html += “<p id=‘false’>” + sum+ “</p>”; 14. document.getElementById(“result”).innerHTML += html; 15. } ..... if(condition) { then-statements; } else { else-statements; ..... HTML BODY ..... condition; log true; then-statements; ..... ..... condition; then-statements; ..... ..... condition; log false else-statements; ..... ..... condition; else-statements; ..... DIV id=“container” INPUT class=“val1” value=“10” INPUT class=“val2” value=“20” BUTTON id=“add” value=“Add” SPAN S0 class=“result” html=“Result:”
  • 17. HTML BODY DIV id=“container” INPUT class=“val” value=“10” INPUT class=“val” value=“20” BUTTON id=“add” value=“Add” SPAN class=“result” html=“Result:” p id=“false” html=“30” HTML BODY DIV id=“container” INPUT class=“val” value=“10” INPUT class=“val” value=“20” BUTTON id=“add” value=“Add” SPAN class=“result” html=“Result:” p id=“true” html=“30” Example 17 1. function add(a,b) { 2. return a + b; 3. } 4. 5. var input1 = document.getElementsByClassName(“val1”)[0].value; 6. var input2 = document.getElementsByClassName(“val2”)[0].value; 7. input1 != 0; 8. dompleteLog(“main”,true); 9. var sum= add(input1,input2); 10. var html = “<p id=‘true’> + add(input1,input2) + “</p>”; 11. document.getElementById(“result”).innerHTML += html; 1. function add(a,b) { 2. return a + b; 3. } 4. 5. var input1 = document.getElementsByClassName(“val1”)[0].value; 6. var input2 = document.getElementsByClassName(“val2”)[0].value; 7. input1 != 0; 8. dompleteLog(“main”,false); 9. var sum = input2; 10. var html += “<p id=‘false’>” + sum+ “</p>”; 11. document.getElementById(“result”).innerHTML += html; S1 S2
  • 18. Code Analysis • Generate possible code paths • Execute JavaScript code • Intercept calls to DOM API • Analyze Logs 18
  • 19. Suggestion Generation 19 DOM Analysis Output CodeAnalysis Output Suggestions
  • 20. Approach Summary 20 DOM Analysis (Phase 1) Code Analysis (Phase 2) Suggestion Generation (Phase 3) Webapp URL JavaScript Code Suggestions Executed only once Executed every time
  • 21. DOMpletion (Brackets IDE Plugin) Brackets Live Development 21 https://github.com/saltlab/dompletion
  • 23. Evaluation RQ1: Do DOM element locators converge? RQ2: How accurate are the code completion suggestions? – Precision – Recall RQ3: What is the performance overhead incurred? 23
  • 25. RQ1: Convergence Crawled each application randomly, until the number DOM element locators tend to stabilize. 25
  • 26. RQ1: Results 26 Phormer Number of DOM Element Locators
  • 27. RQ2: Performance Performed code-completion in the existing JavaScript Code. Compared results with the existing values used in the code. 27
  • 28. RQ2: Execution Actual Suggestion 28 1. function add(a,b) { 2. return a + b; “val2” 3. } 4. var input1 = document.getElementsByClassName(“val1”)[0].value; 5. var input2 = document.getElementsByClassName(“val2”)[0].value; 6. var input2 = document.getElementByClassName(“ 7. if(input1 != 0) { 8. var sum= add(input1,input2); 9. var html = “<p id=‘true’> + add(input1,input2) + “</p>”; 10. document.getElementById(“result”).innerHTML += html; 11. } else { 12. var sum = input2; 13. var html += “<p id=‘false’>” + sum+ “</p>”; 14. document.getElementById(“result”).innerHTML += html; 15. }
  • 31. RQ3: Performance DOM Analysis Phase • Crawled each web application until DOM element locators merge. • Recorded time elapsed by the end of each state Code Analysis Phase • Recorded time taken to list the suggestions 31
  • 32. RQ3: Results • DOM Analysis – 173 seconds (3 minutes approx.) • Code Analysis – Min time: 1 second – Max time: 6 seconds – Avg. time: 2.8 seconds 32 Incurred only once
  • 33. User Study • 9 Participants Group A : Using DOMpletion Group B : Without DOMpletion • 4 Tasks to analyze the DOM JavaScript interactions 103 268 Time (Seconds) Group A Group B 97.50% 90.83% 47.50% 76.25% Recall Precision Group A Group B 33
  • 34. Contributions 1. Discussed challenges behind DOM based code completion. 2. Fully automated code completion technique using static and dynamic analysis of JavaScript code and DOM. 3. Implementation in an open source tool called DOMpletion. 4. Empirical evaluation to assess DOMpletion. https://github.com/saltlab/dompletion 34 Up to 83 % Recall and 90% Precision 2.8 seconds average time

Editor's Notes

  1. describe the meaning approach to assist the web developers in writing JavaScript code that interacts with DOM
  2. before we go further lets have a quick look at the running example which we follow throughout the presentation The code looks simple.. however when writing code for web applications the code needs to be modified to get input and redirect outputs to the web application.. For this javascript code, lets use this really simple calculator application.. Before we go futher lets have a quick look how this web application is represneted in the web browser and how does javascript code written by the programmer interacts with it..
  3. each web application is represented in the form of Document Object Model tree i.e DOM tree each node in the DOM tree corresponds to certain elements in the web application. For example, in this case the two highlighted leaf nodes represent the two input elements. In order for the web developer to interacts with these elements The takeway from this slide is there are more than one ways for a developer to select DOM elements and developers need to precisely analyze the DOM before selecting the DOM element.
  4. dom is highly dynamic and interleaves and evolves with javascript code ----- Meeting Notes (2014-09-10 13:19) ----- red part separate
  5. code completions for interactions between JS and DOM Loosely typed JS Highly dynamic DOM These approaches are static and mainly used for finding errors in the code not for code-completion
  6. I order to compare the dom states, we need to get rid of the irrelevant information and focus on what exactly matters to the developers..
  7. long time to generate why do we need to compress?? need to provide quick answer to the developers simulate unseen dom states using the detected patterns
  8. DOM Analysis Phase 1 In this phase, we crawl the web application. This crawling can be either automated based on the randomized crawler or the developer can crawl the web app manually, if the developer wants to focus on limited number of DOM states. Next, for DOM state we create a list of DOM element locators. By DOM element locators we refer to the combination of tag names, class names and ids attached to each element along with the hierarchical information. Next, we detect patterns among these DOM element locators. the basic intuition behind our work is that these DOM element locators tend to converge over the increasing number of DOM states and exhibit patterns that can be recognized. During the evaluation phase we validate this intuition. The output of this phase looks like this ----- Meeting Notes (2014-09-08 16:54) ----- general algo read the paper
  9. ----- Meeting Notes (2014-09-10 13:19) ----- show DOM in the corner
  10. To provide a brief overview of our approach, we require two inputs from the developer. The 1st one being the URL of the web application for which the developer is writing the JavaScript Code. If the web application is not running the developer can also provide the HTML code as an input to the system. The 2nd one is the JavaScript that the developer is writing. The 1st phase of our approach begins in the background and does not require any specific instruction from the developer. It starts with the 1st DOM state, keep exploring next available DOM states and collecting information. The 2nd phase starts when the developer hits the code completion key. The JavaScript code written till then is taken as an input and dynamically analyzed. The outputs of 1st and 2nd phase are then compared to generate suggestions for the user. ----- Meeting Notes (2014-09-08 16:54) ----- comes later phase for summary ----- Meeting Notes (2014-09-10 13:19) ----- dnt animate
  11. We have implemented DOMpletion as plugin for the Brackets IDE using its Live Development feature to analyze the DOM. The Brackets IDE is built as a Desktop application using nodejs. We use Esprima JavaScript parser built in JavaScript to parse the JavaScript code given as input. Therefore, keeping our implementation of DOM-Aware code completion tool in JavaScript itself.
  12. Evaluation We cover three main points: Convergence of DOM element locators, i.e the intuition we had for the DOM analysis phase. Accuracy in terms of precision and recall for the proposed technique. Performance overhead caused by DOMpletion
  13. ----- Meeting Notes (2014-09-10 13:19) ----- this applies to other web sites too css selector tpo
  14. ----- Meeting Notes (2014-09-10 13:19) ----- show code demo to complete
  15. hierarchical information definition how far the suggestion is and make it a positive statement say about no hierarchy too
  16. related work graph ----- Meeting Notes (2014-09-10 13:19) ----- summary of results show just email address