"Program testing can be used to show the presence of bugs, but never to show their absence!"
- Edsger Dijkstra
Software systems are destined to grow and evolve over time. Open or closed source software projects have one thing in common: their complexity seems to follow an upward curve as the number of engineers working on the code base increases. To this end, having a comprehensive set of tests for the code base is of paramount importance. This chapter performs a deep dive into the different types of testing that can be applied to Go projects.
The following topics will be covered in this chapter:
- Identifying the differences between high-level primitives such as stubs, mocks, spies, and fake objects that you can use while writing unit tests as substitutes for objects that are used inside the code under test
- Comparing black-box and white-box testing...