The JavaScript language did not specify, until ECMAScript 6 (ES6), native features for streamlining encapsulation and modularity. Developer community filled the gap with a proliferation of design patterns and module formats, with impact on code reusability, portability and complexity of build configurations. This work studies the automated refactoring of legacy ES5 code to ES6 modules with fine-grained reuse of module contents through the named import/export language constructs. The focus is on reducing the coupling of refactored modules through destructuring exported module objects to fine-grained module features and enhancing module dependencies by leveraging the ES6 syntax. We employ static analysis to construct a model of a JavaScript project, the Module Dependence Graph (MDG), that represents modules and their dependencies. On the basis of MDG we specify the refactoring procedure for module migration to ES6. A prototype implementation has been empirically evaluated on 19 open source projects. Results highlight the relevance of the refactoring with a developer intent for fine-grained reuse. The analysis of refactored code shows an increase in the number of reusable elements per project and reduction in the coupling of refactored modules. The soundness of the refactoring is empirically validated through code inspection and execution of projects' test suites.


翻译:JavaScript 语言直到ECMAScript 6 (ES6) 之前没有具体说明简化封装和模块化的本地特征。 开发者社区以设计模式和模块格式的激增填补了空白, 从而对建筑配置的代码可重用性、 可移动性和复杂性产生影响。 这项工作研究将遗留的ES5代码自动重新定位为ES6模块, 并通过名为进出口语言的模块结构对模块内容进行精细再利用。 重点是通过将导出模块对象破坏为精细的模块特点和模块组合化, 并通过利用ES6 合成法加强模块依赖性。 我们使用静态分析来构建一个 JavaScript 项目模型, 模块依赖性图(MDG), 代表模块及其依赖性。 根据千年发展目标, 我们为模块向ES6 迁移指定了重新定位程序。 对19个开放源项目进行了原型的实施进行了经验评估。 研究结果突出表明, 与开发者对精细再加再利用的模块的开发目标的相关性, 并且通过应用 ES6 重新校验模型模型的模型分析显示, 重新校验的校验的模型项目。

0
下载
关闭预览

相关内容

Automator是苹果公司为他们的Mac OS X系统开发的一款软件。 只要通过点击拖拽鼠标等操作就可以将一系列动作组合成一个工作流,从而帮助你自动的(可重复的)完成一些复杂的工作。Automator还能横跨很多不同种类的程序,包括:查找器、Safari网络浏览器、iCal、地址簿或者其他的一些程序。它还能和一些第三方的程序一起工作,如微软的Office、Adobe公司的Photoshop或者Pixelmator等。
【干货书】Python科学编程,451页pdf
专知会员服务
125+阅读 · 2021年6月27日
专知会员服务
86+阅读 · 2021年4月12日
【2020新书】使用R和Python的高级BI分析,425页pdf
专知会员服务
31+阅读 · 2020年10月14日
因果图,Causal Graphs,52页ppt
专知会员服务
238+阅读 · 2020年4月19日
【新书】Python编程基础,669页pdf
专知会员服务
186+阅读 · 2019年10月10日
LibRec 精选:你见过最有趣的论文标题是什么?
LibRec智能推荐
4+阅读 · 2019年11月6日
Hierarchically Structured Meta-learning
CreateAMind
23+阅读 · 2019年5月22日
Transferring Knowledge across Learning Processes
CreateAMind
25+阅读 · 2019年5月18日
Call for Participation: Shared Tasks in NLPCC 2019
中国计算机学会
5+阅读 · 2019年3月22日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
15+阅读 · 2018年12月24日
disentangled-representation-papers
CreateAMind
26+阅读 · 2018年9月12日
【推荐】自然语言处理(NLP)指南
机器学习研究会
35+阅读 · 2017年11月17日
Arxiv
0+阅读 · 2021年9月20日
Arxiv
8+阅读 · 2020年5月2日
ViZDoom Competitions: Playing Doom from Pixels
Arxiv
5+阅读 · 2018年9月10日
VIP会员
相关资讯
LibRec 精选:你见过最有趣的论文标题是什么?
LibRec智能推荐
4+阅读 · 2019年11月6日
Hierarchically Structured Meta-learning
CreateAMind
23+阅读 · 2019年5月22日
Transferring Knowledge across Learning Processes
CreateAMind
25+阅读 · 2019年5月18日
Call for Participation: Shared Tasks in NLPCC 2019
中国计算机学会
5+阅读 · 2019年3月22日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
15+阅读 · 2018年12月24日
disentangled-representation-papers
CreateAMind
26+阅读 · 2018年9月12日
【推荐】自然语言处理(NLP)指南
机器学习研究会
35+阅读 · 2017年11月17日
Top
微信扫码咨询专知VIP会员