TY - GEN
T1 - JMocker
T2 - 44th ACM/IEEE International Conference on Software Engineering: Companion, ICSE-Companion 2022
AU - Wang, Xiao
AU - Xiao, Lu
AU - Yu, Tingting
AU - Woepse, Anne
AU - Wong, Sunny
N1 - Publisher Copyright:
© 2022 IEEE.
PY - 2022
Y1 - 2022
N2 - 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.
AB - 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.
KW - Software Refactoring
KW - Software Testing
UR - http://www.scopus.com/inward/record.url?scp=85132445687&partnerID=8YFLogxK
UR - http://www.scopus.com/inward/citedby.url?scp=85132445687&partnerID=8YFLogxK
U2 - 10.1109/ICSE-Companion55297.2022.9793737
DO - 10.1109/ICSE-Companion55297.2022.9793737
M3 - Conference contribution
AN - SCOPUS:85132445687
T3 - Proceedings - International Conference on Software Engineering
SP - 125
EP - 129
BT - Proceedings - 2022 ACM/IEEE 44th International Conference on Software Engineering
Y2 - 22 May 2022 through 27 May 2022
ER -