Discovering bug patterns in JavaScript
Authors:
Open Access
- 1 November 2016
- conference paper
- Published by Association for Computing Machinery (ACM)
- p. 144-156
Abstract
JavaScript has become the most popular language used by developers for client and server side programming. The language, however, still lacks proper support in the form of warnings about potential bugs in the code. Most bug finding tools in use today cover bug patterns that are discovered by reading best practices or through developer intuition and anecdotal observation. As such, it is still unclear which bugs happen frequently in practice and which are important for developers to be fixed. We propose a novel semi-automatic technique, called BugAID, for discovering the most prevalent and detectable bug patterns. BugAID is based on unsupervised machine learning using language-construct-based changes distilled from AST differencing of bug fixes in the code. We present a large-scale study of common bug patterns by mining 105K commits from 134 server-side JavaScript projects. We discover 219 bug fixing change types and discuss 13 pervasive bug patterns that occur across multiple projects and can likely be prevented with better tool support. Our findings are useful for improving tools and techniques to prevent common bugs in JavaScript, guiding tool integration for IDEs, and making developers aware of common mistakes involved with programming in JavaScript.Keywords
This publication has 40 references indexed in Scilit:
- DLint: dynamically checking bad coding practices in JavaScript2015
- Detecting Inconsistencies in JavaScript MVC Applications2015
- Bug characteristics in open source softwareEmpirical Software Engineering, 2013
- Correlation Tracking for Points-To Analysis of JavaScript2012
- The Eval That Men Do2011
- The WEKA data mining softwareACM SIGKDD Explorations Newsletter, 2009
- Type Analysis for JavaScript2009
- Toward an understanding of bug fix patternsEmpirical Software Engineering, 2008
- DynaMineACM SIGSOFT Software Engineering Notes, 2005
- Finding bugs is easyACM SIGPLAN Notices, 2004