Definition

https://leanpub.com/golang-tdd/read

Test-driven development is a strict discipline for creating modular, well-designed and testable code without doing any upfront design. It achieves this by making you work in extremely short cycles: create an automated test, write the minimum amount of code to satisfy that test, and refactor your code to improve the quality.

Cycles

There are 3 cycles

Test doubles

Traditionally, there are five types of test doubles:

Dummies
Types without any behavior at all, provided only because the signature of the unit under test requires them.
Stubs
Types implementing the minimum amount of behavior to satisfy a test.
Mocks
Partial implementations for which you can define expectations on how their methods will be called.
Spies
Partial implementations on which you can assert that specific methods have been called.
Fakes
Full, lightweight implementations such as in-memory databases.