Mocking again, as a "response" to my post about how easy mocking in python. So this is my recommendation, of how to perform mocking in C++, reduce impact of testing code to a production code, and keep clean interfaces (everything in contradiction to dependency injection).
Category: Uncategorized
So what is this “Modern CMake” exactly?
Building C and C++ projects can be really non trivial stuff, and people are struggling with this topic for years. I found CMake very useful, explicit, easy to use "project builder" . But what is a "Modern CMake" ? Lets dig into this topic ... It is a routine not a feature. A s usual … Continue reading So what is this “Modern CMake” exactly?
This feature of Python makes me love programming again.
If you ask me about one thing that implementing it in C++ is for me tedious i would point "Mocking". And still you need to do this a lot. (I hope I don't need to explain how important is testing and how it involves mocking). There are some common well known ways to do that, … Continue reading This feature of Python makes me love programming again.
6 “Quick Start” lessons of Python for C++ developer
Lesson 1: "All variables are references" Well they are, but it is a bit different than in C++. ❯ python Python 3.9.0 (tags/v3.9.0:9cf6752, Oct 5 2020, 15:34:40) [MSC v.1927 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> a=10 >>> b=a >>> a=20 >>> b 10 # <--- WTF? … Continue reading 6 “Quick Start” lessons of Python for C++ developer
Code coverage with gcov and cmake.
Why to measure code coverage? Code coverage is well established in industry metrics of a code quality (well kind of). At the end it is all about tests quality, because you can have tests that do not test anything, they just generating code coverage, to satisfy process. But this is not a reason not to … Continue reading Code coverage with gcov and cmake.