You'll need to write a metric without dimension, a bit like the C.R.A.P metric, where every of your requirements matter with a pondered additive or multiplicative factor.
I'd advise taking account also of code coverage by tests ratio in the metric, and as well measuring somehow that code contracts (Debug.Assert() or MS code contracts) are enforced.
Finally, I take a chance to say that we are working on the next version of NDepend (to be released in the first half of 2012) that will provide an easy way to write custom code metrics. (I am the PM of NDepend)
发布评论
评论(1)
您需要编写一个没有维度的指标,有点像 CRAP 指标,其中您的每个要求都与深思熟虑的加法或乘法因子有关。
我建议还考虑指标中测试比率的代码覆盖率,并以某种方式测量代码契约(Debug.Assert() 或 MS 代码契约)的执行情况。
我写了一篇与这些对抗制造的复杂性相关的博客文章。
最后,我借此机会说,我们正在开发 NDepend 的下一个版本(将在第一个版本中发布) 2012 年下半年),这将提供一种编写自定义代码指标的简单方法。 (我是 NDepend 的 PM)
You'll need to write a metric without dimension, a bit like the C.R.A.P metric, where every of your requirements matter with a pondered additive or multiplicative factor.
I'd advise taking account also of code coverage by tests ratio in the metric, and as well measuring somehow that code contracts (Debug.Assert() or MS code contracts) are enforced.
I wrote a blog post related to these Fighting Fabricated Complexity.
Finally, I take a chance to say that we are working on the next version of NDepend (to be released in the first half of 2012) that will provide an easy way to write custom code metrics. (I am the PM of NDepend)