So, to improve code you may need in times the measures to find the code which needs improvement. And for that there is a requirement of some tools and methodology to analyze code.
One such measure is called Cyclomatic Complexity. This is a measure of different control flows in a method in your java code or any other programming language method or procedure. It is counted as simple as number of if -else flows.. Its indicated that if a method has cyclomatic complexity of 10 or higher then it is considered to be a candidate for looking for defects.
One improtant derivation from cyclomatic complexity is you should have equal number of test cases to the cyclomatic complexity. I found a brilliant article on the same here
No comments:
Post a Comment