Vejovis: suggesting fixes for JavaScript faults

JavaScript is used in web applications for achieving rich user interfaces and implementing core functionality. Unfortunately, JavaScript code is known to be prone to faults. In an earlier study, we found that over 65% of such faults are caused by the interaction of JavaScript code with the DOM at runtime (DOM-related faults). In this paper, we first perform an analysis of 190 bug reports to understand fixes commonly applied by programmers to these DOM-related faults; we observe that parameter replacements and DOM element validations are common fix categories. Based on these findings, we propose an automated technique and tool, called Vejovis, for suggesting repairs for DOM-based JavaScript faults. To evaluate Vejovis, we conduct a case study in which we subject Vejovis to 22 real-world bugs across 11 applications. We find that Vejovis accurately suggests repairs for 20 out of the 22 bugs, and in 13 of the 20 cases, the correct fix was the top ranked one.

[1]  Name M. Lastname Automatically Finding Patches Using Genetic Programming , 2013 .

[2]  Ali Mesbah,et al.  An Empirical Study of Client-Side JavaScript Bugs , 2013, 2013 ACM / IEEE International Symposium on Empirical Software Engineering and Measurement.

[3]  Sarfraz Khurshid,et al.  Assertion-based repair of complex data structures , 2007, ASE.

[4]  Martin C. Rinard,et al.  Data structure repair using goal-directed reasoning , 2005, ICSE.

[5]  Michael D. Ernst,et al.  Automatically repairing broken workflows for evolving GUI applications , 2013, ISSTA.

[6]  Michael D. Ernst,et al.  HAMPI: a solver for string constraints , 2009, ISSTA.

[7]  Frank Tip,et al.  Automated repair of HTML generation errors in PHP applications using string constraint solving , 2012, 2012 34th International Conference on Software Engineering (ICSE).

[8]  Alessandra Gorla,et al.  Automatic workarounds for web applications , 2010, FSE '10.

[9]  Ali Mesbah,et al.  AutoFLox: An Automatic Fault Localizer for Client-Side JavaScript , 2012, 2012 IEEE Fifth International Conference on Software Testing, Verification and Validation.

[10]  Andreas Zeller,et al.  Automated Fixing of Programs with Contracts , 2014 .

[11]  Karthik Pattabiraman,et al.  JavaScript Errors in the Wild: An Empirical Study , 2011, 2011 IEEE 22nd International Symposium on Software Reliability Engineering.

[12]  Xiangyu Zhang,et al.  Z3-str: a z3-based string solver for web application analysis , 2013, ESEC/FSE 2013.

[13]  Simon Holm Jensen,et al.  Remedying the eval that men do , 2012, ISSTA 2012.

[14]  Hung Viet Nguyen,et al.  Auto-locating and fix-propagating for HTML validation errors to PHP server-side code , 2011, 2011 26th IEEE/ACM International Conference on Automated Software Engineering (ASE 2011).

[15]  Jan Vitek,et al.  Eval begone!: semi-automated removal of eval from javascript programs , 2012, OOPSLA '12.

[16]  Xin Yao,et al.  A novel co-evolutionary approach to automatic software bug fixing , 2008, 2008 IEEE Congress on Evolutionary Computation (IEEE World Congress on Computational Intelligence).

[17]  Arie van Deursen,et al.  Crawling Ajax-Based Web Applications through Dynamic Analysis of User Interface State Changes , 2012, TWEB.