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

基于片段的Web应用程序测试生成

Fragment-Based Test Generation For Web Apps

Rahulkrishna Yandrapally, Ali Mesbah

摘要:

自动化的基于模型的测试生成提供了一种可行的替代方案,以取代目前用于Web应用程序回归测试的昂贵的手动测试创建。然而,现有的模型推理技术依赖于基于阈值的整页比较来建立状态等价,这不能可靠地识别现代Web应用程序中的近似重复网页。因此,现有的技术产生的动态Web应用程序的模型不足,脆弱的测试预言机,使生成的回归测试套件无效。我们提出了一个基于模型的测试生成技术,FRAGGEN,消除了阈值的需要,通过采用一种新的状态抽象的基础上页碎片建立状态等价。FRAGGEN还使用细粒度的页面片段分析来多样化状态探索并生成可靠的测试预言机。我们的评估表明,FRAGGEN通过检测更多的近似重复,推断更好的Web应用程序模型和生成更适合回归测试的测试套件,优于现有的整页技术。在86,165个状态对的数据集上,与整页技术相比,FRAGGEN平均检测到123%的近似重复。FRAGGEN推断的抓取模型平均有62%的准确率和70%的召回率。FRAGGEN还生成可靠的回归测试套件,即使执行环境不同,测试操作在同一版本的Web应用程序上也有接近100%的成功率。FRAGGEN生成的测试预言机可以检测到网页中98.7%的可见变化,同时具有高度的鲁棒性,使其适合于回归测试。

英文摘要:

Automated model-based test generation presents a viable alternative to the costly manual test creation currently employed for regression testing of web apps. However, existing model inference techniques rely on threshold-based whole-page comparison to establish state equivalence, which cannot reliably identify near-duplicate web pages in modern web apps. Consequently, existing techniques produce inadequate models for dynamic web apps, and fragile test oracles, rendering the generated regression test suites ineffective. We propose a model-based test generation technique, FRAGGEN, that eliminates the need for thresholds, by employing a novel state abstraction based on page fragmentation to establish state equivalence. FRAGGEN also uses fine-grained page fragment analysis to diversify state exploration and generate reliable test oracles. Our evaluation shows that FRAGGEN outperforms existing whole-page techniques by detecting more near-duplicates, inferring better web app models and generating test suites that are better suited for regression testing. On a dataset of 86,165 state-pairs, FRAGGEN detected 123% more near-duplicates on average compared to whole-page techniques. The crawl models inferred by FRAGGEN have 62% more precision and 70% more recall on average. FRAGGEN also generates reliable regression test suites with test actions that have nearly 100% success rate on the same version of the web app even if the execution environment is varied. The test oracles generated by FRAGGEN can detect 98.7% of the visible changes in web pages while being highly robust, making them suitable for regression testing.

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

↑