Performance Comparison of Unit Test Isolation Frameworks
Mateusz Domański
mateusz.domanski1@pollub.edu.plLublin University of Technology (Poland)
Michał Dołęga
(Poland)
Grzegorz Kozieł
(Poland)
Abstract
The goal of unit testing is to verify that individual parts of application are correct. For external dependencies mock objects should be created. This process is supported by dedicated libraries. The paper compares three unit test isolation frameworks for .NET: Moq 4.16.1, FakeItEasy 7.2.0 and NSubstitute 4.2.2. The performance research included comparison of benchmark execution times and comparison of unit test execution times in which selected methods of tested libraries were used. The results are shown on box plots. The analysis shows that Moq is optimal mocking framework.
Keywords:
code isolation; unit testing; mock objectsReferences
H. Vocke, The Practical Test Pyramid, martinfowler.com, 2018.
Google Scholar
J. Petersen, 10 Reasons Why Unit Testing Matters, CODE Magazine, 2019 January/February.
Google Scholar
J. Coplien, Why Most Unit Testing is Waste, RBCS-US.com, 2015.
Google Scholar
Porównanie obiektu typu mock a stub, https://martinfowler.com/articles/mocksArentStubs.html, [07.03.2022]
Google Scholar
R. Osherove, Testy jednostkowe. Świat niezawodnych aplikacji. Wydanie II, Helion, 2014.
Google Scholar
T. Haukilehto, Isolated unit tests in. Net, Seinäjoki University of Applied Sciences, 2013.
Google Scholar
Porównanie testów jednostkowych z wykorzystaniem bibliotek Moq, NSubstitute i FakeItEasy, https://blog.elmah.io/moq-vs-nsubstitute-vs-fakeiteasy-which-one-to-choose/, [07.03.2022]
Google Scholar
T. Hyttinen, .NET Core 3.1 & .NET 5, Performance benchmarking in Web API use, JAMK University of
Google Scholar
Authors
Michał DołęgaPoland
Authors
Grzegorz KoziełPoland
Statistics
Abstract views: 177PDF downloads: 159
License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.