Mô tả

This course is for software developers and students who want to be better programmers by writing more solid, bug-free code using the Google Test framework.

Your code will get better and you will have more confidence that your code is correct, because you will catch more bugs using automated tests.

How many times did this happen to you? You wrote new code, and after your hard work is done, you find that you broke features that used to work? And you had to waste more hours finding and fixing the bugs... This problem can get solved in most cases by using automated tests, especially unit tests.

No experience with automated testing is required. Very basic C++ knowledge is needed, nothing too sophisticated.

If you are completely new to Google Test, this course is just for you! If you already have some knowledge, look at the course content and see if you find some more advanced features that you didn't know about.

Google Test works on multiple platforms. You can use any platform you like. In this course, I am doing it on:

  • Windows (Visual Studio)

  • Linux (CMake or compiling directly from the command line)

  • Other platforms will be added if you suggest them to me

There are slides and hands-on coding examples in each section. I recommend that you try the examples and play around with them.

Here's a brief presentation of the course content:

  • Optional videos: Setting up on Windows (Visual Studio) and on Linux (CMake and GCC)

  • Basics of unit testing:

    • Unit test structure

    • Assertions - numeric, string, exceptions

  • Reusing code between tests (test fixtures, SetUp() and TearDown())

  • Parameterized tests:  generate multiple tests by writing one single function.

  • Mocking - replacing real objects with fakes that you can control):

    • Basics

    • Setting the behaviour of mocks

    • Matchers

Bạn sẽ học được gì

Google Test (C++ Unit Testing)

Google Mock

Yêu cầu

  • Basic C++
  • No unit testing experience is required

Nội dung khoá học

8 sections

Course Intro

1 lectures
How to Use This Course
00:39

Setting Up Google Test

12 lectures
Intro
02:02
Update for CMake users on all operating systems
00:44
Installing Visual Studio
04:25
Visual Studio - Sample GTest Project
07:48
Small Update
00:30
Googletest with FetchContent in CMake
13:31
About the Next Lecture
00:34
Googletest with FetchContent in CMake Visual Studio
03:55
Installing on Linux
03:43
Google Test CMake Sample (Linux)
07:14
Google Test - CMake With a Test Runner and Actual Application
06:02
Small note
00:07

Unit Testing Basics

15 lectures
Intro
00:36
What is a Unit Test?
01:15
Unit Test Characteristics
01:03
Types of Testing
01:37
Unit Test Structure (Slides)
01:44
Unit Test Structure (Code Example)
04:20
Assertions
01:49
Assertions (Code Example)
01:46
Assertions on Strings - Wrong Way To Do It
05:42
Assertions on Strings
01:04
Assertions on Strings (Code Example)
02:05
Assertions on Exceptions
00:49
Assertions on Exceptions (Code Example)
03:47
Summary
00:25
Basics Quiz
4 questions

Fixtures: Remove Redundant Code

10 lectures
Intro
00:26
Introduction to Test Fixtures
00:53
Test Fixtures (Code Example)
11:47
Fixture Flow
02:21
Clarification
01:28
Parameterized Tests
01:45
GoogleTest update
00:21
Parameterized Tests (Code Example)
12:36
Summary
00:22
Fixtures Quiz
4 questions

Setting Up Google Mock

3 lectures
Intro
00:27
Google Mock Visual Studio (Windows)
07:34
Google Mock CMake Sample (Linux)
07:37

Google Mock

18 lectures
Intro
01:03
Mocking Project Resources
00:33
Introduction to Mocking
01:54
Mocking Methods
02:14
Presentation of Our Project
05:28
Mocking Methods - Current Way (Code Example)
09:36
Mocking Methods - Legacy (Code Example)
04:10
Setting Expectations and Behaviour
01:47
Mocking - Times (Code Example)
03:39
Mocking - Returns (Code Example)
03:17
Invoking Actions (Code Example)
08:48
Matchers
01:38
Matchers (Code Example)
06:35
Assertions on Vectors (Code Example)
04:06
Callbacks
06:27
Mocking Private and Static Methods
06:45
Summary
00:24
Mocking Quiz
6 questions

Bonus: Tips & Tricks

4 lectures
What's this?
00:08
Running a subset of tests, FAIL() and SUCCEED()
07:08
Visual Studio Test Runner
02:40
Arguments in Visual Studio (generating XML report)
03:16

Conclusion and Suggested Reading

2 lectures
Suggested Reading
02:36
Conclusion
00:17

Đánh giá của học viên

Chưa có đánh giá
Course Rating
5
0%
4
0%
3
0%
2
0%
1
0%

Bình luận khách hàng

Viết Bình Luận

Bạn đánh giá khoá học này thế nào?

image

Đăng ký get khoá học Udemy - Unica - Gitiho giá chỉ 50k!

Get khoá học giá rẻ ngay trước khi bị fix.