File I/O looks like one of those things that cannot be unit-tested properly. A method that reads directories, scans files, compares extensions, and deletes files seems tied to the real machine where the test is running. That creates all the usual problems: tests become slow, fragile, dependent on local paths,…
-
-
Testing private methods is often debated among developers, as they typically represent implementation details and should not be directly tested. However, there are scenarios in legacy code where testing privately for safety before refactoring is necessary. The preferred approach is to test public behavior or extract complex logic into separate…
-
It is not easy to monitor how our code behaves on a vast array of different machines. A myriad of different configurations can lead to errors that are difficult to reproduce and even more difficult to anticipate. And when the customer calls complaining about a crash, provided information on what…
-
In Visual Studio 2012, after installing Installshield LE 2012, you can include setup projects into your solution, as shown below: Adding the Setup project to the solution, and including it into the Release configuration, makes for a quick, 1-click compilation procedure of both the main app and the installer. Still,…
-
In a previous post, Unit testing with Visual C++ 2012, the unit testing features of Visual Studio 2012 were shown to be an effective way to improve software quality by introducing various tests. Still, instead of having to run these tests inside the Visual Studio IDE, it would be even…
-
The article related to multi-threading and SSE2 optimizations (you can find it here) uses a quick-and-dirty way to check if the optimized code is correct, i.e. it runs an iteration on a given input image with a reference serial code, stores the resulting output image, runs an iteration of the…