Module 10 of 10

Testing & Performance

Lessons

About This Module

Working code is not the same as correct and fast code. This module starts with unit testing: how to use test frameworks such as Google Test and Catch2 to check that each part of your program does what it should, and to catch bugs when you change something later.

It then moves to performance. You will learn how to time a piece of code with std::chrono and how to benchmark properly, so you measure before you optimize instead of guessing where the slow parts are.

This is the last module. When you finish the lessons, put everything together in the Projects section.

Lessons

4 videos
01

Google Test and Google Mock: Complete Tutorial

An introduction to writing unit tests in C++ with the Google Test framework, including test cases and assertions.

02

Unit Testing C++ Code With Catch2

Setting up Catch2 next to your code and writing unit tests for it, step by step.

03

Timing in C++

How to measure how long code takes to run with std::chrono, and how a scope-based timer makes it easy.

04

Benchmarking in C++ (How to Measure Performance)

How to benchmark code reliably, compare different implementations, and avoid misleading results.