No matter the approach used to test software, there are tools which allow us to have better control of the environment we’re testing. A Test Double is one of the most important tools in our belt when writing tests (specially unit tests). Using a double it’s possible to have full control of external entities and the testing environment in general since they replace important pieces of the code with pre-determined behavior. This is key to maintain determinism in tests: given an input, tests should always present the same expected output.

Where to go from here:

  1. Introduction
  2. The Different Types of Tests
  3. Test Doubles
    1. Dummies
    2. Mocks
    3. Stubs
    4. Partials
    5. Fakes
  4. Fixtures
  5. Frameworks and Tools