The tool NDepend offers many features to handle .NET code diff.
The panel Search by Change is dedicated to browse assemblies code diff:
Many code rules that constraint diff and evolution are proposed. They can be a good start to write your own ones or adapt them to your needs. For example look at the rule:
Types that used to be 100% covered but not anymore
// <Name>Types that used to be 100% covered but not anymore</Name>
warnif count > 0
from t in JustMyCode.Types where
t.IsPresentInBothBuilds() &&
t.OlderVersion().PercentageCoverage == 100 &&
t.PercentageCoverage < 100
let culpritMethods = t.Methods.Where(m => m.PercentageCoverage < 100)
select new {t, t.PercentageCoverage, culpritMethods }
or also:
- API Breaking Changes: Methods
- Avoid making complex methods even more complex
- Avoid decreasing code coverage by tests of types
- From now, all types added or refactored should respect basic quality principles
- Avoid transforming an immutable type into a mutable one
- Heuristic to find types moved from one namespace or assembly to another
To get started with NDepend compare capabilities, have a look at the documentation:
-
Advanced Code Diff from within Visual Studio: explains how to use the NDepend build comparison features, in the context of Visual Studio and Visual NDepend standalone UI.
-
Reporting Code Diff: explains how to use the NDepend build comparison features, in the context of reporting.
Disclaimer: I work for NDepend