Root Cause Analysis for HTML Presentation Failures using Search-Based Techniques Sonal Mahajan, Bailan Li, William G.J. Halfond Department of Computer.

Slides:



Advertisements
Similar presentations
JavaScript I. JavaScript is an object oriented programming language used to add interactivity to web pages. Different from Java, even though bears some.
Advertisements

Using Parallel Genetic Algorithm in a Predictive Job Scheduling
Principles of Web Design 5 th Edition Chapter Nine Site Navigation.
Web Pages and Style Sheets Bert Wachsmuth. HTML versus XHTML XHTML is a stricter version of HTML: HTML + stricter rules = XHTML. XHTML Rule violations:
Web Design with Cascading Style Sheet Lan Vu. Overview Introduction to CSS Designing CSS Using Visual Studio to create CSS Using template for web design.
Week 9 Using the Box Properties. 9-2 The CSS Visual Formatting Model Describes how the element content boxes should be displayed by the browser –Based.
Stylin’ with CSS. 2 Topics What is CSS? Why CSS? CSS Examples.
Prioritizing User-session-based Test Cases for Web Applications Testing Sreedevi Sampath, Renne C. Bryce, Gokulanand Viswanath, Vani Kandimalla, A.Gunes.
Text Properties, Line Box, CSS. Text Properties Properties related to the display of text. Text-align : left, right, center I like FSU!
SBSE Course 3. EA applications to SE Analysis Design Implementation Testing Reference: Evolutionary Computing in Search-Based Software Engineering Leo.
Finding Presentation Failures Using Image Comparison Techniques Sonal Mahajan and William G.J. Halfond Department of Computer Science University of Southern.
Chapter 16 Dynamic HTML and Animation The Web Warrior Guide to Web Design Technologies.
Page-level Template Detection via Isotonic Smoothing Deepayan ChakrabartiYahoo! Research Ravi KumarYahoo! Research Kunal PuneraUniv. of Texas at Austin.
Michael Ernst, page 1 Improving Test Suites via Operational Abstraction Michael Ernst MIT Lab for Computer Science Joint.
Parameterizing Random Test Data According to Equivalence Classes Chris Murphy, Gail Kaiser, Marta Arias Columbia University.
4.01 Cascading Style Sheets
University of Southern California Center for Software Engineering CSE USC ©USC-CSE 3/11/2002 Empirical Methods for Benchmarking High Dependability The.
Automated Diagnosis of Software Configuration Errors
CS527: (Advanced) Topics in Software Engineering Overview of Software Quality Assurance Tao Xie ©D. Marinov, T. Xie.
_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1.
Image Use. Agenda Ordinary display of image: height, width, alt Rollovers Images as links (remove blue surround) Background images: stretch, tile, xonly/yonly.
Week 4.  Three ways to apply CSS: Inline CSS Internal style sheets ( header style information) External style sheets.
Tutorial 4: Using CSS for Page Layout. 2 Objectives Session 4.1 Explore CSS layout Compare types of floating layouts Examine code for CSS layouts View.
WorkPlace Pro Utilities.
Database-Driven Web Sites, Second Edition1 Chapter 8 Processing ASP.NET Web Forms and Working With Server Controls.
Genetic Algorithm.
Today’s objectives  Complete web page  Using xhtml & CSS  Adding CSS to documents Embed url(File);  CSS.
WebSee: A Tool for Debugging HTML Presentation Failures Sonal Mahajan and William G. J. Halfond Department of Computer Science University of Southern California.
Prakash Chockalingam Clemson University Non-Rigid Multi-Modal Object Tracking Using Gaussian Mixture Models Committee Members Dr Stan Birchfield (chair)
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
CSS The Definitive Guide Chapter 8.  Allows one to define borders for  paragraphs  headings  divs  anchors  images  and more.
JavaScript II ECT 270 Robin Burke. Outline JavaScript review Processing Syntax Events and event handling Form validation.
Chapter 12 Cascading Style Sheets: Part II The Web Warrior Guide to Web Design Technologies.
Analysis of DOM Structures for Site-Level Template Extraction (PSI 2015) Joint work done in colaboration with Julián Alarte, Josep Silva, Salvador Tamarit.
ASP.NET Web Server Controls Basic Web Server Controls.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
Introduction to Applets CS 3505 Client Side Scripting with applets.
Just A Few More Fun Objectives 1 Having Some Fun With Java Script 2 Using Style Sheets.
Session 1 SESSION 1 Working with Dreamweaver 8.0.
Bug Localization with Machine Learning Techniques Wujie Zheng
WebVizOr: A Fault Detection Visualization Tool for Web Applications Goal: Illustrate and evaluate the uses of WebVizOr, a new tool to aid web application.
CSS. HTML: Looking Back HTML dictates order, structure, and function Does very little to specify layout or visual rendering.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
WEB DESIGN AND PROGRAMMING Advanced CSS Techniques.
Which Configuration Option Should I Change? Sai Zhang, Michael D. Ernst University of Washington Presented by: Kıvanç Muşlu.
Predictive Design Space Exploration Using Genetically Programmed Response Surfaces Henry Cook Department of Electrical Engineering and Computer Science.
Applying Genetic Algorithm to the Knapsack Problem Qi Su ECE 539 Spring 2001 Course Project.
Automatically Repairing Broken Workflows for Evolving GUI Applications Sai Zhang University of Washington Joint work with: Hao Lü, Michael D. Ernst.
Chapter 2: Variables, Functions, Objects, and Events JavaScript - Introductory.
Week 8 – Part 2 Page Layout Basics Key Concepts 1.
Principles of Web Design 6 th Edition Chapter 9 – Site Navigation.
Course created by Sarah Phillips BBCD Melbourne BAPDCOM Version 1 – April 2013.
CISC Machine Learning for Solving Systems Problems Presented by: Suman Chander B Dept of Computer & Information Sciences University of Delaware Automatic.
Project 2: Classification Using Genetic Programming Kim, MinHyeok Biointelligence laboratory Artificial.
Coevolutionary Automated Software Correction Josh Wilkerson PhD Candidate in Computer Science Missouri S&T.
Introduction to HTML. _______________________________________________________________________________________________________________ 2 Outline Key issues.
HTML A brief introduction HTML1. HTML, what is? HTML is a markup language for describing web documents (web pages). HTML stands for Hyper Text Markup.
Practical Strategies for Debugging Cross-Browser Display Issues Lori Dirks Expression Community Website Manager Twitter.com/msexpression.
JavaScript Introduction and Background. 2 Web languages Three formal languages HTML JavaScript CSS Three different tasks Document description Client-side.
XP New Perspectives on Macromedia Dreamweaver MX 2004 Tutorial 5 1 Adding Shared Site Elements.
CSCE Chapter 3 (Cascading Style Sheets) CSCE General Applications Programming Benito Mendoza 1 By Benito Mendoza Department of Computer.
>> CSS Layouts. Recall Properties of Box – Border (style, width, color) – Padding – Margin – Display – Background – Dimension Welcome Padding Area Border.
Laying out Elements with CSS
Detecting and Localizing Internationalization
Based on Menu Information
Sonal Mahajan, Bailan Li, Pooyan Behnamghader, William G. J. Halfond
Web Development & Design Foundations with H T M L 5
CSE 1020:Software Development
Presentation transcript:

Root Cause Analysis for HTML Presentation Failures using Search-Based Techniques Sonal Mahajan, Bailan Li, William G.J. Halfond Department of Computer Science University of Southern California

What is a presentation failure? Web page rendering ≠ expected appearance Expected appearance (oracle)Web page rendering

What is a presentation failure? Web page rendering ≠ expected appearance Difference 1: Alignment problem Expected appearance (oracle)Web page rendering

What is a presentation failure? Web page rendering ≠ expected appearance Difference 2: Color problem Expected appearance (oracle)Web page rendering

What is a presentation failure? Web page rendering ≠ expected appearance Difference 3: Style problem Expected appearance (oracle)Web page rendering

Presentation Failures Common in modern web applications – Highly complex – Dynamic nature of HTML, CSS, Javascript Difficult to diagnose and debug – Each page has hundreds of HTML elements – Each HTML element contains several styling properties

Why is handling presentation failures important? Presentation of a website – factors company branding – gives first impression about your business Presentation failures can – impact usability – negative perception about quality

When do presentation failures occur? 1.Front-end developer did not comply to pixel- perfect implementation [1] 2.Refactoring of UI 3.Web application was not tested sufficiently

Need to Debug Presentation Failures Throughout the development process 3 such scenarios - 1.Presentation Development Testing 2.Regression Debugging 3.Standard Debugging

1. Presentation Development Testing Front-end developers – Expected to convert mockups to “pixel perfect” template pages

“Pixel-perfect” pages… Is it reasonable?

1. Presentation Development Testing Front-end developers – Expected to convert mockups to “pixel perfect” template pages Back-end developers – Change templates by adding dynamic content Test to check if the implemented page is compliant with the given mockup Expected appearance (oracle) –> mockup

2. Regression Debugging Changes to code after initial implementation – E.g.: Refactoring page from based layout to based layout Changes not intended to change appearance Change may have direct or indirect impact Test for presentation failures and debug to find responsible HTML elements Expected appearance (oracle) -> previous correct version of the page

3. Standard Debugging Make corrective code changes based on bug reports – E.g.: Resolve user-reported failures Reproduce the failure and debug Expected appearance (oracle) -> marked screenshot with failure area

What is root cause of a presentation failure? Root cause Faulty HTML element Faulty visual property CSS property HTML attribute

Limitations of Related Approaches Manual interaction – Browser developer tools (e.g.: Firebug) – Labor-intensive and error-prone Selenium, Sikuli – Require to exhaustively specify correctness invariants Cross-browser testing – Cannot report exact root cause – faulty visual property Fighting layout bugs – Cannot report a root cause and application independent DOM differencing – Techniques such as XBT, GUI differencing, automated oracles – Assume “golden” version of the page – Cannot be used if no golden version or DOM has changed

Simple Approach Brute force exploration of possible root cause space 1.Substitute different values for each root cause 2.Compare web page and oracle 3.If same appearance, stop, else continue Limitation – Large universe of possible values E.g.: Margin property: [-∞, +∞] Color property: 16 million colors – Very expensive

New Idea Key Insights 1.Image processing defines successful search Compare web page and oracle Correct root cause identified 2.Image processing guides search Fitness functions (E.g. minimizing difference pixels) Use image processing to define root cause analysis as a search based technique

Mapping Root Cause Analysis to Search-based Problem Motivations – Large search space of root causes – Image processing to define search parameters – Availability of oracle image -> natural form of invariant specifications Use genetic algorithm

Genetic algorithm Population: Possible values for a visual property Initial population: Generated randomly Selection: Linear ranking Crossover: One point Mutation: Uniform mutation Fitness function: Minimize visual differences Stopping criteria: web page = oracle

Core Idea Try different values for a candidate root cause Fitness value = compare web page and oracle If max. fitness value (web page = oracle) – Stop Else – Continue search

Example Candidate root cause: Population: [-∞, +∞] Initial population: {20, 50, 100, …, 0, 5} OracleTest web page

Example

Match found!

Example Correct root cause found!

Basic Technique 1.Detect presentation failure Faulty HTML element 2.Find root cause Faulty visual property 

Prior work: WebSee [2] Goal: Detect and localize presentation failures Input: Test web page, oracle Output: Prioritized list of HTML elements Phases 1.Detection: Image processing techniques to find visual differences 2.Localization: Maps HTML elements to visual differences 3.Result set processing: Prioritizes HTML elements based on heuristics

Basic Technique 1.Detect presentation failure Faulty HTML element 2.Find root cause Faulty visual property 

Classification of Visual Properties Effective use of search-based techniques Define appropriate fitness function Based on the impact on rendering of HTML element 1.Size and Position 2.Color 3.Predefined values

Category 1: Size and Position E.g.: margin, padding, height, width Numeric values Population: [-∞, +∞] Fitness function – Minimize number of difference pixels – Property value Number of difference pixels

Example OracleTest web page

Example e = {... } Number of difference pixels = 300 Value = 50px -> No. of difference pixels = 2,100 Value = 2px -> No. of difference pixels = 175 Value = 5px -> No. of difference pixels =

Category 2: Color E.g.: text color, background-color, border-color Color value – 140 color names – 16 million colors (# to #FFFFFF) Population: [#000000, #FFFFFF] Fitness function – Minimize number of difference pixels -> not useful – Determine expected color from oracle -> complex – Use minimizing color distance

Category 2: Color analysis (… contd.) Color distance: Euclidean distance between RGB Oracle avg = Compute average color in oracle Test avg = Compute average color in test web page screenshot Color distance = dist (Oracle avg, Test avg ) Property value color distance Final check -> full image comparison

Example OracleTest web page

Example e = {... } Average oracle color = #FFA000 Average test screenshot color = #8E8E8E Color distance = 369 Value = #FFFFFF -> color distance = 394 Value = #FFF000 -> color distance = 32 Value = #FF0000 -> color distance =

Category 3: Predefined values E.g.: font-style, display, font-family, border-style Set of discrete predefined values – font-style = {italic, oblique, normal} Exploration method – No notion “closeness” to guide search Genetic algorithm not used – Use exhaustive exploration – Not very expensive max. 21 elements, avg. 5 elements

Experiment Evaluate accuracy Compare results with random search Evaluated for Category 1 and 2 only Subject application: Gmail homepage Oracle: Gmail homepage screenshot Test cases: Seeded faults

Implementation steps Goal: Find root cause of presentation failure Input: 1.P: Test web page 2.O: oracle 3.E: set of potentially faulty HTML elements (provided by WebSee) Output: Root cause

Implementation steps (… contd.) 1.Find possible root cause space 2.Find pool of possibly correct values for each root cause 3.Use genetic algorithm to select candidate value 4.Substitute selected value in web page 5.Compare web page and oracle 6.If web page = oracle, then return root cause 7.Else, continue

Experimental Procedure Total 37 test cases Run both, our and random, approaches 5 times on each test case = 37 * 5 * 2 = 370 executions Limit search space for experiment to run within 24 hours = 24 hours / 370 ≈ 3.89 min Terminate random approach based on genetic algorithm

Experimental results CategoryRCARandom SearchTest # 1. Numeric100%59%30 2. Color100%37%7 Total100%55%37

Experimental results CategoryRCARandom SearchTest # 1. Numeric100%59%30 2. Color100%37%7 Total100%55%37 Conclusions – Validates feasibility of our search-based approach – Outperform random search Threats to validity – Restriction on the search space – Small sample of web applications CategoryRCARandom SearchTest # 1. Numeric100%59%30 2. Color100%37%7 Total100%55%37

Future Work Improve performance – Improve search space initialization E.g.: For category 1, use sub-image searching – Prioritize visual properties Create a comprehensive search framework Improve fitness functions Handle limitation of presence of faulty property Handle multiple failures Evaluate several real web applications

Summary 1.Technique for automatic root cause analysis 2.Root cause analysis mapped as a search problem 3.Helpful in debugging presentation failures 4.No HTML/CSS expertise required 5.High accuracy compared to random search

References 1.Front-end Developers Job Postings, URL: spmahaja/front- end-job-postings/, Apr S. Mahajan and W. G. Halfond. Finding HTML Presentation Failures Using Image Comparison Techniques. In submission, 2014.