...
- It has to consist of many separate units. Every unit must have clearly defined interaction with other units.
- Every unit needs to have a clear interface it exposes to other units, so that it can be easily mocked
- Every unit should hold as little state as possible — see below.
- If a unit is hard to test, it probably means it should be split in multiple components. This usually happens when a component starts holding a lot of state and/or has many possible actions and different outcomes — see below.
- Every public interface method declaration should be preceded by the
TEST_VIRTUAL
macro — see this subsection.
...