一句话:提出首个检测并验证端到端 Web 测试套件中测试依赖的方法与工具 TEDD,支持并行化执行。
端到端 Web 测试套件常因现代 Web 应用多层异构而出现测试依赖,开发者难以隔离每个测试用例的程序状态。本文提出首个检测并验证端到端 Web 测试套件中测试依赖的方法:先用字符串分析从测试代码抽取近似依赖集合,再通过对测试名称的自然语言处理过滤伪依赖,随后验证所有依赖,并用新的恢复算法确保最终依赖图不遗漏真实依赖。该方法实现为工具 TEDD,在六个开源 Web 应用测试套件上评估。结果显示,与保留原始测试顺序且包含所有可能依赖的依赖图基线相比,TEDD 能正确检测并验证测试依赖,速度最高快 72%;其生成的依赖图支持测试并行执行,最高取得 7 倍加速。
E2E web test suites are prone to test dependencies due to the heterogeneous multi-tiered nature of modern web apps, which makes it difficult for developers to create isolated program states for each test case. In this paper, we present the first approach for detecting and validating test dependencies present in E2E web test suites. Our approach employs string analysis to extract an approximated set of dependencies from the test code. It then filters potential false dependencies through natural language processing of test names. Finally, it validates all dependencies, and uses a novel recovery algorithm to ensure no true dependencies are missed in the final test dependency graph. Our approach is implemented in a tool called TEDD and evaluated on the test suites of six open-source web apps. Our results show that TEDD can correctly detect and validate test dependencies up to 72% faster than the baseline with the original test ordering in which the graph contains all possible dependencies. The test dependency graphs produced by TEDD enable test execution parallelization, with a speed-up factor of up to 7×.