JavaScript and web applications are very important aspects of the software products developed for both browser- and mobile-based applications. One pillar of such application development is the usage of JavaScript for interaction with clients (for example, the browser or the mobile device). Unfortunately, JavaScript is an error-prone language, and it is hard to debug, mostly due to the lack of tools helping both coders and testers. In particular, JavaScript bugs are subtle: They can either produce an error message or not (the code continues to be executed after the failure, without any message notice).
The authors contribute to this field of research by providing an empirical study that aims at classifying JavaScript bugs and using their results to aid coders, testers, and tool makers in improving the reliability of JavaScript coding. In particular, the authors collect and harmonize several bug reports in well-known software libraries and web applications over the years to answer questions like the following: Is it possible to provide common coding bad practice? Is there a predominance of error causes? Has the technology improved in recent years, and is it going in the right direction? Can we provide “hotspots” to the application tester to help find common bugs?
The study is a continuation of an earlier work on this topic. Among the many findings, a major result is that the document object model (DOM)-related bugs account for 68 percent of the overall bugs over the years. Such errors are mostly related to the discrepancy between the expected Hypertext Markup Language (HTML) tree and the actual one. Also, a non-neglected error cause can be related to the language itself: Method-parameter mismatch and type-related errors are still causes of failures. In fact, new languages have been proposed in this direction, such as TypeScript. However, the temporal analysis made by the author shows that such errors are steady.
This paper contains several points that product owners, software architects, coders, testers, and tool makers should take into account when dealing with web applications using JavaScript. Although the error causes are intuitively known by the audience, their systematic approach enforces the need to carefully plan and develop any JavaScript-related development. It is worth noticing that this study does not tackle the errors and faults related to server-side development (such as with NodeJS).