Tuesday, June 10, 2008

High code coverage + low cyclomatic complexity = quality code.

I have often heard and agree with the statement that 100% code coverage does not guaranty quality code. However, if you also monitor cyclomatic complexity of your code you will greatly increase the probability that it is problem free. If any method does not have 100% coverage or has cyclomatic complexity greater that 7 it should be suspect. The tool that I currently use for cyclomatic complexity is Code Monitor www.campwoodsw.com/sourcemonitor.html

1 comment:

Chris Barrow said...

Cool tool! Thanks! Do you have some examples of this tool in action?