Mocking Framework
In software development, so-called mock objects are often used in module tests to isolate a component during the test run. A mocking framework can be used so that a dummy implementation does not have to be written in addition to the real implementation . This simplifies the task of simulating ("mocking") certain elements that are required for the test but which should not be tested themselves.
functionality
- Record: The mocking framework records the behavior to be delivered.
- Replay: The mocking framework plays the behavior in the test run.
- Verify: After the test, the mocking framework checks whether the recorded behavior corresponded to the behavior in the test.
Beyond testing
A mocking framework can describe in great detail how a software module should work from the inside. This makes tests ideal for defining specifications. The advantage here is that code cannot (incorrectly) be interpreted, whereas a specification expressed in words leaves room for interpretation.
Mocking frameworks (selection)
JavaScript
- Sinon.JS
- jQuery Mockjax
C # / .NET
- Rhino mocks
- moq
- NSubstitutes
- FakeItEasy
- Simple mocking
- Microsoft fakes
C.
- cmocka
- cmockery
C ++
- Google Test (formerly Google C ++ Mocking Framework)
- Hippomocks
Java
Ruby
- rr
- RSpec Spies
python
- Mock
- pymox
- dingus
ABAP
- mockA
Delphi
- Delphi mocks
Web links
Individual evidence
- ↑ Sinon.JS homepage. In: sinonjs.org. Retrieved December 20, 2012 .
- ↑ jQuery Mockjax. In: github.com/jakerella/jquery-mockjax. Retrieved July 8, 2015 .
- ^ Rhino Mocks homepage. In: hibernatingrhinos.com. Retrieved December 20, 2012 .
- ↑ moq on GitHub. In: github.com. Retrieved September 25, 2014 .
- ↑ NSubstitute on Github. In: github.com. Retrieved December 20, 2012 .
- ↑ The easy mocking library for .NET. Contribute to FakeItEasy / FakeItEasy development by creating an account on GitHub. FakeItEasy, December 13, 2019, accessed December 13, 2019 .
- ↑ Simple mocking on Codeplex. In: codeplex.com. Retrieved April 14, 2014 .
- ↑ MSDN: Isolating Code Under Test with Microsoft Fakes. Microsoft, accessed November 16, 2016 .
- ↑ unit testing framework for C with support for mock objects. Retrieved October 1, 2014 .
- ^ A lightweight library to simplify and generalize the process of writing unit tests for C applications. Retrieved October 1, 2014 .
- ↑ Google test on GitHub. In: github.com. Retrieved December 15, 2018 .
- ↑ Google C ++ Mocking Framework on GitHub. In: github.com. Retrieved January 8, 2016 .
- ↑ Hippomocks, C ++ Mocking Framework. Retrieved November 11, 2014 .
- ↑ mockito on Github. In: github.com. Retrieved December 20, 2012 .
- ↑ jmockit on github.io. In: github.io. Retrieved July 18, 2014 .
- ↑ Easymock homepage. (No longer available online.) In: easymock.org. Archived from the original on August 7, 2019 ; accessed on December 20, 2012 . Info: The archive link was inserted automatically and has not yet been checked. Please check the original and archive link according to the instructions and then remove this notice.
- ↑ PowerMock on Google Code. In: code.google.com. Retrieved December 20, 2012 .
- ↑ rr on Github. In: github.com. Retrieved December 20, 2012 .
- ↑ RSpec-Spies on Github. In: github.com. Retrieved December 20, 2012 .
- ↑ Mock homepage. In: voidspace.org.uk. Retrieved December 20, 2012 .
- ↑ pymox on Google Code. In: code.google.com. Retrieved December 20, 2012 .
- ↑ dingus on phyton.org. In: python.org. Retrieved December 20, 2012 .
- ↑ mockA homepage. In: github.com. Retrieved January 12, 2014 .
- ^ Delphi-Mocks homepage. In: github.com. Retrieved October 26, 2019 .