Unit Testing C Code in CLion 2020
Writing unit tests is a big part of being a good software developer. This course will teach you how to use unit tests to improve existing C code with the CLion IDE.
What you'll learn
Anyone who has ever written unit tests knows that it’s not always a trivial task, especially when trying to test existing code. In this course, Unit Testing C Code in CLion, you’ll learn to write, run, debug, and analyze unit tests. First, you’ll explore deciding how and what to test. Next, you’ll discover refactoring code using unit tests for better readability and maintainability. Finally, you’ll learn how to understand the results and investigate issues when things go wrong. When you’re finished with this course, you’ll have the skills and knowledge of CLion and unit testing needed to create better, cleaner, and more maintainable C code.
Table of contents
- Module Overview 2m
- Testing Frameworks Supported by CLion 7m
- Google Test 101 3m
- Boost.Test 101 3m
- Catch2 Quick 101 3m
- docTest 101 2m
- Deciding Which Test Framework to Use 7m
- Demo: Testing Framework Integration in CLion 9m
- How to Start Testing Legacy Code 2m
- Demo: Writing Acceptance Tests in CLion 7m
- Summary 1m
- Module Overview 1m
- Why Do We Need Guidelines? 3m
- How to Structure Your Project 2m
- Arrange, Act, Assert 2m
- Naming Your Tests 3m
- Using Tags to Organize Your Tests 2m
- Demo: Refactoring Your Code 4m
- Demo: Writing Unit Tests 3m
- Keep Your Guidelines Simple 1m
- Using Run Configurations 3m
- Demo: Running Your Tests 5m
- Summary 1m
- Module Overview 2m
- Unit Tests and Integration Tests 2m
- How to Fake Dependencies in C Code 3m
- Demo: Faking Methods Using Another Library 4m
- Demo: Faking Methods Using Macros 3m
- Demo: Faking Methods Using Function Pointers 3m
- Understanding Test Failures 3m
- Why You Need to Debug Your Tests 2m
- Demo: Finding and Fixing Bugs Using Unit Tests 5m
- Summary 3m