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

基于模型的JavaScript Web应用程序自动化测试

Model-based Automated Testing of JavaScript Web Applications via Longer Test Sequences

Pengfei Gao, Fu Song, Taolue Chen, Yao Zeng, Ting Su

摘要:

JavaScript已成为Web开发中使用最广泛的语言之一。然而,由于动态和事件驱动的特性,确保用JavaScript编写的Web应用程序的正确性和可靠性是具有挑战性的。针对JavaScript Web应用程序的动态分析技术已经有很多种,但它们在覆盖范围和可扩展性方面都有局限性。在本文中,我们提出了一种基于模型的自动化方法,通过测试较长的事件序列,在合理的时间内实现高代码覆盖率。我们将我们的方法实现为工具LJS,并在21个公开的基准测试(总共18,559行代码)上进行了广泛的实验。LJS平均在10分钟内达到86.4%的行覆盖率,比基于广度优先搜索的自动化测试工具JSDep高5.4%。特别是,在大型应用程序中,LJS的覆盖率比JSDep高11- 18%。我们的经验发现支持更长的测试序列可以实现更高的代码覆盖率在JavsScript测试。

英文摘要:

JavaScript has become one of the most widely used languages for Web development. However, it is challenging to ensure the correctness and reliability of Web applications written in JavaScript, due to their dynamic and event-driven features. A variety of dynamic analysis techniques for JavaScript Web applications have been proposed, but they are limited in either coverage or scalability. In this paper, we propose a model-based automated approach to achieve high code coverage in a reasonable amount of time via testing with longer event sequences. We implement our approach as the tool LJS, and perform extensive experiments on 21 publicly available benchmarks (18,559 lines of code in total). On average, LJS achieves 86.4\% line coverage in 10 minutes, which is 5.4\% higher than that of JSDep, a breadth-first search based automated testing tool enriched with partial order reduction. In particular, on large applications, the coverage of LJS is 11-18\% higher than that of JSDep. Our empirical finding supports that longer test sequences can achieve higher code coverage in JavsScript testing.

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

↑