Udemy
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
Development
Web Development Data Science Mobile Development Programming Languages Game Development Database Design & Development Software Testing Software Engineering Development Tools No-Code Development
Business
Entrepreneurship Communications Management Sales Business Strategy Operations Project Management Business Law Business Analytics & Intelligence Human Resources Industry E-Commerce Media Real Estate Other Business
Finance & Accounting
Accounting & Bookkeeping Compliance Cryptocurrency & Blockchain Economics Finance Finance Cert & Exam Prep Financial Modeling & Analysis Investing & Trading Money Management Tools Taxes Other Finance & Accounting
IT & Software
IT Certification Network & Security Hardware Operating Systems Other IT & Software
Office Productivity
Microsoft Apple Google SAP Oracle Other Office Productivity
Personal Development
Personal Transformation Personal Productivity Leadership Career Development Parenting & Relationships Happiness Esoteric Practices Religion & Spirituality Personal Brand Building Creativity Influence Self Esteem & Confidence Stress Management Memory & Study Skills Motivation Other Personal Development
Design
Web Design Graphic Design & Illustration Design Tools User Experience Design Game Design Design Thinking 3D & Animation Fashion Design Architectural Design Interior Design Other Design
Marketing
Digital Marketing Search Engine Optimization Social Media Marketing Branding Marketing Fundamentals Marketing Analytics & Automation Public Relations Advertising Video & Mobile Marketing Content Marketing Growth Hacking Affiliate Marketing Product Marketing Other Marketing
Lifestyle
Arts & Crafts Beauty & Makeup Esoteric Practices Food & Beverage Gaming Home Improvement Pet Care & Training Travel Other Lifestyle
Photography & Video
Digital Photography Photography Portrait Photography Photography Tools Commercial Photography Video Design Other Photography & Video
Health & Fitness
Fitness General Health Sports Nutrition Yoga Mental Health Dieting Self Defense Safety & First Aid Dance Meditation Other Health & Fitness
Music
Instruments Music Production Music Fundamentals Vocal Music Techniques Music Software Other Music
Teaching & Academics
Engineering Humanities Math Science Online Education Social Science Language Teacher Training Test Prep Other Teaching & Academics
AWS Certification Microsoft Certification AWS Certified Solutions Architect - Associate AWS Certified Cloud Practitioner CompTIA A+ Cisco CCNA Amazon AWS CompTIA Security+ AWS Certified Developer - Associate
Graphic Design Photoshop Adobe Illustrator Drawing Digital Painting InDesign Character Design Canva Figure Drawing
Life Coach Training Neuro-Linguistic Programming Mindfulness Personal Development Personal Transformation Meditation Life Purpose Coaching Neuroscience
Web Development JavaScript React CSS Angular PHP WordPress Node.Js Python
Google Flutter Android Development iOS Development Swift React Native Dart Programming Language Mobile Development Kotlin SwiftUI
Digital Marketing Google Ads (Adwords) Social Media Marketing Google Ads (AdWords) Certification Marketing Strategy Internet Marketing YouTube Marketing Email Marketing Retargeting
SQL Microsoft Power BI Tableau Business Analysis Business Intelligence MySQL Data Analysis Data Modeling Data Science
Business Fundamentals Entrepreneurship Fundamentals Business Strategy Online Business Business Plan Startup Freelancing Blogging Home Business
Unity Game Development Fundamentals Unreal Engine C# 3D Game Development C++ 2D Game Development Unreal Engine Blueprints Blender
30-Day Money-Back Guarantee

This course includes:

  • 3 hours on-demand video
  • 6 articles
  • 15 downloadable resources
  • Full lifetime access
  • Access on mobile and TV
IT & Software Other IT & Software C++

C++ Unit Testing: Google Test and Google Mock

Beginning Test Driven Development (TDD) in C++ with Googletest and Googlemock
Rating: 4.2 out of 54.2 (124 ratings)
600 students
Created by Serban Stoenescu
Last updated 1/2021
English
English [Auto]
30-Day Money-Back Guarantee

What you'll learn

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

Requirements

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

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

Who this course is for:

  • Software developers and students who want to make their code more robust, bug-free
  • Anyone interested in Google Test and Google Mock

Course content

8 sections • 54 lectures • 3h 7m total length

  • Preview00:39

  • Preview02:02
  • Installing Visual Studio
    04:25
  • Visual Studio - Sample GTest Project
    07:48
  • Installing on Linux
    03:43
  • Google Test CMake Sample (Linux)
    07:14
  • Google Test - CMake With a Test Runner and Actual Application
    06:02

  • Preview00: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

  • Preview00:26
  • Preview00:53
  • Preview11:47
  • Fixture Flow
    02:21
  • Parameterized Tests
    01:45
  • GoogleTest update
    00:21
  • Parameterized Tests (Code Example)
    12:36
  • Summary
    00:22
  • Fixtures Quiz
    4 questions

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

  • Preview01: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

  • 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
    00:17

Instructor

Serban Stoenescu
Software Development Engineer
Serban Stoenescu
  • 4.0 Instructor Rating
  • 150 Reviews
  • 6,406 Students
  • 2 Courses

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.

  • Udemy for Business
  • Teach on Udemy
  • Get the app
  • About us
  • Contact us
  • Careers
  • Blog
  • Help and Support
  • Affiliate
  • Terms
  • Privacy policy
  • Cookie settings
  • Sitemap
  • Featured courses
Udemy
© 2021 Udemy, Inc.