One of the common uses for mocks is to replace expensive or stateful components, such as file systems, networks, GUIs, and databases. However, I also see a cluster of other problems that arise at interfaces with these types of components, especially when they are system-level services: Primitive obsession. Rarely are these APIs written as methods [...]
↧