Can I take the set difference of two .NET code coverage results?

Viewed 119

I have a set of old integration tests for a .NET codebase that I am in the process of removing, but I know that when I do, there will be some program features that will also no longer be tested. I am interested in getting a list of what those features are.

One way that seems natural is to take the set difference (P \ Q) between the code coverage of those integration tests and the code coverage of the official unit and integration tests that we're keeping - in other words, something will show as covered in the merged result if and only if it is covered by the integration tests but not the official ones. For instance, if the integration tests cover methods A(), B(), and C(), and the official tests cover A(), B(), and D(), then the final report should show only C() as covered. Is there a way to take this set difference with .NET tests?

I have access to both Visual Studio's test runner as well as JetBrains dotCover, and can generate code coverage tests for both. I have found documentation for how to do a logical OR merge operation with both test frameworks, but no other operations, including a set difference. I could potentially derive it by also being able to take a logical NOT of a single report (P \ Q = ~(~P | Q)), though such a result wouldn't make sense on its own, so I understand why functionality would not be provided for it.

And yes, I know that the theoretical "best solution" would be to just write unit tests for every untested feature, but not only do I probably want to focus on the newfound deficiencies first, I also might respond to newly uncovered features by simply removing them, since the integration tests represent the needs of projects that have since been cancelled.

0 Answers
Related