Scripting parametric refactorings in Java to retrofit design patterns

Scripting parametric refactorings in Java to retrofit design patterns
复制标题

DOI:
10.1109/icsm.2015.7332467
复制
发表时间:
2015-09
期刊:
2015 IEEE International Conference on Software Maintenance and Evolution (ICSME)
影响因子:
--
通讯作者:
Jongwook Kim;D. Batory;Danny Dig
Jongwook Kim;D. Batory;Danny Dig
中科院分区:
其他
文献类型:
--
作者:
Jongwook Kim;D. Batory;Danny Dig

文献摘要

被引文献

相似文献

将设计模式改写为手工繁琐且容易出错。程序员必须区分由综合发展环境(IDE)提供的重构与必须手动实现的重构,确定适用的重构序列,并在费力的程度上重复执行此顺序。我们设计,实施和评估了反射性重构(R2),这是一个Java软件包,以自动创建经典设计模式(访问者,抽象工厂等),它们的倒置和变体。我们将23个四个人的设计模式中的18个编码为R2脚本,并解释了为什么其余的不适合重构引擎。我们通过6个现实世界应用的案例研究评估R2的生产率和可伸缩性。在一种情况下,R2通过在10分钟内调用554 Eclipse重构(无法手动完成的成就)自动创建了一个具有276个访问方法的访问者。 R2还阐明了为什么重构正确性,表现力和速度是下一代重构引擎脚本的关键问题。
Retrofitting design patterns into a program by hand is tedious and error-prone. A programmer must distinguish refactorings that are provided by an Integrated Development Environment (IDE) from those that must be realized manually, determine a precise sequence of refactorings to apply, and perform this sequence repetitively to a laborious degree. We designed, implemented, and evaluated Reflective Refactoring (R2), a Java package to automate the creation of classical design patterns (Visitor, Abstract Factory, etc.), their inverses, and variants. We encoded 18 out of 23 Gang-of-Four design patterns as R2 scripts and explain why the remaining are inappropriate for refactoring engines. We evaluate the productivity and scalability of R2 with a case study of 6 real-world applications. In one case, R2 automatically created a Visitor with 276 visit methods by invoking 554 Eclipse refactorings in 10 minutes - an achievement that could not be done manually. R2 also sheds light on why refactoring correctness, expressiveness, and speed are critical issues for scripting in next-generation refactoring engines.