Detecting Function Constructors in JavaScript

Prior to the recent updates of the JavaScript language specifications, developers had to use custom solutions to emulate constructs such as classes, modules, and namespaces in JavaScript programs. This paper introduces JSDEODORANT, an automatic approach for detecting function constructors declared locally, under a namespace, or even in other modules. The comparison with the state-of-the-art tool, JSClassFinder, shows that while the precision of the tools is very similar (97% and 98%), the recall of JSDEODORANT (98%) is much higher than JSClassFinder (61%).

[1]  Marco Tulio Valente,et al.  Does JavaScript software embrace classes? , 2015, 2015 IEEE 22nd International Conference on Software Analysis, Evolution, and Reengineering (SANER).

[2]  Ali Mesbah,et al.  Software Analysis for the Web: Achievements and Prospects , 2016, 2016 IEEE 23rd International Conference on Software Analysis, Evolution, and Reengineering (SANER).

[3]  James R. Cordy,et al.  Normalizing object-oriented class styles in JavaScript , 2012, 2012 14th IEEE International Symposium on Web Systems Evolution (WSE).

[4]  Addy Osmani Learning JavaScript Design Patterns - a JavaScript and jQuery Developer's Guide , 2012 .

[5]  Amin Milani Fard,et al.  JSNOSE: Detecting JavaScript Code Smells , 2013, 2013 IEEE 13th International Working Conference on Source Code Analysis and Manipulation (SCAM).