3

Today I heard someone talking about verified fakes in the context of unit testing.

I didn't really understand what they were but searching around them doesn't provide much information.

What is a verified fake?

Mauro Baraldi
  • 6,346
  • 2
  • 32
  • 43
Andy Smith
  • 3,308
  • 4
  • 26
  • 34

2 Answers2

3

A verified fake is a fake that you verified behaves the same way as the real thing. You do this by running the same tests on both the real object and the fake object, thus ensuring the same behavior.

Given the same behavior you can trust the tests that use the fake much more. With a regular fake you're hoping it behaves the same as the real thing, but who knows?

For more see https://codewithoutrules.com/2016/07/31/verified-fakes/

Itamar Turner-Trauring
  • 3,430
  • 1
  • 13
  • 17
1

I think what you're looking for is Fake Objects. There is a more elaborate answer here and I recommend you to read Mocks aren't Stubs from Martin Fowler

Community
  • 1
  • 1
Mauro Baraldi
  • 6,346
  • 2
  • 32
  • 43