通过等效变异检测命令式数据可视化库中的渲染错误
Detecting Rendering Bugs in Imperative Data Visualization Libraries via Equivalent Mutations
AI总结:
研究命令式数据可视化库渲染错误难检测问题,提出 VIZDETOUR 方法,通过将预言机问题转化为等价性检查,利用构建渲染树等方式生成变异序列,经感知哈希比较输出,有效发现多个未知渲染错误。
AI中文摘要:
命令式数据可视化库通过一系列有状态 API 调用构建图表,渲染错误常表现为不正确的视觉输出,难以自动检测。本文提出 VIZDETOUR,一种通过等效变异检测渲染错误的自动化测试方法。其将预言机问题转化为等价性检查问题,从种子绘图脚本出发,通过构建渲染树、识别可追踪图形元素和可变属性来生成变异序列,用感知哈希比较渲染输出。在 matplotlib、bokeh 和 plotly 上评估发现 47 个未知错误,39 个被确认,18 个被修复。
英文摘要:
Imperative data visualization libraries construct plots through a sequence of stateful API calls that incrementally create and update graphic elements. Rendering bugs in these libraries often manifest as incorrect visual outputs rather than crashes or exceptions, making them difficult to detect automatically. A fundamental challenge is the lack of an oracle that specifies the expected rendering of an arbitrary plotting script. Furthermore, an update to one graphic element may inadvertently affect other elements or properties, leading to subtle inconsistencies in the final rendered image. This paper presents VIZDETOUR, an automated testing approach for detecting rendering bugs in imperative data visualization libraries via equivalent mutations. The key idea is to transform the oracle problem into an equivalence-checking problem. Starting from a seed plotting script, VIZDETOUR appends a short sequence of semantically equivalent API calls that temporarily modify the visualization state and then restore it to its original state. Although these mutations exercise different execution paths, they should preserve the final rendering. Any visual discrepancy between the original and mutated scripts therefore indicates a rendering bug. To generate such mutations, VIZDETOUR constructs a render tree from the seed script, identifies traceable graphic elements and mutable properties, and synthesizes endpoint-preserving mutation sequences. It then compares the rendered outputs using perceptual hashing. We evaluate VIZDETOUR on matplotlib, bokeh, and plotly using scripts collected from their official example galleries. VIZDETOUR discovers 47 previously unknown bugs, of which 39 are confirmed and 18 are fixed.