Automatic fault localization for client‐side JavaScript. (14th April 2015) - Ocariza, Frolin S.; Li, Guanpeng; Pattabiraman, Karthik; Mesbah, Ali
Summary: JAVASCRIPT is a scripting language that plays a prominent role in web applications today. It is dynamic, loosely typed and asynchronous and is extensively used to interact with the Document Object Model (DOM) at runtime. All these characteristics makeJAVASCRIPT code error‐prone; unfortunately, JAVASCRIPT fault localization remains a tedious and mainly manual task. Despite these challenges, the problem has received very limited research attention. This paper proposes an automated technique to localizeJAVASCRIPT faults based on dynamic analysis, tracing and backward slicing ofJAVASCRIPT code. This technique is capable of handling features ofJAVASCRIPT code that have traditionally been difficult to analyse, includingeval, anonymous functions and minified code. The approach is implemented in an open source tool calledAUTOFLOX, and evaluation results indicate that it is capable of (1) automatically localizing DOM‐relatedJAVASCRIPT faults with high accuracy (over 96%) and no false‐positives and (2) isolatingJAVASCRIPT faults in production websites and actual bugs from real‐world web applications. Copyright © 2015 John Wiley & Sons, Ltd. Abstract : This work proposes an approach for automatically localizing Document‐Object‐Model‐related (i.e. DOM‐related) JavaScript faults in AJAX‐based web applications. The technique has been implemented in a tool called AutoFLox, and it is capable of localizing faults in a wide array of web applications, including minified applications, as well as those using anonymous functions and eval. An evaluation of the proposed approach shows that it is accurate, with a recall of 96% and no false positives, and can localize real bugs from real‐world web applications.