Performance Comparison of Unit Test Isolation Frameworks

Mateusz Domański

mateusz.domanski1@pollub.edu.pl
Lublin 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 objects

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

Download


Published
2022-06-30

Cited by

Domański, M., Dołęga, M., & Kozieł, G. (2022). Performance Comparison of Unit Test Isolation Frameworks. Journal of Computer Sciences Institute, 23, 123–127. https://doi.org/10.35784/jcsi.2908

Authors

Mateusz Domański 
mateusz.domanski1@pollub.edu.pl
Lublin University of Technology Poland

Authors

Michał Dołęga 

Poland

Authors

Grzegorz Kozieł 

Poland

Statistics

Abstract views: 171
PDF downloads: 148