Structuring Our Projects for Testing

Let's learn about project structure before we adopt a unit-testing framework.

We'll cover the following

C++ has some limited introspection capabilities, but cannot offer such powerful retrospection features as Java can. This might be the very reason why writing tests and unit-testing frameworks for C++ code is much harder than in other, richer environments. One implication of such an economic approach is the fact that the programmer has to be more involved in crafting testable code. We'll not only have to design our interfaces more carefully, but also answer questions about the practicalities, such as this: How do we avoid doubling the compilation and reuse artifacts between tests and production?

Get hands-on with 1200+ tech skills courses.