4

Which metrics are there and which tools exist to measure the SOLIDness of C# code? Or tools to indicate where the principles are violated most harmfully?

Péter Török
  • 114,404
  • 31
  • 268
  • 329
Massimiliano
  • 16,770
  • 10
  • 69
  • 112
  • How would an automatic tool figure out the reasons why you might want to change a class in the future? I thought automated tools gave you metrics, which you then use to speculate on which code you should review and read. And then your reviewer (human, not software) finds violations of principles. – Warren P Apr 15 '10 at 20:29

2 Answers2

3

Scott Hanselman has an excellent article on NDepend. Also to see violation you can also use Code Analysis that comes with Visual Studio; you can use Code Analysis Policy Editor to choose rules.

MSV Muthu
  • 153
  • 1
  • 3
  • 8
2

You can use a static analysis tool (some are built into Visual Studio 2008 and above, professional editions and higher), or NDepend.

With NDepend, you can see how tightly coupled different classes are, what the cohesion of your codebase is like and more.

Oded
  • 489,969
  • 99
  • 883
  • 1,009
  • Well, that's all good, but how _exactly_? We use NDepend, but it's signal/noise ratio looks very low =( – Massimiliano Jan 28 '10 at 09:17
  • The Dependency Matrix, Dependency Graph and Metric View are all great visual queues. But I can't tell you what to look for without intimate knowledge of your architecture and application. – Oded Jan 28 '10 at 09:35