C++ Unit Testing Fundamentals Using Catch2 2
Writing unit tests is a big part of being a professional software developer. This course would teach you how to write readable and robust unit tests using Catch2, a simple yet powerful unit testing framework.
What you'll learn
Writing unit tests is a big part of being a good software developer. Unfortunately, unit testing in C++ is far from being trivial, and good unit testing frameworks are hard to find. In this course, C++ Unit Testing Fundamentals Using Catch2, you will learn how to write robust unit tests using Catch2, a simple-to-use yet flexible and powerful unit testing framework for C++. You will learn what makes Catch2 different from other xUnit frameworks, and how it can be used to write unit tests for your C++ code. You will also get to see how to run Catch2 from the command line, how to use test fixtures, and how to create maintainable tests. When you're finished with this course, you will have a foundational knowledge of Catch2 and unit testing in C++ that would help you create better, cleaner C++ code.
Table of contents
- Version Check 0m
- Course Introduction 1m
- Who Is This Course For? 1m
- Course Overview 1m
- Introducing Unit Tests 2m
- Why Write Automated Tests? 2m
- Introducing Catch 3m
- Getting Started with Catch 1m
- Demo: Getting Started with Catch 1m
- Writing Tests Using Catch 1m
- Sample Project Description 1m
- Demo: Writing Unit Tests Using Catch 3m
- Comparing Catch to Traditional Unit Testing Frameworks 2m
- Summary 1m
- Module Overview 2m
- Why You Should Care About the Test's Names 2m
- Bad Test Names to Avoid 2m
- Writing Good Unit Test Names 3m
- Executing Catch from the Command Line 3m
- Demo: Executing Catch from the Command Line 3m
- Adding Tags to Your Tests 3m
- Catch's Special Tags 3m
- Demo: Using Tags 4m
- Creating Tag Aliases 1m
- More Command Line Arguments 2m
- Summary 1m
- Module Overview 2m
- Why You Should Care About Test Failures 2m
- Is It Okay to Use Multiple Assertions in One Test? 5m
- Using REQUIRE and CHECK 1m
- How to Handle Multiple Assertions in One Test 1m
- Demo: Handling Multiple Assertions in One Test 3m
- Asserting for Exceptions 2m
- DEMO: Asserting for Exceptions 2m
- Using Matchers 7m
- Adding More Information Using Logging Macros 3m
- Using String Conversions 3m
- Summary 1m
- Module Overview 1m
- Code Duplication in Unit and Integration Tests 4m
- DRY vs. DAMP 2m
- Using Test Fixtures 3m
- Demo: Using Test Fixture 2m
- The Problems of Using Test Fixtures 3m
- Using Sections 2m
- Demo: Using Sections 2m
- Writing Data-driven Tests Using data Generators 6m
- Demo: Using Data Generators 5m
- Writing Type Parameterized Tests 2m
- Introducing BDD 4m
- Writing BDD Scenarios Using Catch 1m
- Demo: Writing BDD Scenarios Using Catch 1m
- Summary 1m