Skip to content
UdemyC++Paid courseBeginner levelCertificate

C++ Unit Testing: Google Test and Google Mock (Udemy.com)

Beginning Test Driven Development (TDD) in C++ with Googletest and Googlemock

Created by: Serban Stoenescu

Last updated May 2024

icon
What you will learn

  • Google Test (C++ Unit Testing)
  • Google Mock

How it compares

Against the other 86 rated Udemy courses in C++ on CourseDuck:

  • Rating4.5 out of 5higher than 51% of them
  • Reviews2,793#18 of 87 by number of reviews
  • Length3.5 hoursshorter than 82% of them
  • Last updatedMay 2024more recently than 52% of them

icon
Course Description

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

icon
Udemy Discount

The discount is applied through our link. Open the course from here and Udemy's current promotional price is applied at checkout on most courses, no code to type.

Some courses are excluded from Udemy's promotions. If the price does not drop, clear your browser cookies and use the button again.

icon
Instructor Details

Serban Stoenescu

I am a passionate software developer. I've been a professional programmer for 9 years now.

In one of my previous jobs, I also worked as a trainer for new recruits.

Co-author of a research paper (2014): Towards the Impact of Design Flaws on the Resources Used by an Application.

My top languages are C++ and Java.

icon
More C++ courses

$74.99

$49.99

$174.99

$124.99

$139.99

$109.99

icon
Reviews

4.5

2,793 ratings on Udemy

Select a bar to show only those reviews.Select the bar again to show every rating.

By Stan Morris on 12/15/2024

The title in the overview is: "Beginning Test Driven Development (TDD) in C++ with Googletest and Googlemock". This course does not discuss test driven development. TDD is a methodology where tests are written first, and they fail because the code has not been implemented, then the code is implemented so the test passes, then you are safe to refactor the code. I expected TDD information and was disappointed. The lessons on Google Test are good at the beginning, but get rushed toward the end. Specifically, Google Mocks crams too much material into too little time. There are edits that explain mistakes in the original recordings -- it would be better to just re-record the section. Lastly, this hurts to say, but it was not engaging. Serban reads a script and does not talk to me or explain the material to me... he reads at me. Reading removes vocal inflections on material that needs special emphasis. Serban occasionally discusses legacy syntax. His explanation that "you may run into this" resonates; I've worked at those companies. However, IMO he should have focused on how to "fix" the legacy syntax instead of how to write the legacy syntax. Explaining how to write legacy syntax takes longer than explaining how to fix it. It is clear that Serban is an expert on Google Test. This training video feels incomplete... like a work in progress that is 80% complete. I don't know whether Serban should do targeted re-recordings this video or re-shoot the whole thing as a new course to ditch the negative reviews.

By Anonymized User on 1/2/2024

Very useful course, I definitely recommend it! Only the sections about mocking private and static methods were a bit too fast. It would have been nice to have resources there as well, using different mock classes instead of just rewriting code. Other than that, I really enjoyed this course and learned a lot!

By Ishaan Karnik on 9/14/2023

Excellent course to get started with Unit testing and GTest framework. Don't judge the course just by preview videos. The author's teaching style may seem monotonous but apart from that I had no issues. The author explains background theory and provide enough examples. As the course carries on I found the course to be interesting. I highly recommend this course for anyone who wishes to learn or get started with GTest and gMock.

By Amogh Pujar on 2/15/2023

Its a Good Course!! I Liked it.. Even though I have trouble in running private members in test suits which kept on failing and even while executing callback, I will post certain questions hoping for the answers, I really liked it, it was simple and clear to under stand UT

By Sebastian Morera on 6/19/2022

I am a young embedded system developer and the team I work in uses Google Test to do their testing. So I needed to have an introduction and a good understanding of this framework and there is not much clear training on the web. This course perfectly met my expectations regarding an introduction and explanation of unit tests and their usefulness, as well as the use of known frameworks like Google Test and Google Mock. The improvements that could be made are : - I would have liked to have the MacOs platform for the installation instructions and use of the framework (I managed to get them to work on Linux and MacOs, but the installation was not easy in both cases). - The recording sound is not very loud and sometimes even at maximum volume the voice is low, so maybe increase the volume for the next courses or a better microphone. A big thank you for this learning experience!

By Maciej Białczak on 2/6/2022

The course was fine and interesting. It was my first learning material for C++ Google Test. I think, that this is a good introduction to using the test framework. Perhaps some link to github repository with all the code examples would be nice. I hope there will be some updates to the course as I would gladly come back. The instructor done well. Thanks!

By Jinlong Shen on 6/14/2021

This is great course. However, when mock is first introduced. A example is used in which it is expected a mock method is called and then the mock method is called directly without involving any function under test being called. This is a bad example since some people may think this is a correct way of unit-testing.

By Amit Khobragade on 1/9/2021

i really liked his way of teaching and course material was really helpful here are some pro and cons pros: 1.this course is filled with information related to gtest and gmock and i think that its the best one for c++ out there as i have had also bought some of the other courses and those courses were a real issue as they focused more on syntax and where it is used rather than the implementation. 2.Serban is a really good instructor and one can see by the layout of the course that there is real effort put in this course. 3. the instructor actually replies to all the queries related to the course and i think that that's one of the main point of this course as you will get a lot of errors when entering google tests. 4. Serban actually updates the course regularly i.e. if you tell him that a method is old or not in use anymore he will actually go through updating the method. cons: i can only find one or two cons and that were there: first don't enter the course without the basic knowledge of c++ and cmake is preferable(I think this is already in the prerequisites ) as it would help you in the long run. But even if you use visual studios and face some issues the instructor actually takes time to resolve them and i think that's another plus point.

By David Köhler on 5/30/2020

I have worked with Google Test for over a year now and I took this course to learn about Google Mock. I wish I would have found this course earlier it would have saved me days of searching in the web. I can recommend this to everyone who wants to get started fast with the Google Test Framework from the scratch in just one weekend. The lecturer responses within one day for any questions you have. So this course really deserves 5 stars!

By Dusty Clark on 5/6/2020

While it's a very short introduction to what could be a very large and expansive set of lectures on a very complex testing framework, the focus on simplified introductory material that lightly introduces advanced topics coupled with enough help to get inexperienced developers started results in an efficient and approachable way to get started using googletest professionally. Recommended!

Showing all 10 reviews on CourseDuck

Read all 2,793 reviews on Udemy

icon
Quality Score

No CourseDuck member has rated this course yet. Taken it? Give each part a thumbs up or down.

Content Quality
/
Video Quality
/
Qualified Instructor
/
Course Pace
/
Course Depth & Coverage
/

Overall Score : 90 / 100