Automatic invariant detection in dynamic web applications
F.P. Groeneveld, Ali Mesbah, Arie van Deursen · Research Repository (Delft University of Technology) · 2010
The complexity of modern web applications increases as client-side JavaScript and dynamic DOM programming are used to offer a more interactive web experience. In this paper, we focus on improving the dependability of such applications by automatically inferring invariants from the client-side and using those invariants for testing. By combining JavaScript code instrumentation and tracing we infer runtime program invariants. Furthermore, we dynamically analyze DOM-trees and use learning algorithms to detect template-based invariants per user interface state, across various states, as well as across multiple execution runs. Our open source implementation of the technique is agnostic to server-side technology and capable of automatically using the detected invariants for testing web applications. We demonstrate through a series of case studies that (1) codelevel and structural invariants exist in web applications with a large client-side state, (2) they can be automatically detected, (3) they can serve as regression test oracles