SlideShare a Scribd company logo
1 of 31
Understanding JavaScript 
Event-Based Interactions 
Saba Alimadadi 
Sheldon Sequeira 
Ali Mesbah 
Karthik Pattabiraman
Motivation 
• JavaScript 
– Widely used, very popular 
– Event driven, dynamic, asynchronous 
• Difficult to understand the dynamic 
behavior and the control flow 
– Lower level events 
– Their interactions 
1
Challenge 1: Event Propagation 
html 
head P div 
a div 
h1 caption tr 
p 
qux() triggered 
label input table textarea User 
Click 
button 
bod y 
foo() triggered table 
baz() triggered 
bar() triggered 
bar() triggered 
td 
2
Challenge 2: Asynchronous Events 
User logs 
in 
Timeout for page expiry 
Server request for login 
Server response for login 
3
Challenge 2: Asynchronous Events 
Timeout for page expiry 
Server request for login 
Server response for login View 
gallery 
Server request 
Server request 
Server response 
Server response 
3
Challenge 2: Asynchronous Events 
Timeout for page expiry 
Server request for login 
Server response for login 
Server request 
Server request 
Server response 
Server response 
View 
slideshow 
Timeout for next image 
3
Challenge 2: Asynchronous Events 
Timeout for page expiry 
Server request for login 
Server response for login 
Server request 
Server request 
Server response 
Server response 
Timeout for next image 
Server request image 
Server response 
Timeout callback 
Timeout callback page expiry 
3
Challenge 3: DOM State 
function submissionHandler(e) { 
$('#regMsg').html("Submitted!"); 
var email = $('#email').val(); 
if (isEmailValid(email)) { 
informServer(email); 
$('#submitBtn').attr("disabled", true); 
} 
} 
. . . 
function informServer(email) { 
$.get('/register/', { email } 
, function(data) { 
$(’#srvrMsg').append(data); 
}); 
} 
html 
head Body 
P div a srvrMsg 
regMsg div 
caption form 
p 
label input submitBtn 
5
Summary of Challenges 
• Event propagation 
• Asynchronous events 
• Implications of events 
6
Approach 
JavaScript 
Transformation 
Trace 
Collection 
Model 
Visualization 
Behavioral 
Model Creation 
7
JavaScript Transformation 
• Interposing on DOM events 
• Capturing timeouts and XHRs 
• Recording function traces 
• Extracting DOM mutations 
JavaScript 
Transformation 
Trace 
Collection 
Model 
Creation 
Model 
Visualization 
8
Trace Collection 
JavaScript 
Transformation 
Trace 
Collection 
Model 
Creation 
Model 
Visualization 
• Interposing on DOM events 
• Capturing timeouts and XHRs 
• Recording function traces 
• Extracting DOM mutations 
=> Detailed Trace 
DOM events 
functions 
timeouts 
XHRs 
DOM mutations 
9
Behavioral Model Creation 
JavaScript 
Transformation 
Trace 
Collection 
Model 
Creation 
Model 
Visualization 
• Customized graph 
• Nodes: episodes 
• Links: temporal and causal 
10
Model: Episodes 
Source Trace 
Timeout ID: 1 
XHR ID: 1 
Source 
DOM Event 
(Click) 
Target: SubmitBtn 
Result 
Trace 
body 
fieldset 
text input 
button div 
inform 
Server 
Anonymous 
e 
email 
isEmail 
Valid 
Submission 
Handler 
email 
XHR Event 
(Response) 
XHR ID: 1 
body 
fieldset 
text input 
button div 
data 
Source Trace 
Anonymous Timing Event 
(TO Callback) 
TO ID: 1 
body 
fieldset 
text input 
button div 
clearMsg 
Result Result 
– A period of JavaScript execution 
– Start and end points 
11
Model: Links 
Source Trace 
Timeout ID: 1 
XHR ID: 1 
Source 
DOM Event 
(Click) 
Target: SubmitBtn 
Result 
Trace 
body 
fieldset 
text input 
button div 
inform 
Server 
Anonymous 
e 
email 
isEmail 
Valid 
Submission 
Handler 
email 
XHR Event 
(Response) 
XHR ID: 1 
body 
fieldset 
text input 
button div 
data 
Source Trace 
Anonymous Timing Event 
(TO Callback) 
TO ID: 1 
body 
fieldset 
text input 
button div 
clearMsg 
Result Result 
emporal 
ausal 
12
Model: Story 
Source Trace 
Timeout ID: 1 
XHR ID: 1 
Source 
DOM Event 
(Click) 
Target: SubmitBtn 
Result 
Trace 
body 
fieldset 
text input 
button div 
inform 
Server 
Anonymous 
e 
email 
isEmail 
Valid 
Submission 
Handler 
email 
XHR Event 
(Response) 
XHR ID: 1 
body 
fieldset 
text input 
button div 
data 
Source Trace 
Anonymous Timing Event 
(TO Callback) 
TO ID: 1 
body 
fieldset 
text input 
button div 
clearMsg 
Result Result 
13
Visualization: Overview 
JavaScript 
Transformation 
Trace 
Collection 
Model 
Creation 
Model 
Visualization 
14
Visualization: Zoom Level 1 
15
Visualization: Zoom Level 1 
Visualization: Zoom Level 2 
1
Implementation 
• Clematis 
https://github.com/saltlab/clematis 
• Languages: Java, JavaScript 
• Transform JavaScript & inject toolbar via proxy 
• Provide a RESTful API for retrieving data 
• Render a web-based visualization 
17
Usage Scenario 
18
Usage Scenario 
18
Usage Scenario 
18
Usage Scenario 
18
Evaluation 
RQ1) Does using Clematis decrease the task completion 
duration for web application comprehension? 
RQ2) Does using Clematis increase the task completion 
accuracy for web application comprehension? 
RQ3) Are there any certain categories of tasks for 
which Clematis improves the performance most? 
19
Industrial Controlled Experiment 
• Participants 
– 20 software developers (from a large SW company) 
– Experimental group: Clematis 
– Control group: Chrome, Firefox & Firebug 
• Procedure 
– 5 minute tutorial on Clematis 
– Tasks: control flow, feature location, DOM 
mutations, … 
• Data collection 
– Task completion duration & accuracy 
20
Results: Duration 
Average Time (mm:ss) Per Task 
Task 
Clematis 
Other 
T1 
7:00 
<< 
11:27 
(39%é) 
T2 
3:51 
<< 
7:27 
(48%é) 
T3 
2:02 
<< 
6:18 
(68%é) 
T4 
2:44 
< 
4:00 
(32%é) 
Average Time (mm:ss) in Total 
Task 
Clematis 
Other 
All 
15:37 
<< 
29:12 
(47%é) 
21
Results: Accuracy 
Average Accuracy (%) Per Task 
Task 
Clematis 
Other 
T1 
84 
>> 
28 
(67%é) 
T2 
97 
>> 
57 
(41%é) 
T3 
100 
> 
80 
(20%é) 
T4 
95 
>> 
30 
(68%é) 
Average Accuracy (%) in Total 
Task 
Clematis 
Other 
All 
90 
>> 
35 
(61%é) 
22
Results 
Duration 
Task 
Improvement 
T1 
(39%é) 
T2 
(48%é) 
T3 
(68%é) 
T4 
(32%é) 
Accuracy 
Task 
Improvement 
T1 
(67%é) 
T2 
(41%é) 
T3 
(20%é) 
T4 
(68%é) 
Task 
Description 
T1 
Following control flow in presence of asynchronous events 
T2 
Finding DOM mutations caused by a DOM event 
T3 
Locating the implementation of a malfunctioning feature 
T4 
Detecting control flow in presence of event propagation 
23
Consistent Performance 
● 
● 
● 
● 
● 
● 
● ● 
● 
T1−Ctrl 
T1−Exp 
T2−Ctrl 
T2−Exp 
T3−Ctrl 
T3−Exp 
T4−Ctrl 
T4−Exp 
Total−Ctrl 
Total−Exp 
0 20 40 60 80 100 
Accuracy (%) 
● 
● 
T7−Ctrl 
T7−Exp 
T8−Ctrl 
T8−Exp 
T9−Ctrl 
T9−Exp 
T10−Ctrl 
T10−Exp 
Total−Ctrl 
Total−Exp 
Duration (mm:ss) Accuracy (%) 
Duration (mm:ss) 
0:00 
8:20 
16:40 
25:00 
33:20 
41:40 
50:00 
24
1

More Related Content

Similar to Understanding JavaScript Event-based Interactions

Apache Incubator Samza: Stream Processing at LinkedIn
Apache Incubator Samza: Stream Processing at LinkedInApache Incubator Samza: Stream Processing at LinkedIn
Apache Incubator Samza: Stream Processing at LinkedInChris Riccomini
 
Loophole: Timing Attacks on Shared Event Loops in Chrome
Loophole: Timing Attacks on Shared Event Loops in ChromeLoophole: Timing Attacks on Shared Event Loops in Chrome
Loophole: Timing Attacks on Shared Event Loops in Chromecgvwzq
 
540slidesofnodejsbackendhopeitworkforu.pdf
540slidesofnodejsbackendhopeitworkforu.pdf540slidesofnodejsbackendhopeitworkforu.pdf
540slidesofnodejsbackendhopeitworkforu.pdfhamzadamani7
 
Cloud Dataflow - A Unified Model for Batch and Streaming Data Processing
Cloud Dataflow - A Unified Model for Batch and Streaming Data ProcessingCloud Dataflow - A Unified Model for Batch and Streaming Data Processing
Cloud Dataflow - A Unified Model for Batch and Streaming Data ProcessingDoiT International
 
Apache Incubator Samza: Stream Processing at LinkedIn
Apache Incubator Samza: Stream Processing at LinkedInApache Incubator Samza: Stream Processing at LinkedIn
Apache Incubator Samza: Stream Processing at LinkedInChris Riccomini
 
Flink 0.10 @ Bay Area Meetup (October 2015)
Flink 0.10 @ Bay Area Meetup (October 2015)Flink 0.10 @ Bay Area Meetup (October 2015)
Flink 0.10 @ Bay Area Meetup (October 2015)Stephan Ewen
 
Sane Sharding with Akka Cluster
Sane Sharding with Akka ClusterSane Sharding with Akka Cluster
Sane Sharding with Akka Clustermiciek
 
Multi-Dimensional Process Analysis
Multi-Dimensional Process Analysis Multi-Dimensional Process Analysis
Multi-Dimensional Process Analysis Dirk Fahland
 
Taras Girnyk "Debugging and Profiling distributed applications using Opentrac...
Taras Girnyk "Debugging and Profiling distributed applications using Opentrac...Taras Girnyk "Debugging and Profiling distributed applications using Opentrac...
Taras Girnyk "Debugging and Profiling distributed applications using Opentrac...Fwdays
 
Introducing BinarySortedMultiMap - A new Flink state primitive to boost your ...
Introducing BinarySortedMultiMap - A new Flink state primitive to boost your ...Introducing BinarySortedMultiMap - A new Flink state primitive to boost your ...
Introducing BinarySortedMultiMap - A new Flink state primitive to boost your ...Flink Forward
 
C++ Windows Forms L02 - Controls P1
C++ Windows Forms L02 - Controls P1C++ Windows Forms L02 - Controls P1
C++ Windows Forms L02 - Controls P1Mohammad Shaker
 
Flink Forward San Francisco 2019: Real-time Processing with Flink for Machine...
Flink Forward San Francisco 2019: Real-time Processing with Flink for Machine...Flink Forward San Francisco 2019: Real-time Processing with Flink for Machine...
Flink Forward San Francisco 2019: Real-time Processing with Flink for Machine...Flink Forward
 
Visual sedimentation - IEEE VIS 2013 Atlanta
Visual sedimentation - IEEE VIS 2013 AtlantaVisual sedimentation - IEEE VIS 2013 Atlanta
Visual sedimentation - IEEE VIS 2013 AtlantaSamuel Huron
 
5 x HTML5 worth using in APEX (5)
5 x HTML5 worth using in APEX (5)5 x HTML5 worth using in APEX (5)
5 x HTML5 worth using in APEX (5)Christian Rokitta
 
Andrzej Ludwikowski - Event Sourcing - co może pójść nie tak?
Andrzej Ludwikowski -  Event Sourcing - co może pójść nie tak?Andrzej Ludwikowski -  Event Sourcing - co może pójść nie tak?
Andrzej Ludwikowski - Event Sourcing - co może pójść nie tak?SegFaultConf
 
ODSC 2019: Sessionisation via stochastic periods for root event identification
ODSC 2019: Sessionisation via stochastic periods for root event identificationODSC 2019: Sessionisation via stochastic periods for root event identification
ODSC 2019: Sessionisation via stochastic periods for root event identificationKuldeep Jiwani
 
Building Applications with Streams and Snapshots
Building Applications with Streams and SnapshotsBuilding Applications with Streams and Snapshots
Building Applications with Streams and SnapshotsJ On The Beach
 
javascript Event Handling and introduction to event.ppt
javascript Event Handling and introduction to event.pptjavascript Event Handling and introduction to event.ppt
javascript Event Handling and introduction to event.pptLalith86
 

Similar to Understanding JavaScript Event-based Interactions (20)

Apache Incubator Samza: Stream Processing at LinkedIn
Apache Incubator Samza: Stream Processing at LinkedInApache Incubator Samza: Stream Processing at LinkedIn
Apache Incubator Samza: Stream Processing at LinkedIn
 
Loophole: Timing Attacks on Shared Event Loops in Chrome
Loophole: Timing Attacks on Shared Event Loops in ChromeLoophole: Timing Attacks on Shared Event Loops in Chrome
Loophole: Timing Attacks on Shared Event Loops in Chrome
 
540slidesofnodejsbackendhopeitworkforu.pdf
540slidesofnodejsbackendhopeitworkforu.pdf540slidesofnodejsbackendhopeitworkforu.pdf
540slidesofnodejsbackendhopeitworkforu.pdf
 
Cos 432 web_security
Cos 432 web_securityCos 432 web_security
Cos 432 web_security
 
Cloud Dataflow - A Unified Model for Batch and Streaming Data Processing
Cloud Dataflow - A Unified Model for Batch and Streaming Data ProcessingCloud Dataflow - A Unified Model for Batch and Streaming Data Processing
Cloud Dataflow - A Unified Model for Batch and Streaming Data Processing
 
Apache Incubator Samza: Stream Processing at LinkedIn
Apache Incubator Samza: Stream Processing at LinkedInApache Incubator Samza: Stream Processing at LinkedIn
Apache Incubator Samza: Stream Processing at LinkedIn
 
Flink 0.10 @ Bay Area Meetup (October 2015)
Flink 0.10 @ Bay Area Meetup (October 2015)Flink 0.10 @ Bay Area Meetup (October 2015)
Flink 0.10 @ Bay Area Meetup (October 2015)
 
Sane Sharding with Akka Cluster
Sane Sharding with Akka ClusterSane Sharding with Akka Cluster
Sane Sharding with Akka Cluster
 
Multi-Dimensional Process Analysis
Multi-Dimensional Process Analysis Multi-Dimensional Process Analysis
Multi-Dimensional Process Analysis
 
Taras Girnyk "Debugging and Profiling distributed applications using Opentrac...
Taras Girnyk "Debugging and Profiling distributed applications using Opentrac...Taras Girnyk "Debugging and Profiling distributed applications using Opentrac...
Taras Girnyk "Debugging and Profiling distributed applications using Opentrac...
 
Introducing BinarySortedMultiMap - A new Flink state primitive to boost your ...
Introducing BinarySortedMultiMap - A new Flink state primitive to boost your ...Introducing BinarySortedMultiMap - A new Flink state primitive to boost your ...
Introducing BinarySortedMultiMap - A new Flink state primitive to boost your ...
 
C++ Windows Forms L02 - Controls P1
C++ Windows Forms L02 - Controls P1C++ Windows Forms L02 - Controls P1
C++ Windows Forms L02 - Controls P1
 
Flink Forward San Francisco 2019: Real-time Processing with Flink for Machine...
Flink Forward San Francisco 2019: Real-time Processing with Flink for Machine...Flink Forward San Francisco 2019: Real-time Processing with Flink for Machine...
Flink Forward San Francisco 2019: Real-time Processing with Flink for Machine...
 
Visual sedimentation - IEEE VIS 2013 Atlanta
Visual sedimentation - IEEE VIS 2013 AtlantaVisual sedimentation - IEEE VIS 2013 Atlanta
Visual sedimentation - IEEE VIS 2013 Atlanta
 
5 x HTML5 worth using in APEX (5)
5 x HTML5 worth using in APEX (5)5 x HTML5 worth using in APEX (5)
5 x HTML5 worth using in APEX (5)
 
Andrzej Ludwikowski - Event Sourcing - co może pójść nie tak?
Andrzej Ludwikowski -  Event Sourcing - co może pójść nie tak?Andrzej Ludwikowski -  Event Sourcing - co może pójść nie tak?
Andrzej Ludwikowski - Event Sourcing - co może pójść nie tak?
 
javaScript and jQuery
javaScript and jQueryjavaScript and jQuery
javaScript and jQuery
 
ODSC 2019: Sessionisation via stochastic periods for root event identification
ODSC 2019: Sessionisation via stochastic periods for root event identificationODSC 2019: Sessionisation via stochastic periods for root event identification
ODSC 2019: Sessionisation via stochastic periods for root event identification
 
Building Applications with Streams and Snapshots
Building Applications with Streams and SnapshotsBuilding Applications with Streams and Snapshots
Building Applications with Streams and Snapshots
 
javascript Event Handling and introduction to event.ppt
javascript Event Handling and introduction to event.pptjavascript Event Handling and introduction to event.ppt
javascript Event Handling and introduction to event.ppt
 

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 StudySALT Lab @ UBC
 
Efficient JavaScript Mutation Testing
Efficient JavaScript Mutation TestingEfficient JavaScript Mutation Testing
Efficient JavaScript Mutation TestingSALT 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 MaintenanceSALT Lab @ UBC
 
Mining Questions Asked by Web Developers
Mining Questions Asked by Web DevelopersMining Questions Asked by Web Developers
Mining Questions Asked by Web DevelopersSALT 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 ReportsSALT Lab @ UBC
 
Vejovis: Suggesting Fixes for JavaScript Faults
Vejovis: Suggesting Fixes for JavaScript FaultsVejovis: Suggesting Fixes for JavaScript Faults
Vejovis: Suggesting Fixes for JavaScript FaultsSALT 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 ApplicationsSALT Lab @ UBC
 
Dompletion: DOM-Aware JavaScript Code Completion
Dompletion: DOM-Aware JavaScript Code CompletionDompletion: DOM-Aware JavaScript Code Completion
Dompletion: DOM-Aware JavaScript Code CompletionSALT 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 ApplicationsSALT 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
 
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
 
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

Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfRagavanV2
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...Call Girls in Nagpur High Profile
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...SUHANI PANDEY
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756dollysharma2066
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
Vivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design SpainVivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design Spaintimesproduction05
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdfSuman Jyoti
 
Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Christo Ananth
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 

Recently uploaded (20)

Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
 
Vivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design SpainVivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design Spain
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
 
Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 

Understanding JavaScript Event-based Interactions

  • 1. Understanding JavaScript Event-Based Interactions Saba Alimadadi Sheldon Sequeira Ali Mesbah Karthik Pattabiraman
  • 2. Motivation • JavaScript – Widely used, very popular – Event driven, dynamic, asynchronous • Difficult to understand the dynamic behavior and the control flow – Lower level events – Their interactions 1
  • 3. Challenge 1: Event Propagation html head P div a div h1 caption tr p qux() triggered label input table textarea User Click button bod y foo() triggered table baz() triggered bar() triggered bar() triggered td 2
  • 4. Challenge 2: Asynchronous Events User logs in Timeout for page expiry Server request for login Server response for login 3
  • 5. Challenge 2: Asynchronous Events Timeout for page expiry Server request for login Server response for login View gallery Server request Server request Server response Server response 3
  • 6. Challenge 2: Asynchronous Events Timeout for page expiry Server request for login Server response for login Server request Server request Server response Server response View slideshow Timeout for next image 3
  • 7. Challenge 2: Asynchronous Events Timeout for page expiry Server request for login Server response for login Server request Server request Server response Server response Timeout for next image Server request image Server response Timeout callback Timeout callback page expiry 3
  • 8. Challenge 3: DOM State function submissionHandler(e) { $('#regMsg').html("Submitted!"); var email = $('#email').val(); if (isEmailValid(email)) { informServer(email); $('#submitBtn').attr("disabled", true); } } . . . function informServer(email) { $.get('/register/', { email } , function(data) { $(’#srvrMsg').append(data); }); } html head Body P div a srvrMsg regMsg div caption form p label input submitBtn 5
  • 9. Summary of Challenges • Event propagation • Asynchronous events • Implications of events 6
  • 10. Approach JavaScript Transformation Trace Collection Model Visualization Behavioral Model Creation 7
  • 11. JavaScript Transformation • Interposing on DOM events • Capturing timeouts and XHRs • Recording function traces • Extracting DOM mutations JavaScript Transformation Trace Collection Model Creation Model Visualization 8
  • 12. Trace Collection JavaScript Transformation Trace Collection Model Creation Model Visualization • Interposing on DOM events • Capturing timeouts and XHRs • Recording function traces • Extracting DOM mutations => Detailed Trace DOM events functions timeouts XHRs DOM mutations 9
  • 13. Behavioral Model Creation JavaScript Transformation Trace Collection Model Creation Model Visualization • Customized graph • Nodes: episodes • Links: temporal and causal 10
  • 14. Model: Episodes Source Trace Timeout ID: 1 XHR ID: 1 Source DOM Event (Click) Target: SubmitBtn Result Trace body fieldset text input button div inform Server Anonymous e email isEmail Valid Submission Handler email XHR Event (Response) XHR ID: 1 body fieldset text input button div data Source Trace Anonymous Timing Event (TO Callback) TO ID: 1 body fieldset text input button div clearMsg Result Result – A period of JavaScript execution – Start and end points 11
  • 15. Model: Links Source Trace Timeout ID: 1 XHR ID: 1 Source DOM Event (Click) Target: SubmitBtn Result Trace body fieldset text input button div inform Server Anonymous e email isEmail Valid Submission Handler email XHR Event (Response) XHR ID: 1 body fieldset text input button div data Source Trace Anonymous Timing Event (TO Callback) TO ID: 1 body fieldset text input button div clearMsg Result Result emporal ausal 12
  • 16. Model: Story Source Trace Timeout ID: 1 XHR ID: 1 Source DOM Event (Click) Target: SubmitBtn Result Trace body fieldset text input button div inform Server Anonymous e email isEmail Valid Submission Handler email XHR Event (Response) XHR ID: 1 body fieldset text input button div data Source Trace Anonymous Timing Event (TO Callback) TO ID: 1 body fieldset text input button div clearMsg Result Result 13
  • 17. Visualization: Overview JavaScript Transformation Trace Collection Model Creation Model Visualization 14
  • 19. Visualization: Zoom Level 1 Visualization: Zoom Level 2 1
  • 20. Implementation • Clematis https://github.com/saltlab/clematis • Languages: Java, JavaScript • Transform JavaScript & inject toolbar via proxy • Provide a RESTful API for retrieving data • Render a web-based visualization 17
  • 25. Evaluation RQ1) Does using Clematis decrease the task completion duration for web application comprehension? RQ2) Does using Clematis increase the task completion accuracy for web application comprehension? RQ3) Are there any certain categories of tasks for which Clematis improves the performance most? 19
  • 26. Industrial Controlled Experiment • Participants – 20 software developers (from a large SW company) – Experimental group: Clematis – Control group: Chrome, Firefox & Firebug • Procedure – 5 minute tutorial on Clematis – Tasks: control flow, feature location, DOM mutations, … • Data collection – Task completion duration & accuracy 20
  • 27. Results: Duration Average Time (mm:ss) Per Task Task Clematis Other T1 7:00 << 11:27 (39%é) T2 3:51 << 7:27 (48%é) T3 2:02 << 6:18 (68%é) T4 2:44 < 4:00 (32%é) Average Time (mm:ss) in Total Task Clematis Other All 15:37 << 29:12 (47%é) 21
  • 28. Results: Accuracy Average Accuracy (%) Per Task Task Clematis Other T1 84 >> 28 (67%é) T2 97 >> 57 (41%é) T3 100 > 80 (20%é) T4 95 >> 30 (68%é) Average Accuracy (%) in Total Task Clematis Other All 90 >> 35 (61%é) 22
  • 29. Results Duration Task Improvement T1 (39%é) T2 (48%é) T3 (68%é) T4 (32%é) Accuracy Task Improvement T1 (67%é) T2 (41%é) T3 (20%é) T4 (68%é) Task Description T1 Following control flow in presence of asynchronous events T2 Finding DOM mutations caused by a DOM event T3 Locating the implementation of a malfunctioning feature T4 Detecting control flow in presence of event propagation 23
  • 30. Consistent Performance ● ● ● ● ● ● ● ● ● T1−Ctrl T1−Exp T2−Ctrl T2−Exp T3−Ctrl T3−Exp T4−Ctrl T4−Exp Total−Ctrl Total−Exp 0 20 40 60 80 100 Accuracy (%) ● ● T7−Ctrl T7−Exp T8−Ctrl T8−Exp T9−Ctrl T9−Exp T10−Ctrl T10−Exp Total−Ctrl Total−Exp Duration (mm:ss) Accuracy (%) Duration (mm:ss) 0:00 8:20 16:40 25:00 33:20 41:40 50:00 24
  • 31. 1