arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2602.19098cs.SE
收藏

对JavaScript测试中环境刺鼻性的一次系统评估

A Systematic Evaluation of Environmental Flakiness in JavaScript Tests

Massey University(梅西大学);Victoria University of Wellington(惠灵顿维多利亚大学);The University of Texas at Austin(德克萨斯大学奥斯汀分校)

Negar Hashemi, Amjed Tahir, August Shi, Shawn Rasheed, Rachel Blagojevic

AI总结:

本文针对JavaScript测试中环境因素导致的刺鼻性问题,提出js-env-sanitizer工具,通过跳过和报告刺鼻测试以提高CI构建效率。

摘要:

测试刺鼻性是工业中的重大问题,影响测试效率和产品质量。尽管已有大量研究探讨了刺鼻测试的影响,但许多根本原因仍未被探索,特别是在动态语言如JavaScript的背景下。在本文中,我们对JavaScript中环境因素对测试刺鼻性的影响进行了系统评估。我们首先在多个环境配置上执行了测试套件,以确定环境变化是否会导致刺鼻行为。我们选择了三个环境因素进行操控:操作系统、Node.js版本和浏览器。我们确定了总共65个环境刺鼻项目,其中28个与操作系统问题有关,5个与Node.js版本兼容性有关,16个与操作系统和Node.js的组合问题有关,17个与浏览器兼容性有关。为了解决环境刺鼻性,我们开发了一种轻量级的缓解方法js-env-sanitizer,该方法可以通过跳过并报告刺鼻测试(而不是失败)来净化环境相关的刺鼻测试,使CI构建能够继续/成功,而无需重新运行整个测试套件。该工具具有高准确性,且具有最小的性能或配置开销,目前支持三种流行的JavaScript测试框架(Jest、Mocha和Vitest)

英文摘要:

Test flakiness is a significant issue in industry, affecting test efficiency and product quality. While extensive research has examined the impact of flaky tests, many root causes remain unexplored, particularly in the context of dynamic languages such as JavaScript. In this paper, we conduct a systematic evaluation of the impact of environmental factors on test flakiness in JavaScript. We first executed test suites across multiple environmental configurations to determine whether changes in the environment could lead to flaky behavior. We selected three environmental factors to manipulate: the operating system, the Node.js version, and the browser. We identified a total of 65 environmental flaky projects, with 28 related to operating system issues, five to Node.js version compatibility, 16 to a combination of operating system and Node.js issues, and 17 related to browser compatibility. To address environmental flakiness, we developed a lightweight mitigation approach, js-env-sanitizer, that can sanitize environmental-related flaky tests by skipping and reporting them (rather than failing), allowing CI builds to continue/succeed without rerunning entire test suites. The tool achieves high accuracy with minimal performance or configuration overhead, and currently supports three popular JavaScript testing frameworks (Jest, Mocha, and Vitest)

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑