How it works...

Simply writing your C++ application and hoping it works as expected without any testing is guaranteed to result in reliability-, stability-, and security-related bugs. This recipe is important because testing your applications prior to release ensures that your applications execute as expected, ultimately saving you time and money in the future.

There are several different ways to test your code, including system-level, integration, long-term stability, and static and dynamic analysis, among others. In this recipe, we will focus on unit testing. Unit testing breaks an application up into functional units and tests each unit to ensure that it executes as expected. Typically, in practice, each function and object (that is, class) ...

Get Advanced C++ Programming Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.