JMocker: Refactoring Test-Production Inheritance by Mockito
JMocker: Refactoring Test-Production Inheritance by Mockito
复制标题
JMocker:Mockito 重构测试生产继承
DOI:
10.1145/3510454.3516836
复制
发表时间:
2022
期刊:
影响因子:
--
通讯作者:
Xiao Wang, Lu Xiao
中科院分区:
文献类型:
--
作者:
Xiao Wang, Lu Xiao
Mocking frameworks are dedicated to creating, manipulating, and verifying the execution of "faked" objects in unit testing. This helps developers to overcome the challenge of high inter-dependencies among software units. Despite the various benefits offered by existing mocking frameworks, developers often create a subclass of the dependent class and mock its behavior through method overriding. However, this requires tedious implementation and compromises the design quality of unit tests. We contribute a refactoring tool as an Eclipse Plugin, namedJMocker, to automatically identify and replace the usage of inheritance by using Mockito---a well received mocking framework for Java projects. We evaluateJMockeronfouropen source projects and successfully refactored 214 cases in total. The evaluation results show that our framework is efficient, applicable to different projects, and preserves test behaviors. According to the feedback of six real-life developers,JMockerimproves the design quality of test cases.JMockeris available at https://github.com/wx930910/JMocker. The tool demo can be found at https://youtu.be/HFoA2ZKCoxM.
DOI:
--
发表时间:
2021
期刊:
The ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering (ESEC/FSE
影响因子:
--
作者:
Wang, Xiao;Xiao, Lu;Yu, Tingting;Woepse, Anne;Wang, Sunny
通讯作者:
Wang, Sunny
DOI:
10.1109/icsme46990.2020.00050
发表时间:
2020
期刊:
2020 IEEE International Conference on Software Maintenance and Evolution (ICSME)
影响因子:
--
作者:
Gustavo Pereira;André C. Hora
通讯作者:
André C. Hora