JMocker: Refactoring Test-Production Inheritance by Mockito
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, named JMocker, to automatically identify and replace the usage of inheritance by using Mockito—a well received mocking framework for Java projects. We evaluate JMocker on four open 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, JMocker improves the design quality of test cases. JMocker is available at https://github.com/wx930910/JMocker. The tool demo can be found at https://youtu.be/HFoA2ZKCoxM.
Thu 12 MayDisplayed time zone: Eastern Time (US & Canada) change
20:00 - 21:00 | Software Testing 4DEMO - Demonstrations at ICSE Demo room 1 Chair(s): August Shi University of Texas at Austin | ||
20:00 15mDemonstration | JMocker: Refactoring Test-Production Inheritance by Mockito DEMO - Demonstrations Xiao Wang Stevens Institute of Technology, Lu Xiao Stevens Institute of Technology, Tingting Yu University of Cincinnati, Anne Woepse Analytical Graphics, Sunny Wong Envestnet Link to publication DOI Media Attached | ||
20:15 15mDemonstration | A Dynamic Analysis Tool for Memory Safety Based on Smart Status and Source-Level Instrumentation DEMO - Demonstrations Zhe Chen Nanjing University of Aeronautics and Astronautics, Jun Wu Nanjing University of Aeronautics and Astronautics, China, Qi Zhang Nanjing University of Aeronautics and Astronautics, China, Jingling Xue UNSW Sydney Link to publication DOI Pre-print Media Attached | ||
20:30 15mDemonstration | iPFlakies: A Framework for Detecting and Fixing Python Order-Dependent Flaky Tests DEMO - Demonstrations Ruixin Wang Zhejiang University, Yang Chen Huazhong University of Science and Technology, Wing Lam University of Illinois at Urbana-Champaign Pre-print Media Attached |