7. Everybody Falls, It's How You Get Back Up – Testing and Debugging

Learning Objectives

By the end of this chapter, you will be able to:

  • Describe different types of assertions
  • Implement compile-time and runtime assertions
  • Implement exception handling
  • Describe and implement unit testing and mock testing
  • Debug C++ code using breakpoints and watchpoints
  • Inspect data variables and C++ objects in the debugger

In this chapter, you'll learn how to add assertions appropriately, add unit test cases so that code behaves as per the requirements, and learn about debugging techniques so that you can find bugs in the code and trace the root cause of them.

Introduction

During the Software Development Life Cycle (SDLC), once the requirement gathering ...

Get Advanced C++ 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.