Fast Reproducing Web Application Errors Jie Wang, Wensheng Dou, Chushu Gao, Jun Wei Institute of Software Chinese Academy of Sciences 2015-11-5.

Slides:



Advertisements
Similar presentations
JavaScript is a client-side scripting language. Programs run in the web browser on the client's computer. (PHP, in contrast, is a server-side scripting.
Advertisements

CS7026 jQuery Events. What are Events?  jQuery is tailor-made to respond to events in an HTML page.  Events are actions that can be detected by your.
CHESS: A Systematic Testing Tool for Concurrent Software CSCI6900 George.
Interception of User’s Characteristics on the Web Michal Barla PeWe FIIT STU BA.
An Empirical Study on the Rewritability of the with Statement in JavaScript Changhee Park (Joint work with Hongki Lee and Sukyoung Ryu) KAIST October.
Continuously Recording Program Execution for Deterministic Replay Debugging.
Ajax Dr Jim Briggs WEBP Ajax1. 2 Ajax Asynchronous JavaScript And XML Method of creating more interactive web applications Moves more of the application.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Presenter: Chi-Hung Lu 1. Problems Distributed applications are hard to validate Distribution of application state across many distinct execution environments.
The Data Attribution Abdul Saboor PhD Research Student Model Base Development and Software Quality Assurance Research Group Freie.
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Dynamic Action with Macromedia Dreamweaver MX Barry Sosinsky Valda Hilley.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 6 Dynamic Documents With JavaScript.
PROGRAMMING IN VISUAL BASIC.NET VISUAL BASIC BUILDING BLOCKS Bilal Munir Mughal 1 Chapter-5.
Graph Data Management Lab, School of Computer Science gdm.fudan.edu.cn XMLSnippet: A Coding Assistant for XML Configuration Snippet.
Section 17.1 Add an audio file using HTML Create a form using HTML Add text boxes using HTML Add radio buttons and check boxes using HTML Add a pull-down.
C-Map Tutorial How to create and save a concept map using C-Map, export a C-Map as an image, and export a C-Map as a webpage.
Foundations of Software Testing Chapter 5: Test Selection, Minimization, and Prioritization for Regression Testing Last update: September 3, 2007 These.
Bug Localization with Machine Learning Techniques Wujie Zheng
Lecture Set 13 Drawing Mouse and Keyboard Events Part B – Mouse and Keyboard Events.
INTRODUCTION TO HTML5 Using jQuery with HTML5. Introducing jQuery  Although it is not a part of any W3C or WHATWG specification, jQuery performs an important.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
Replay Compilation: Improving Debuggability of a Just-in Time Complier Presenter: Jun Tao.
Automatically Repairing Broken Workflows for Evolving GUI Applications Sai Zhang University of Washington Joint work with: Hao Lü, Michael D. Ernst.
FireBug. What is Firebug?  Firebug is a powerful tool that allows you to edit HTML, CSS and view the coding behind any website: CSS, HTML, DOM and JavaScript.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Technology and Science, Osaka University Dependence-Cache.
GPA Calculator Project JavaScript For Web Developing CS175 – Spring 2008 Won Liu Final Project Presentation 5/20/2008.
DynaRIA: a Tool for Ajax Web Application Comprehension Dipartimento di Informatica e Sistemistica University of Naples “Federico II”, Italy Domenico Amalfitano.
NVivo Software – A Qualitative Research And Data Analysis Tool: New User Tutorial Created Through a CMU Faculty Insight Team Grant by Joanne Hopper Bradley.
jFuzz – Java based Whitebox Fuzzing
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Program.
CISC Machine Learning for Solving Systems Problems Presented by: Suman Chander B Dept of Computer & Information Sciences University of Delaware Automatic.
DrDebug: Deterministic Replay based Cyclic Debugging with Dynamic Slicing Yan Wang *, Harish Patil **, Cristiano Pereira **, Gregory Lueck **, Rajiv Gupta.
Review of the DOM Node properties and methods Some ways of accessing nodes Appending, copying and removing nodes Event handling – Inline – Scripting –
Introduction Selenium IDE is a Firefox extension that allows you to record, edit, and debug tests for HTML Easy record and playback Intelligent field selection.
Introduction to Programming and JavaScript. Programming.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 14 Key Concepts 1 Copyright © Terry Felke-Morris.
Host Objects: Browsers and the DOM
Execution Replay and Debugging. Contents Introduction Parallel program: set of co-operating processes Co-operation using –shared variables –message passing.
Events Event Handling in JavaScript SoftUni Team Technical Trainers Software University
Dr. Ahmet Cengizhan Dirican BIL 374 Internet Technologies 6. Dynamic Documents With JavaScript.
Flashback : A Lightweight Extension for Rollback and Deterministic Replay for Software Debugging Sudarshan M. Srinivasan, Srikanth Kandula, Christopher.
JavaScript Events Java 4 Understanding Events Events add interactivity between the web page and the user You can think of an event as a trigger that.
G042 - Lecture 15 Excel Macros Mr C Johnston ICT Teacher
JavaScript Events. Understanding Events Events add interactivity between the web page and the user Events add interactivity between the web page and the.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 2 The Visual Basic.NET Integrated Development Environment.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 5 Host Objects: Browsers.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Debugging and Testing Hussein Suleman March 2007 UCT Department of Computer Science Computer Science 1015F.
CMon Application Monitor & Exception Manager. If I use CMon what benefits do I get? You can fix the application bugs easily. Fixing the errors in a short.
JQuery.
Chapter 2: The Visual Studio .NET Development Environment
Keyboard Accessibility
VEnron A Versioned Spreadsheet Corpus and Related Evolution Analysis
Section 17.1 Section 17.2 Add an audio file using HTML
Web Development & Design Foundations with HTML5 7th Edition
Yongle Zhang, Serguei Makarov, Xiang Ren, David Lion, Ding Yuan
Shuai Wang, Wensheng Dou, Chushu Gao, Jun Wei, Tao Huang
Classifying Race Conditions in Web Applications
Ringer: Web Automation by Demonstration
Test Case Purification for Improving Fault Localization
A Comprehensive Study on Real World Concurrency Bugs in Node.js
Detecting Faulty Empty Cells in Spreadsheets
Citation Map Visualizing citation data in the Web of Science
How Are Spreadsheet Templates Used in Practice: A Case Study on Enron
JavaScript and Events CS Programming Languages for Web Applications
How to debug a website using IE F12 tools
Introduction to Programming and JavaScript
CS7026 jQuery Events.
CHAPTER 6 EVENTS. CHAPTER 6 EVENTS WHAT IS AN EVENT?
JavaScript and Events CS Programming Languages for Web Applications
Presentation transcript:

Fast Reproducing Web Application Errors Jie Wang, Wensheng Dou, Chushu Gao, Jun Wei Institute of Software Chinese Academy of Sciences

Errors in web applications  Web application “crash” 2 document.getElementById(tableName).rows;

Errors in web applications  Exceptions thrown by development tools 3

Errors in web applications  Functionality errors 4 From github.com/hadsontable Issues#1910 Expected dragging down Buggy dragging down

Web debugging tools  Debugging and testing JavaScript programs Record replay Mugshot[1], Jalangi[2] 5 ~~~~ Trace ~~~~ Record Replay [1] Mugshot : Deterministic Capture and Replay for JavaScript Applications (OSDI 2010) [2] Jalangi: a selective record-replay and dynamic analysis framework for JavaScript (Esec/Fse13)

Motivation  A real-world bug example 1. click 2. input a white space 3. click

Motivation  However, the error can be triggered by a long execution 7 … Error-related events are interleaved with irrelevant ones input a white space

Goal Reproducibility High reduction rate 8 Record Reduce ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ Replay

 Dynamic slicing Basic idea 9 e 1 : click … e 2 : mousemove … e 3 : mouseover … e 4 : mouseover … e 5 : keydown … e 6 : keypress … e 7 : keyup …... e n : click… Slicing criteria: error-related assertions; e 1 : click … e 2 : mousemove … e 4 : mouseover … e 6 : keypress … e n : click… Error-related events

 Source code of TODOList Challenges 10 e1. Clicking add button e2. Clicking save button div id:title id:save click:onSave

e2. Clicking save button  Missing dependencies without knowing the DOM semantics Challenge 1 11 e1. Clicking add button div id:title id:save click:onSave

e2. Clicking save button  Missing dependencies without fine-grained DOM dependency model. E.g. line 8 depends on line 3 Challenge 2 12 e1. Clicking add button Reading node title div id:title id:save Modifying the subtree

e2. Clicking save button div titlesave popup  Dynamic feature and event-driven feature onAdd happends before onSave Challenge 3 13 e1. Clicking add button The click event handler onSave is registered during onAdd click:onSave

Overview-Slicing based analysis 14 ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ Replay JavaScript analysis DOM analysis Building Event Dependency Graph Event slicing JS+DOM analysis Original event trace ~~~~ ~~~~ ~~~~ Error-related event trace

 Def-Use relation: The use of a variable depends on its last definition 15 1.n:= 2; 2.x:= ( x mod n ) + 1; 3.… 4.… 5.foo (x) Source code Error-related variable JavaScript dependency analysis

e2. Clicking save button  Example TODOList 16 e1. Clicking add button JavaScript dependency analysis However, the DOM dependencies are missing! Line 8 doesn’t use any variables modified by line 3 Missing DOM dependencies

e2. Clicking save button div title save 17 e1. Clicking add button DOM dependency analysis DOM dependencies Observation: Accessing DOM node depends on the last modifications to its related nodes  Example TODOList

 Case 1. Accessing a node Modifications to itself Modifications to its ancestor nodes 18 div input 1. Add node div 2. Add node input 3. read node input Accessing DOM node depends on the last modifications to its related nodes itself ancestor

 Case 2. Accessing an attribute Modification to that attribute Dependencies on its belonging node (obtained by case 1) 19 div titlesave 1. Add node div 2. Modify attribute value of node title 3. Read attribute value of node title value:” ” Accessing DOM node depends on the last modifications to its tree structure ancestor attribute

 Case 3. Accessing the subtree Modifications to all the nodes of the subtree Dependencies to its belonging node (obtained by case 1) 20 Accessing DOM node depends on the last modifications to its related nodes div inputsave 1. Add node div 2. Modify node input 3. Read subtree of node div ancestor Nodes of the subtree

 Use JS dependency analysis and DOM dependency analysis to collect data dependencies JS dependency DOM dependency variable e1 e2 Event dependency Event Dependency Graph (EDG) Definition: e i depends on e j if e j uses variables defined or modified by e i

 Calculate key events through EDG.  E.g. eventSlice(e6) = {e2,e3,e4,e5,e6} e5 e3 e6 e4 e2 e1 Event Dependency Graph (EDG)

Evaluation  RQ1: Can the reduced event trace reproduce the error faithfully? (reproducibility)  RQ2: Can our approach remove the irrelevant errors effectively? (efficiency) 23

Evaluation  Subjects: open-source projects from Github  We selected 10 bugs. Reproducible 24 AppsDescriptionJS sizePopularity Chart.jsbasic charts105K14803 HandsontableExcel-like data grid editor4.7M4989 TodoListOffline calendar312K19 JPushMenuA menu library1.5M134 FullPage To create full screen scrolling websites 882K9518 Editor.mdA markdown editor257K530 My-mindOnline mindmapping software223K1449 Various web applications

RQ1:Reproducibility  All the errors can be reproduced ( JS+DOM ) 25 BugIdJSJS+ DOM

RQ2: Efficiency 26  Average reduction rate : 96% BugIdAllCoarse DOMJS+DOMExpectedRate(%) % % % % % % % % % %

Conclusion 27 Replay Javascript analysis DOM analysis JS+DOM … ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~

Questions? Thank you!