Web Canvas Testing Through Visual Inference

Canvas elements are one of the major web technologies for creating high-performance graphics and visualizations in the browser. The canvas provides APIs for directly painting on the screen, but does not have a DOM state. As such, common web testing techniques that rely on the DOM cannot be applied to canvas elements. Furthermore, there has been little to no research in the literature for testing canvas elements. We propose an automated approach for testing canvas elements and their properties. Our approach performs a visual analysis of the screenshots of canvas elements and infers visual objects, their attributes, and their hierarchical relationships present on the canvas. Each inferred object is then represented as an augmented element inside the canvas element on the DOM tree. Finally, tests are generated from the augmented canvas DOM with assertions that check the inferred objects. We implement this approach in a tool, CanvaSure, and evaluate its accuracy and effectiveness for testing canvas-based applications. Our evaluation results show that CanvaSure has an accuracy of 91% for visually inferring the contents of the canvas, and is capable of correctly detecting 93% of injected visual faults on canvas applications.

[1]  Paolo Tonella,et al.  Visual vs. DOM-Based Web Locators: An Empirical Study , 2014, ICWE.

[2]  Jiri Matas,et al.  Robust Detection of Lines Using the Progressive Probabilistic Hough Transform , 2000, Comput. Vis. Image Underst..

[3]  Alessandro Orso,et al.  WEBDIFF: Automated identification of cross-browser issues in web applications , 2010, 2010 IEEE International Conference on Software Maintenance.

[4]  Ali Mesbah,et al.  Mining questions asked by web developers , 2014, MSR 2014.

[5]  J.-b. Ryu,et al.  Formula for Harris corner detector , 2011 .

[6]  Michael S Tooms,et al.  Colour Reproduction in Electronic Imaging Systems: Photography, Television, Cinematography , 2015 .

[7]  Gabor T. Marth,et al.  Scribl: an HTML5 Canvas-based graphics library for visualizing genomic data over the web , 2013, Bioinform..

[8]  Oscar Westesson,et al.  Visualizing next-generation sequencing data with JBrowse , 2013, Briefings Bioinform..

[9]  L S Juan Diaz-de-Leon,et al.  On the computation of the Euler number of a binary object , 1996 .

[10]  Henning Hermjakob,et al.  The Reactome pathway knowledgebase , 2013, Nucleic Acids Res..

[11]  C. Fernandez-Maloigne Advanced Color Image Processing and Analysis , 2012 .

[12]  Anjaneyulu Pasala,et al.  Detecting and Localizing Visual Inconsistencies in Web Applications , 2016, 2016 23rd Asia-Pacific Software Engineering Conference (APSEC).

[13]  Suzanna E Lewis,et al.  JBrowse: a dynamic web platform for genome visualization and analysis , 2016, Genome Biology.

[14]  Juan Humberto Sossa Azuela,et al.  On the computation of the Euler number of a binary object , 1996, Pattern Recognit..

[15]  Hanno Scharr,et al.  Optimal operators in digital image processing , 2000 .

[16]  Heikki Kälviäinen,et al.  Randomized or probabilistic Hough transform: unified performance evaluation , 2000, Pattern Recognit. Lett..

[17]  Eric Jones,et al.  SciPy: Open Source Scientific Tools for Python , 2001 .

[18]  Paolo Tonella,et al.  Automated generation of visual web tests from DOM-based web tests , 2015, SAC.

[19]  W. Winkler Overview of Record Linkage and Current Research Directions , 2006 .

[20]  Marco Torchiano,et al.  Automated mobile UI test fragility: an exploratory assessment study on Android , 2016, INTUITEST@ISSTA.

[21]  Rogelio Arreola Creating visuals for math instruction using javascript and the HTML canvas element , 2016 .

[22]  Bülent Sankur,et al.  Survey over image thresholding techniques and quantitative performance evaluation , 2004, J. Electronic Imaging.

[23]  Michael D. Ernst,et al.  Explaining Visual Changes in Web Interfaces , 2015, UIST.

[24]  Stephan Nebiker,et al.  Web-Based Large-Scale 3D-Geovisualisation Using WebGL: The OpenWebGlobe Project , 2012, Int. J. 3 D Inf. Model..

[25]  Henning Hermjakob,et al.  The Reactome pathway Knowledgebase , 2015, Nucleic acids research.

[26]  Matthew Wright,et al.  The Web Browser As Synthesizer And Interface , 2013, NIME.

[27]  Scott A. Armstrong,et al.  iCanPlot: Visual Exploration of High-Throughput Omics Data Using Interactive Canvas Plotting , 2012, PloS one.

[28]  Marios Hadjieleftheriou,et al.  R-Trees - A Dynamic Index Structure for Spatial Searching , 2008, ACM SIGSPATIAL International Workshop on Advances in Geographic Information Systems.

[29]  Gaël Varoquaux,et al.  The NumPy Array: A Structure for Efficient Numerical Computation , 2011, Computing in Science & Engineering.