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

Abstract

JavaScript has become one of the most widely used languages for Web development. Its dynamic and event-driven features make it challenging to ensure the correctness of Web applications written in JavaScript. A variety of dynamic analysis techniques have been proposed which are, however, limited in either coverage or scalability. In this paper, we propose a simple, yet effective, model-based automated testing approach to achieve a high code-coverage within the time budget via testing with longer event sequences. We implement our approach as an open-source tool LJS, and perform extensive experiments on 21 publicly available benchmarks. On average, LJS is able to achieve 86.5% line coverage in 10 minutes. Compared with JSDep, a state-of-the-art breadth-first search based automated testing tool enriched with partial order reduction, the coverage of LJS is 11-19% higher than that of JSDep on real-world large web applications. Our empirical findings support that proper longer test sequences can achieve a higher code coverage in JavaScript Web Application testing.

Publication
In Frontiers of Computer Science 2022
Pengfei Gao
Pengfei Gao
Ph.D. student on Formal Verification