Asynchronous client-server communication is a common source of errors in JavaScript web applications. Such errors are difficult to detect using ordinary testing because of the nondeterministic scheduling of AJAX events. Existing automated event race detectors are not much help, because they are generally too imprecise or too inefficient to be practically useful. To address this problem, we present a new approach based on a light-weight combination of dynamic analysis and controlled execution that directly targets identification of harmful AJAX event races.
We experimentally demonstrate using our implementation, AjaxRacer, that this approach is capable of automatically detecting harmful AJAX event races in many websites, and producing informative error messages that support diagnosis and debugging. Among 20 widely used web pages that use AJAX, AjaxRacer discovers harmful AJAX races in 12 of them, with a total of 72 error reports, and with very few false positives
[ PDF | BibTeX | supplementary material ]