Automated Refactoring of Client-Side Java']JavaScript Code to ES6 Modules

被引:0
|
作者
Paltoglou, Aikaterini [1 ]
Zafeiris, Vassilis E. [1 ]
Giakoumakis, E. A. [1 ]
Diamantidis, N. A. [1 ]
机构
[1] Athens Univ Econ & Business, Dept Informat, 76 Patiss Str, Athens 10434, Greece
关键词
Refactoring; Client-side [!text type='Java']Java[!/text]Script; Global variables; ES6; Modules;
D O I
暂无
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
JavaScript (JS) is a dynamic, weakly-typed and object-based programming language that expanded its reach, in recent years, from the desktop web browser to a wide range of runtime platforms in embedded, mobile and server hosts. Moreover, the scope of functionality implemented in JS scaled from DOM manipulation in dynamic HTML pages to full-scale applications for various domains, stressing the need for code reusability and maintainability. Towards this direction, the ECMAScript 6 (ES6) revision of the language standardized the syntax for class and module definitions, streamlining the encapsulation of data and functionality at various levels of granularity. This work focuses on refactoring client-side web applications for the elimination of code smells, relevant to global variables and functions that are declared in JS files linked to a web page. These declarations "pollute" the global namespace at runtime and often lead to name conflicts with undesired effects. We propose a method for the encapsulation of global declarations through automated refactoring to ES6 modules. Our approach transforms each linked JS script of a web application to an ES6 module with appropriate import and export declarations that are inferred through static analysis. A prototype implementation of the proposed method, based on WALA libraries, has been evaluated on a set of open source projects. The evaluation results support the applicability and runtime efficiency of the proposed method.
引用
收藏
页码:402 / 412
页数:11
相关论文
共 45 条
  • [1] Automated refactoring of legacy Java']JavaScript code to ES6 modules
    Paltoglou, Katerina
    Zafeiris, Vassilis E.
    Diamantidis, N. A.
    Giakoumakis, E. A.
    [J]. JOURNAL OF SYSTEMS AND SOFTWARE, 2021, 181
  • [2] The effectiveness of client-side Java']JavaScript Testing
    Moon, Jonny
    Farnsworth, Brian
    Smith, Riley
    [J]. 2020 IEEE/ACM 15TH INTERNATIONAL CONFERENCE ON AUTOMATION OF SOFTWARE TEST, AST, 2020, : 101 - 102
  • [3] REST to Java']JavaScript for Better Client-side Development
    Cho, Hyunghun
    Ryu, Sukyoung
    [J]. WWW'14 COMPANION: PROCEEDINGS OF THE 23RD INTERNATIONAL CONFERENCE ON WORLD WIDE WEB, 2014, : 937 - 942
  • [4] Automatic fault localization for client-side Java']JavaScript
    Ocariza, Frolin S., Jr.
    Li, Guanpeng
    Pattabiraman, Karthik
    Mesbah, Ali
    [J]. SOFTWARE TESTING VERIFICATION & RELIABILITY, 2016, 26 (01): : 69 - 88
  • [5] Snapshot-Based Migration of ES6 Java']JavaScript
    Yoo, Yong-Hwan
    Moon, Soo-Mook
    [J]. WEB ENGINEERING, ICWE 2021, 2021, 12706 : 404 - 419
  • [6] A Study of Causes and Consequences of Client-Side Java']JavaScript Bugs
    Ocariza, Frolin S., Jr.
    Bajaj, Kartik
    Pattabiraman, Karthik
    Mesbah, Ali
    [J]. IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2017, 43 (02) : 128 - 144
  • [7] Efficient and Precise Dynamic Slicing for Client-Side Java']JavaScript Programs
    Ye, Jiabin
    Zhang, Cheng
    Ma, Lei
    Yu, Haibo
    Zhao, Jianjun
    [J]. 2016 IEEE 23RD INTERNATIONAL CONFERENCE ON SOFTWARE ANALYSIS, EVOLUTION, AND REENGINEERING (SANER), VOL 1, 2016, : 449 - 459
  • [8] Detecting Concurrency Errors in Client-side Java']JavaScript Web Applications
    Hong, Shin
    Park, Yongbae
    Kim, Moonzoo
    [J]. 2014 IEEE SEVENTH INTERNATIONAL CONFERENCE ON SOFTWARE TESTING, VERIFICATION AND VALIDATION (ICST), 2014, : 61 - 70
  • [9] DETECTING SERVER-SIDE ENDPOINTS IN WEB APPLICATIONS BASED ON STATIC ANALYSIS OF CLIENT-SIDE Java']JavaScript CODE
    Sigalov, D. A.
    Khashaev, A. A.
    Gamayunov, D. Yu.
    [J]. PRIKLADNAYA DISKRETNAYA MATEMATIKA, 2021, (53): : 32 - 54
  • [10] Finding Server-Side Endpoints with Static Analysis of Client-Side Java']JavaScript
    Sigalov, Daniil
    Gamayunov, Dennis
    [J]. COMPUTER SECURITY. ESORICS 2023 INTERNATIONAL WORKSHOPS, CPS4CIP, PT II, 2024, 14399 : 442 - 458