Capítulo de libro
Statically identifying class dependencies in legacy JavaScript systems: First results
Fecha
2017Registro en:
En: 2017 IEEE 24th International Conference on Software Analysis, Evolution and Reengineering (SANER)
10.1109/SANER.2017.7884647
Autor
Silva, Leonardo Humberto
Valente, Marco Tulio
Bergel, Alexandre
Institución
Resumen
Identifying dependencies between classes is an essen-tial activity when maintaining and evolving software applications.It is also known that JavaScript developers often use classes tostructure their projects. This happens even in legacy code, i.e.,code implemented in JavaScript versions that do not providesyntactical support to classes. However, identifying associationsand other dependencies between classes remain a challenge dueto the lack of static type annotations. This paper investigates theuse of type inference to identify relations between classes in legacyJavaScript code. To this purpose, we rely on Flow, a state-of-the-art type checker and inferencer tool for JavaScript. We performa study using code with and without annotating the class importstatements in two modular applications. The results show thatprecision is 100% in both systems, and that the annotated versionimproves the recall, ranging from 37% to 51% for dependenciesin general and from 54% to 85% for associations. Therefore,we hypothesize that these tools should also depend on dynamicanalysis to cover all possible dependencies in JavaScript code.