The difference between the insulating base and the prototype frame platform

What is the difference between the terms Insulation Base and Mocking Environment?

+8
unit-testing frameworks mocking
source share
2 answers

Quite often, the two terms are used interchangeably, but there is an important difference. In my opinion, there is the same difference as between plugs and bullying. Stub i.e. The Isolation Framework provides only predefined outputs and thus isolates the β€œtest” from an external system with a complex internal state, slow response time, etc. Mock ie Mock Frameworks not only provides predefined outputs, if necessary, but also is pre-programmed by expectations that form the specification of expected calls. Thus, mock monitors its use and does not perform a β€œtest” if used incorrectly. But the stub provides only a predefined output.

You can find more in Article Mocks does not publish Martin Fowler's article

+1
source share

I feel that the accepted answer is wrong, mock frameworks are also isolation environments.

Section 5.1 of the book by Roy Oorizheva "The Art of Unit Testing" reports

The isolation structure is a set of programmable APIs that make layout and stubs much easier. Isolation structures save the developer from having to write repetitive code for testing or simulate object interactions.

This definition may seem a little bland, but it should be general in order to include various insulating frames there. isolation there are frameworks for most languages ​​that have a single testing system associated with them. For example, C ++ has mockpp and other frameworks and Java, in particular jMock and EasyMock..NET has NMock, Moq, Typemock Isolator and Rhino Mocks.

In a blog post from him, he mentions that

isolation structure (laughing structure ... but this is a terrible name for this. The word mock is already overloaded)

Therefore, they usually refer to the same thing. An isolation frame can be used to initiate layouts, but it also applies to other test twins. The isolation frame will be a superset of which the breadboard structure is part.

Double test is an umbrella term for

  • test plugs
  • fake objects
  • test spies and
  • mock objects

Four types from Lasse Koskela, book Effective Unit Testing . Martin Fowler and Gerard Meszaros list five types :

  • fictitious objects
  • fake objects
  • butts
  • spies and
  • mocks

but the difference is the same.

+15
source share

All Articles