blob: dc03fe14cc030f723474b31a607b19f8c26db244 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
---
tags:
- testing
- dev
---
https://github.com/testdouble/contributing-tests/wiki/Don't-mock-what-you-don't-own
[[Mocks aren't stubs]]
The primary value of a test double from a TDD perspective is that it provides **cheap feedback** on the design of an object. Because we can play with its interface before actually having to use it, it is cheap to throw away and start over (vs having implemented all sorts of other stuff around it).
This is alternatively called "Increased Usage", referring to that a test is an additional usage of a function (which normally sometimes have just a single caller anyway) and that while writing a few test cases you'll quickly get a feel of if the API is good or bad.
[[London-style versus Detroit-style TDD]]
|