Back to search

University of Alberta

Automatically Detecting Visual Bugs in HTML5 <canvas> Applications

Abstract

dc:description.abstract

The HTML5 <canvas> is useful for creating visual-centric web applications such as games or data visualizations. However, the combination of web, GUI, and visual techniques that are required to build <canvas> applications, together with a lack of testing and debugging tools, makes developing such applications very challenging. Many widely used web testing tools rely on the Document Object Model (DOM) to drive web test automation, but the contents of the <canvas> are not represented in the DOM. The main alternative approach, snapshot testing, involves comparing oracle snapshot images with test-time snapshot images using an image similarity metric to catch visual bugs, i.e., bugs in the graphics of the web application. However, creating and maintaining oracle snapshot images for <canvas> applications is onerous, defeating the purpose of test automation. Instead, <canvas> applications are mostly tested manually, but it is challenging to manually detect the wide variety of possible <canvas> bugs which often have unique causes. This thesis addresses whether it is feasible to automatically detect visual bugs in <canvas> applications such that manual testing processes may focus on detecting a more manageable subset of bugs. The first study in this thesis presents a taxonomy of testable HTML5 <canvas> issues, constructed to help direct future research on HTML5 <canvas> testing. First, 2,403 <canvas>-related issue reports were extracted from 123 open source GitHub projects that use the HTML5 <canvas>. Then, the taxonomy was constructed through a manual classification process with a random sample of 332 issue reports. Finally, the taxonomy was validated through an additional manual classification process with issue reports from an industrial <canvas> application. Five broad categories of testable <canvas> issues were identified, and it was found that Visual bugs are the most frequently reported testable issue category in the studied open-source projects. Four types of Visual bugs were defined: Layout, Rendering, Appearance, and State. The second study in this thesis presents a novel regression testing approach for detecting visual bugs in HTML5 <canvas> applications that use image assets. By leveraging the internal representation of objects on the <canvas> provided by a <canvas> rendering framework, snapshot images are decomposed into a set of object images, each of which is compared with a respective oracle asset (e.g., a sprite) using four similarity metrics: percentage overlap, mean squared error, structural similarity, and embedding similarity. The approach was evaluated by injecting 24 visual bugs into a custom <canvas> application, and it was found that this approach performs much better than traditional snapshot testing for detecting Layout, Rendering, Appearance, and State bugs. The third study in this thesis explores the capabilities of Vision-Language Models (VLMs) to detect visual bugs in HTML5 <canvas> applications. A dataset was constructed containing 80 screenshots injected with visual bugs across four visual bug types plus 20 bug-free screenshots from a collection of 20 free and open-source software (FOSS) HTML5 <canvas> applications. Experiments were conducted with a state-of-the-art VLM (GPT-4o) using varying combinations of text and image context to describe each application’s expected functionality. It was found that by providing sufficient context about the correct functionality of an application, VLMs can be leveraged primarily to detect State bugs. This approach may also be used to detect Layout and Rendering bugs, but is least effective for detecting Appearance bugs. This thesis concludes that it is feasible to automatically detect visual bugs in <canvas> applications such that manual testing processes may focus on detecting a more manageable subset of <canvas> bugs. Additionally, this thesis yields insights on testable <canvas> issues, <canvas> testing, and future directions for <canvas> testing research.

Degree

thesis:*
Name thesis:degree_name
Doctor of Philosophy
Level thesis:degree_level
Doctoral
Discipline thesis:degree_discipline
Software Engineering and Intelligent Systems
Grantor
University of Alberta
Year dc:date.issued
2025

Author and committee

dc:creator, dc:contributor.*
Author dc:creator
  • Macklon, Finlay Thomas Carr
Advisor dc:contributor.advisor
  • Bezemer, Cor-Paul (Electrical and Computer Engineering)

Subjects

dc:subject × 3

Rights

dc:rights
Statement dc:rights
  • This thesis is made available by the University of Alberta Library with permission of the copyright owner solely for non-commercial purposes. This thesis, or any portion thereof, may not otherwise be copied or reproduced without the written consent of the copyright owner, except to the extent permitted by Canadian copyright law.
Language dc:language.iso
en

Identifiers

dc:identifier.*
DOI dc:identifier.doi
https://doi.org/10.7939/82024

Chain of custody

source
Harvested from
University of Alberta
Base URL
era.library.ualberta.ca/oai
Last updated
2026-11-26
Source record
OAI-PMH GetRecord
citation

Macklon, Finlay Thomas Carr. Automatically Detecting Visual Bugs in HTML5 <canvas> Applications. Doctoral thesis, University of Alberta, 2025. https://doi.org/10.7939/82024