Understanding JavaScript Event-Based Interactions
Saba Alimadadi Sheldon Sequeira Ali Mesbah Karthik Pattabiraman
Understanding JavaScript Event-Based Interactions Saba Alimadadi - - PowerPoint PPT Presentation
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
Saba Alimadadi Sheldon Sequeira Ali Mesbah Karthik Pattabiraman
1 !
html head body P div a div h1 table caption tr label input table textarea button
p button body div table
foo() triggered ba{() triggered bar() triggered quy() triggered bar() triggered
td td
2 !
User logs in
Timeout for page expiry Server request for login Server response for login
3 !
Timeout for page expiry Server request for login Server response for login
View gallery
Server request Server request Server response Server response
3 !
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 !
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 !
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 label input submitBtn p
5 !
6 !
7 !
JavaScript Transformation Trace Collection Model Creation Model Visualization
8 !
JavaScript Transformation Trace Collection Model Creation Model Visualization
9 !
JavaScript Transformation Trace Collection Model Creation Model Visualization
10 !
Timeout ID: 1 XHR ID: 1
DOM Event
(Click)
Target: SubmitBtn
Source Result Trace
body fieldset text input button divinform Server Anonymous
e email
isEmail Valid Submission Handler
XHR Event
(Response)
XHR ID: 1
Source Trace
body fieldset text input button divdata
Anonymous
Timing Event
(TO Callback)
TO ID: 1
Source Trace
body fieldset text input button divclearMsg
Result Result
11 !
Timeout ID: 1 XHR ID: 1
DOM Event
(Click)
Target: SubmitBtn
Source Result Trace
body fieldset text input button divinform Server Anonymous
e email
isEmail Valid Submission Handler
XHR Event
(Response)
XHR ID: 1
Source Trace
body fieldset text input button divdata
Anonymous
Timing Event
(TO Callback)
TO ID: 1
Source Trace
body fieldset text input button divclearMsg
Result Result
12 !
Timeout ID: 1 XHR ID: 1
DOM Event
(Click)
Target: SubmitBtn
Source Result Trace
body fieldset text input button divinform Server Anonymous
e email
isEmail Valid Submission Handler
XHR Event
(Response)
XHR ID: 1
Source Trace
body fieldset text input button divdata
Anonymous
Timing Event
(TO Callback)
TO ID: 1
Source Trace
body fieldset text input button divclearMsg
Result Result
13 !
JavaScript Transformation Trace Collection Model Creation Model Visualization
14 !
15 !
1 !
17 !
18 !
18 !
18 !
18 !
RQ1) Does using Clematis decrease the task completion
19 !
20 !
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%!)!
Task! Clematis! Other!
All! 15:37! <<! 29:12! (47%!)!
21 !
Task! Clematis! Other!
T1! 84! >>! 28! (67%!)! T2! 97! >>! 57! (41%!)! T3! 100! >! 80! (20%!)! T4! 95! >>! 30! (68%!)!
Task! Clematis! Other!
All! 90! >>! 35! (61%!)!
22 !
Task! Improvement!
T1! (39%!)! T2! (48%!)! T3! (68%!)! T4! (32%!)!
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 !
T1−Exp T2−Ctrl T2−Exp T3−Ctrl T3−Exp T4−Ctrl T4−Exp Total−Ctrl Total−Exp 20 40 60 80 100
Accuracy (%)
T7−Exp T8−Ctrl T8−Exp T9−Ctrl T9−Exp T10−Ctrl T10−Exp Total−Ctrl Total−Exp
Duration (mm:ss)
0:00 8:20 16:40 25:00 33:20 41:40 50:00
24 !
1 !