JMocker: Refactoring Test-Production Inheritance by Mockito

JMocker: Refactoring Test-Production Inheritance by Mockito
复制标题

JMocker:Mockito 重构测试生产继承

DOI:
10.1145/3510454.3516836
复制
发表时间:
2022
期刊:
2022 IEEE/ACM 44th International Conference on Software Engineering: Companion Proceedings (ICSE-Companion
影响因子:
--
通讯作者:
Xiao Wang, Lu Xiao
Xiao Wang, Lu Xiao
中科院分区:
--
文献类型:
--
作者:
Xiao Wang, Lu Xiao

文献摘要

参考文献

相似文献

模拟框架致力于在单元测试中创建、操作和验证“伪造”对象的执行。这有助于开发人员克服软件单元之间高度相互依赖的挑战。尽管现有的模拟框架提供了各种好处,但开发人员通常会创建依赖类的子类,并通过方法重写来模拟其行为。然而,这需要繁琐的实现,并损害了单元测试的设计质量。我们贡献了一个重构工具作为Eclipse插件,namedJMocker,通过使用Mockito-一个很受欢迎的Java项目模拟框架,自动识别和替换继承的使用。我们评估了JMockeron的四个开源项目,总共成功重构了214个案例。评估结果表明,我们的框架是有效的,适用于不同的项目,并保持测试行为。根据六个真实开发人员的反馈,JMock提高了测试用例的设计质量。https://github.com/wx930910/JMocker该工具演示可以在https://youtu.be/HFoA2ZKCoxM上找到。
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