Cyclometic Criticisms

270
-1

Published on

Published in: Technology, Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
270
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Cyclometic Criticisms

  1. 1. A critique of cyclomatic complexity as asoftware metric by Martin Shepperd Software Engineering Journal March 1988 Presented By: Tameem Ahmad M.Tech. Student Z.H.C.E.T. A.M.U.,Aligarh Copyright, 1996 © Dale Carnegie & Associates, Inc.
  2. 2. Overview• Introduction• Overview of Cyclomatic Complexity• Theoretical assumptions that reasoned for objection• Modification Suggested• Conclusion Martin Shepperd, Software Engineering Journal March 1988 2
  3. 3. Introduction ‘Halstead’s Software Science’ Cyclomatic Complexity approach of MacCabe Martin Shepperd, Software Engineering Journal March 1988 3
  4. 4. Overview of the CyclomaticComplexity Metric Control Path is the indicator v(G) = e - n + 1 (1) v(S) = e - n + 2p (2) IF X < 1 AND Y <2 THEN Case statements (n-1) n is the no. of cases Upper limit v(G)=10 suggested with some relaxations. Martin Shepperd, Software Engineering Journal March 1988 4
  5. 5. Controversy (1) On the basis of the counting rule Myers intervalThus the failure of cyclomatic complexity to count ELSE branches is only a serious deficiency if the metric is intended to Capture complexity of comprehension. Martin Shepperd, Software Engineering Journal March 1988 5
  6. 6. Controversy (2); on count of case Hansen (count case contribution to the complexity should be one) raises the question on the count of the cases Other have suggested as log2(n) Martin Shepperd, Software Engineering Journal March 1988 6
  7. 7. Controversy (3); (modification) Hansen proposed 2-tuple cyclomtic complexity(defined to be arithmetical operators, function and subroutine calls, assignments, input and output statements and array subscription). Discarded by Baker and Zweben as the problem to comparision. Martin Shepperd, Software Engineering Journal March 1988 7
  8. 8. Controversy (4) ; (modification) Stetter suggested cyclometic flow complexity metric. (flow of data is also considered her) Martin Shepperd, Software Engineering Journal March 1988 8
  9. 9. Controversy (5) Based on no. of structured With increase of program structure cyclometic complexity aslo increases. Martin Shepperd, Software Engineering Journal March 1988 9
  10. 10. Controversy (6) ; a critical one Evangelist reports that the application of only 2 out of 26 of Kernighan and Plauger’s rules of good programming style invariably results in a decrease in cyclomatic complexity. Martin Shepperd, Software Engineering Journal March 1988 10
  11. 11. Conclusion Much of the difficulty stems from the fact that McCabe was originally thinking in terms of Fortran, whereas most of these difficulties arise from other languages, some of them more recent, such as Ada Here one has to contend with problems such as distinguishing between‘IF y = 1 ORy = 3’ andIF y = 0 OR ELSE x/y>1. the mapping from code to a program graph is ambiguous. Martin Shepperd, Software Engineering Journal March 1988 11
  12. 12. Thank You 12

×