Test Driven Development - enough said, or is it?

    Search by

    Using GMock with Visual Studio CppUnitTestFramework

    One of the things I have been a bit disappointed with myself during the development of OpenCover [] is the lack of unit testing around the C++ code that makes up the profiler. I did toy with GTest [] and got some decent tests around the instrumentation engine but I was never able to actually test the profiler callbacks, also I found the lack of GTest integration with Visual Studio quite irritating; I know I have been spo

    open cover

    Excluding code from coverage...

    This may (no guarantees) turn into a series of posts on how to refactor your code for testing using simple examples. This particular example came from a request to add an "Exclude Lines from Coverage" feature to OpenCover []. Now there are many ways this could be achieved, none of which I had any appetite for as they were either too clunky and/or could make OpenCover very slow. I am also not a big fan on excluding anything from code coverage; though OpenCov

    open cover

    A simple TDD example

    I recently posted a response to StackOverflow wrt TDD and Coverage []and I thought it would be worth re-posting the response here. The example is simple but hopefully shows how writing the right tests using TDD gives you a better suite of tests for your code than you would probably write if you wrote the tests after the code (which may have been re-factored as you developed). "As the [original] accepted answer has pointed out your actual scenario reduce