220 likes | 338 Views
Shauvik Roy Choudhary , Alex Orso Georgia Institute of Tech nology. Remote Client-Side Monitoring for Web Applications. Motivation. Paradigm shift from Web 1.0 to Web 2.0 Heavy client-side scripts From synchronous to asynchronous Multitude of client-side environments
E N D
Shauvik Roy Choudhary, Alex Orso Georgia Institute of Technology Remote Client-Side Monitoring for Web Applications
Motivation • Paradigm shift from Web 1.0 to Web 2.0 • Heavy client-side scripts • From synchronous to asynchronous • Multitude of client-side environments • New problems for testing Shauvik Roy Choudhary, Alex Orso | Georgia Tech
Heavy client side scripts • More and more logic pushed to the browser (Javascript, Flash, Silverlight, …) • Little/no information on the server about client-side execution Shauvik Roy Choudhary, Alex Orso | Georgia Tech
From synchronous to asynchronous • Concurrency • Non-determinism • Additional complexity of testing environment Shauvik Roy Choudhary, Alex Orso | Georgia Tech
Multitude of client-side environments • Browsers • Browser Extensions X Shauvik Roy Choudhary, Alex Orso | Georgia Tech
An Example Client Side Configuration Cookie used to track upload status Cookie used to check if stats should be displayed URL: http://www.site.com Page A File Upload • Developer/Tester needs client-side insight for errors that might occur only in a particular context Page B Display Stats setCookie(“status”, “uploaded”) If (!getCookie(“status”)) { setCookie(“status”, “display”) reloadPage(); } Local Database Cookies Cookies Extensions Shauvik Roy Choudhary, Alex Orso | Georgia Tech
A normal web application scenario index.html HTTP response HTTP request Internet Shauvik Roy Choudhary, Alex Orso | Georgia Tech
Our monitoring technique index.html JS Agent HTTP response index.html HTTP response HTTP request Internet JS Agent Injection policy Shauvik Roy Choudhary, Alex Orso | Georgia Tech
Command and Control Command response Command request HTTP request Web Application Data Monitoring Data Monitoring Data Commands JS Agent Shauvik Roy Choudhary, Alex Orso | Georgia Tech
What can commands do? • Query • HTML DOM node (web page elements) • Javascript objects, variables, arrays • Notify – Interact with user • Display a message (HTML alert or layered dialog) • Update • Add/Change a node in the HTML DOM • Add more Javascript to page or change existing code • … Shauvik Roy Choudhary, Alex Orso | Georgia Tech
Sample Command 1. <commands> 2. <cmd> 3. <id>8de9</id> 4. <name>ALERT</name> 5. <param>Hello World!</param> 6. </cmd> 7. <cmd> 8. <id>3bsd</id> 9. <name>DUMP</name> 10. <param>myObj</param> 11. <param>myArray</param> 12. </cmd> 13. </commands> Shauvik Roy Choudhary, Alex Orso | Georgia Tech
Sample Command 1. <commands> 2. <cmd> 3. <id>8de9</id> 4. <name>ALERT</name> 5. <param>Hello World!</param> 6. </cmd> 7. <cmd> 8. <id>3bsd</id> 9. <name>DUMP</name> 10. <param>myObj</param> 11. <param>myArray</param> 12. </cmd> 13. </commands> Shauvik Roy Choudhary, Alex Orso | Georgia Tech
Sample Response 1. <responses> 2. <resp> 3. <id>8de9</id> 4. <status>1</status> 5. </resp> 6. <resp> 7. <id>3bsd</id> 8. <message>myObj={ "aString":"Howdy", "anInteger":10, "aBoolean":true }</message> 9. <message>myArray=[1,"foo","web"]</message> 10. </resp> 11. </responses> Shauvik Roy Choudhary, Alex Orso | Georgia Tech
Sample Response 1. <responses> 2. <resp> 3. <id>8de9</id> 4. <status>1</status> 5. </resp> 6. <resp> 7. <id>3bsd</id> 8. <message>myObj={ "aString":"Howdy", "anInteger":10, "aBoolean":true }</message> 9. <message>myArray=[1,"foo","web"]</message> 10. </resp> 11. </responses> Shauvik Roy Choudhary, Alex Orso | Georgia Tech
Sample Response <script type="text/javascript"> myObj=new Object(); myObj.aString=“Howdy"; myObj.anInteger=10; myObj.aBoolean=true; </script> 1. <responses> 2. <resp> 3. <id>8de9</id> 4. <status>1</status> 5. </resp> 6. <resp> 7. <id>3bsd</id> 8. <message>myObj={ "aString":"Howdy", "anInteger":10, "aBoolean":true }</message> 9. <message>myArray=[1,"foo","web"]</message> 10. </resp> 11. </responses> Shauvik Roy Choudhary, Alex Orso | Georgia Tech
Sample Response <script type="text/javascript"> myArray=new Array(); myArray[0]=1; myArray[1]=“foo”; myArray[2]=“web”; </script> 1. <responses> 2. <resp> 3. <id>8de9</id> 4. <status>1</status> 5. </resp> 6. <resp> 7. <id>3bsd</id> 8. <message>myObj={ "aString":"Howdy", "anInteger":10, "aBoolean":true }</message> 9. <message>myArray=[1,"foo","web"]</message> 10. </resp> 11. </responses> Shauvik Roy Choudhary, Alex Orso | Georgia Tech
Preliminary evaluation • Goal: Measure agent-injection overhead and JS agent performance • Subjects: 10 applications – sample code, open source projects and commercial websites echo framework Google Web Toolkit Shauvik Roy Choudhary, Alex Orso | Georgia Tech
Experimental protocol index.html JS Agent URL: http://www.site.com • JSA injection overhead • JSA performance Main page X 100 Iterate window object and count number of visited elements Measure time to Inject the main page Shauvik Roy Choudhary, Alex Orso | Georgia Tech
Results • JSA injection overhead • JSA performance • 0.1 and 8 milliseconds per page window object iterated in 3-4 ms Shauvik Roy Choudhary, Alex Orso | Georgia Tech
Application Scenarios • Error Detection and Debugging • Logging and Recovery • Metrics Collection • Code Coverage • Click-streams / User Activity • Browser Statistics • Memory Profiling • Count variables, arrays, objects • Security checks Shauvik Roy Choudhary, Alex Orso | Georgia Tech
Summary and future work • Summary • General technique for remote monitoring of web applications • Proof-of-concept evaluation • Example applications • Future work • Complete implementation • Investigate applications • Additional experimentation Shauvik Roy Choudhary, Alex Orso | Georgia Tech
Thank you ! Any Questions ? shauvik@cc.gatech.edu http://www.cc.gatech.edu/~shauvik Shauvik Roy Choudhary, Alex Orso | Georgia Tech