Earn a Michigan Engineering AI Certificate — Stay Ahead of the AI Revolution
Learn the Skills Netflix, Meta, and Capital One Actually Hire For
Overview
Google, IBM & Meta Certificates – 40% Off
One plan covers every Professional Certificate on Coursera.
Unlock All Certificates
Explore mocking techniques in C++ for efficient unit testing in this conference talk from C++Now 2017. Learn how to create mock components that simulate desired behaviors without relying on actual dependencies, improving test reliability and speed. Discover methods to implement mocking in C++ without extensive use of macros, manual labor, or code duplication, challenging the notion that C++ lacks the necessary capabilities. Gain insights into advanced topics such as virtual functions, marking frameworks, and handling complex scenarios like throwing destructors and virtual inheritance. Understand the advantages and limitations of mocking in C++, and how to effectively apply these techniques to enhance your unit testing practices.
Syllabus
Intro
Marking
Mark Objects
Manual Approach
Virtual Functions
Advantages
Alternatives
Unit Tests
Marking Framework
Limitations
My malloc is not your malloc
Test code
Throwing destructor
Virtual inheritance
Callback reporting
Reify function
Update lambda
Explicit lambda
Feedback framework
Taught by
CppNow