SlideShare une entreprise Scribd logo
1  sur  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

Contenu connexe

Tendances

From HelloWorld to Configurable and Reusable Apache Spark Applications in Sca...
From HelloWorld to Configurable and Reusable Apache Spark Applications in Sca...From HelloWorld to Configurable and Reusable Apache Spark Applications in Sca...
From HelloWorld to Configurable and Reusable Apache Spark Applications in Sca...Databricks
 
High Performance Computing: an Introduction for the Society of Actuaries
High Performance Computing: an Introduction for the Society of ActuariesHigh Performance Computing: an Introduction for the Society of Actuaries
High Performance Computing: an Introduction for the Society of ActuariesAdam DeConinck
 
PostgreSQL Troubleshoot On-line, (RITfest 2015 meetup at Moscow, Russia).
PostgreSQL Troubleshoot On-line, (RITfest 2015 meetup at Moscow, Russia).PostgreSQL Troubleshoot On-line, (RITfest 2015 meetup at Moscow, Russia).
PostgreSQL Troubleshoot On-line, (RITfest 2015 meetup at Moscow, Russia).Alexey Lesovsky
 
MongoDB and Ecommerce : A perfect combination
MongoDB and Ecommerce : A perfect combinationMongoDB and Ecommerce : A perfect combination
MongoDB and Ecommerce : A perfect combinationSteven Francia
 
Pay attention to MLPs
Pay attention to MLPsPay attention to MLPs
Pay attention to MLPsSeolhokim
 
Self-supervised Learning Lecture Note
Self-supervised Learning Lecture NoteSelf-supervised Learning Lecture Note
Self-supervised Learning Lecture NoteSangwoo Mo
 
PostgreSQL High-Availability and Geographic Locality using consul
PostgreSQL High-Availability and Geographic Locality using consulPostgreSQL High-Availability and Geographic Locality using consul
PostgreSQL High-Availability and Geographic Locality using consulSean Chittenden
 
NoSQL Database: Classification, Characteristics and Comparison
NoSQL Database: Classification, Characteristics and ComparisonNoSQL Database: Classification, Characteristics and Comparison
NoSQL Database: Classification, Characteristics and ComparisonMayuree Srikulwong
 
MySQL innoDB split and merge pages
MySQL innoDB split and merge pagesMySQL innoDB split and merge pages
MySQL innoDB split and merge pagesMarco Tusa
 
Introduction to Clustered Indexes and Heaps
Introduction to Clustered Indexes and HeapsIntroduction to Clustered Indexes and Heaps
Introduction to Clustered Indexes and HeapsJason Strate
 
Real-time Analytics with Presto and Apache Pinot
Real-time Analytics with Presto and Apache PinotReal-time Analytics with Presto and Apache Pinot
Real-time Analytics with Presto and Apache PinotXiang Fu
 
Apache Tez – Present and Future
Apache Tez – Present and FutureApache Tez – Present and Future
Apache Tez – Present and FutureDataWorks Summit
 
Histograms in MariaDB, MySQL and PostgreSQL
Histograms in MariaDB, MySQL and PostgreSQLHistograms in MariaDB, MySQL and PostgreSQL
Histograms in MariaDB, MySQL and PostgreSQLSergey Petrunya
 
PR-231: A Simple Framework for Contrastive Learning of Visual Representations
PR-231: A Simple Framework for Contrastive Learning of Visual RepresentationsPR-231: A Simple Framework for Contrastive Learning of Visual Representations
PR-231: A Simple Framework for Contrastive Learning of Visual RepresentationsJinwon Lee
 
700 Queries Per Second with Updates: Spark As A Real-Time Web Service
700 Queries Per Second with Updates: Spark As A Real-Time Web Service700 Queries Per Second with Updates: Spark As A Real-Time Web Service
700 Queries Per Second with Updates: Spark As A Real-Time Web ServiceSpark Summit
 
Myths of Big Partitions (Robert Stupp, DataStax) | Cassandra Summit 2016
Myths of Big Partitions (Robert Stupp, DataStax) | Cassandra Summit 2016Myths of Big Partitions (Robert Stupp, DataStax) | Cassandra Summit 2016
Myths of Big Partitions (Robert Stupp, DataStax) | Cassandra Summit 2016DataStax
 

Tendances (20)

From HelloWorld to Configurable and Reusable Apache Spark Applications in Sca...
From HelloWorld to Configurable and Reusable Apache Spark Applications in Sca...From HelloWorld to Configurable and Reusable Apache Spark Applications in Sca...
From HelloWorld to Configurable and Reusable Apache Spark Applications in Sca...
 
High Performance Computing: an Introduction for the Society of Actuaries
High Performance Computing: an Introduction for the Society of ActuariesHigh Performance Computing: an Introduction for the Society of Actuaries
High Performance Computing: an Introduction for the Society of Actuaries
 
PostgreSQL Troubleshoot On-line, (RITfest 2015 meetup at Moscow, Russia).
PostgreSQL Troubleshoot On-line, (RITfest 2015 meetup at Moscow, Russia).PostgreSQL Troubleshoot On-line, (RITfest 2015 meetup at Moscow, Russia).
PostgreSQL Troubleshoot On-line, (RITfest 2015 meetup at Moscow, Russia).
 
Hadoop fault-tolerance
Hadoop fault-toleranceHadoop fault-tolerance
Hadoop fault-tolerance
 
MongoDB and Ecommerce : A perfect combination
MongoDB and Ecommerce : A perfect combinationMongoDB and Ecommerce : A perfect combination
MongoDB and Ecommerce : A perfect combination
 
Pay attention to MLPs
Pay attention to MLPsPay attention to MLPs
Pay attention to MLPs
 
Self-supervised Learning Lecture Note
Self-supervised Learning Lecture NoteSelf-supervised Learning Lecture Note
Self-supervised Learning Lecture Note
 
Document Database
Document DatabaseDocument Database
Document Database
 
PostgreSQL High-Availability and Geographic Locality using consul
PostgreSQL High-Availability and Geographic Locality using consulPostgreSQL High-Availability and Geographic Locality using consul
PostgreSQL High-Availability and Geographic Locality using consul
 
NoSQL Database: Classification, Characteristics and Comparison
NoSQL Database: Classification, Characteristics and ComparisonNoSQL Database: Classification, Characteristics and Comparison
NoSQL Database: Classification, Characteristics and Comparison
 
MySQL innoDB split and merge pages
MySQL innoDB split and merge pagesMySQL innoDB split and merge pages
MySQL innoDB split and merge pages
 
Introduction to Clustered Indexes and Heaps
Introduction to Clustered Indexes and HeapsIntroduction to Clustered Indexes and Heaps
Introduction to Clustered Indexes and Heaps
 
Real-time Analytics with Presto and Apache Pinot
Real-time Analytics with Presto and Apache PinotReal-time Analytics with Presto and Apache Pinot
Real-time Analytics with Presto and Apache Pinot
 
Apache Tez – Present and Future
Apache Tez – Present and FutureApache Tez – Present and Future
Apache Tez – Present and Future
 
Histograms in MariaDB, MySQL and PostgreSQL
Histograms in MariaDB, MySQL and PostgreSQLHistograms in MariaDB, MySQL and PostgreSQL
Histograms in MariaDB, MySQL and PostgreSQL
 
Indexed Hive
Indexed HiveIndexed Hive
Indexed Hive
 
PR-231: A Simple Framework for Contrastive Learning of Visual Representations
PR-231: A Simple Framework for Contrastive Learning of Visual RepresentationsPR-231: A Simple Framework for Contrastive Learning of Visual Representations
PR-231: A Simple Framework for Contrastive Learning of Visual Representations
 
700 Queries Per Second with Updates: Spark As A Real-Time Web Service
700 Queries Per Second with Updates: Spark As A Real-Time Web Service700 Queries Per Second with Updates: Spark As A Real-Time Web Service
700 Queries Per Second with Updates: Spark As A Real-Time Web Service
 
Hadoop and Spark
Hadoop and SparkHadoop and Spark
Hadoop and Spark
 
Myths of Big Partitions (Robert Stupp, DataStax) | Cassandra Summit 2016
Myths of Big Partitions (Robert Stupp, DataStax) | Cassandra Summit 2016Myths of Big Partitions (Robert Stupp, DataStax) | Cassandra Summit 2016
Myths of Big Partitions (Robert Stupp, DataStax) | Cassandra Summit 2016
 

Similaire à 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
 

Similaire à 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
 

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

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

Dernier

complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...Chandu841456
 
Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptMadan Karki
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleAlluxio, Inc.
 
Solving The Right Triangles PowerPoint 2.ppt
Solving The Right Triangles PowerPoint 2.pptSolving The Right Triangles PowerPoint 2.ppt
Solving The Right Triangles PowerPoint 2.pptJasonTagapanGulla
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgUnit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgsaravananr517913
 
8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitterShivangiSharma879191
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)dollysharma2066
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
US Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionUS Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionMebane Rash
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEroselinkalist12
 

Dernier (20)

🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...
 
Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.ppt
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at Scale
 
Solving The Right Triangles PowerPoint 2.ppt
Solving The Right Triangles PowerPoint 2.pptSolving The Right Triangles PowerPoint 2.ppt
Solving The Right Triangles PowerPoint 2.ppt
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgUnit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
 
8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
US Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionUS Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of Action
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
 

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