Lune

ASE2022Top-tier venue

Automatically Detecting Visual Bugs in HTML5 Canvas Games

Finlay Macklon, Mohammad Reza Taesiri, Markos Viggiato, Stefan Antoszko, Natalia Romanova, Dale Paas, Cor-Paul Bezemer

Abstract

The HTML5 <canvas> is used to display high quality graphics in web applications such as web games (i.e., <canvas> games). However, automatically testing <canvas> games is not possible with existing web testing techniques and tools, and manual testing is laborious. 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> games is onerous, defeating the purpose of test automation. In this paper, we present a novel approach to automatically detect visual bugs in <canvas> games. By leveraging an internal representation of objects on the <canvas>, we decompose snapshot images 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. We evaluate our approach by injecting 24 visual bugs into a custom <canvas> game, and find that our approach achieves an accuracy of 100%, compared to an accuracy of 44.6% with traditional snapshot testing.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

3 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Less Cybersickness, Please: Demystifying and Detecting Stereoscopic Visual Inconsistencies in Virtual Reality Apps cites GLIB: towards automated test oracle for graphically-rich applications
  • Less Cybersickness, Please: Demystifying and Detecting Stereoscopic Visual Inconsistencies in Virtual Reality Apps cites Seenomaly: vision-based linting of GUI animation effects against design-don't guidelines
  • GLIB: towards automated test oracle for graphically-rich applications cites Seenomaly: vision-based linting of GUI animation effects against design-don't guidelines
  • GLIB: towards automated test oracle for graphically-rich applications cites Unblind your apps: predicting natural-language labels for mobile GUI components by deep learning
  • Seenomaly: vision-based linting of GUI animation effects against design-don't guidelines cites Unblind your apps: predicting natural-language labels for mobile GUI components by deep learning
  • Unblind your apps: predicting natural-language labels for mobile GUI components by deep learning cites Seenomaly: vision-based linting of GUI animation effects against design-don't guidelines
  • VRExplorer: A Model-based Approach for Semi-Automated Testing of Virtual Reality Scenes cites GLIB: towards automated test oracle for graphically-rich applications
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers3

  1. Less Cybersickness, Please: Demystifying and Detecting Stereoscopic Visual Inconsistencies in Virtual Reality AppsShuqing Li, Cuiyun Gao, Jianping Zhang, Yujia Zhang et al.FSE 2024 · 10 citations
  2. VRExplorer: A Model-based Approach for Semi-Automated Testing of Virtual Reality ScenesZhengyang Zhu, Hong-Ning Dai, Hanyang Guo, Zeqin Liao et al.ASE 2025 · 1 citation
  3. When Fun Turns Toxic: A First Look at Aggressive Advertising in Mini-gamesPei Chen, Geng Hong, Yicheng Qin, Huazhe Wang et al.USENIX Security 2026

Builds on5

  1. Unblind your apps: predicting natural-language labels for mobile GUI components by deep learningJieshan Chen, Chunyang Chen, Zhenchang Xing, Xiwei Xu et al.ICSE 2020 · 101 citations
  2. Seenomaly: vision-based linting of GUI animation effects against design-don't guidelinesDehai Zhao, Zhenchang Xing, Chunyang Chen, Xiwei Xu et al.ICSE 2020 · 55 citations
  3. MarioNette: Self-Supervised Sprite LearningDmitriy Smirnov, Michaël Gharbi, Matthew Fisher, Vitor Guizilini et al.NeurIPS 2021 · 47 citations
  4. GLIB: towards automated test oracle for graphically-rich applicationsKe Chen, Yufei Li, Yingfeng Chen, Changjie Fan et al.FSE 2021 · 30 citations
  5. Semantic Web Accessibility Testing via Hierarchical Visual AnalysisMohammad Bajammal, Ali MesbahICSE 2021 · 29 citations

Related papers

  1. Automated Fixing of Web UI Tests via Iterative Element MatchingYuanzhang Lin, Guoyao Wen, Xiang GaoASE 2023 · 8 citations
  2. Janus: Detecting Rendering Bugs in Web Browsers via Visual Delta ConsistencyChijin Zhou, Quan Zhang, Bingzhou Qian, Yu JiangICSE 2025 · 2 citations
  3. Atropos: Effective Fuzzing of Web Applications for Server-Side VulnerabilitiesEmre Güler, Sergej Schumilo, Moritz Schloegel, Nils Bars et al.USENIX Security 2024 · 45 citations
  4. Finding All Cross-Site Needles in the DOM Stack: A Comprehensive Methodology for the Automatic XS-Leak Detection in Web BrowsersDominik Trevor Noß, Lukas Knittel, Christian Mainka, Marcus Niemietz et al.CCS 2023
  5. Metamong: Detecting Render-Update Bugs in Web Browsers through FuzzingSuhwan Song, Byoungyoung LeeFSE 2023 · 2 citations
Dusk over the sea between two cliffs drawn in fine vertical lines