SlideShare ist ein Scribd-Unternehmen logo
1 von 12
A critique of cyclomatic complexity as a
software 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.
Overview
• Introduction
• Overview of Cyclomatic Complexity
• Theoretical assumptions that reasoned for
 objection
• Modification Suggested
• Conclusion


 Martin Shepperd, Software Engineering Journal March 1988   2
Introduction
 ‘Halstead’s Software Science’
 Cyclomatic Complexity approach of
 MacCabe




 Martin Shepperd, Software Engineering Journal March 1988   3
Overview of the Cyclomatic
Complexity 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
Controversy (1)
   On the basis of the counting rule
   Myers interval




Thus 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
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
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
Controversy (4) ;                               (modification)

 Stetter suggested cyclometic flow
 complexity metric. (flow of data is also
 considered her)




 Martin Shepperd, Software Engineering Journal March 1988        8
Controversy (5)
 Based on no. of structured
 With increase of program structure
 cyclometic complexity aslo increases.




 Martin Shepperd, Software Engineering Journal March 1988   9
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
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’ and
IF 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
Thank You




             12

Weitere ähnliche Inhalte

Was ist angesagt?

Analysis of Algorithms II - PS3
Analysis of Algorithms II - PS3Analysis of Algorithms II - PS3
Analysis of Algorithms II - PS3
AtakanAral
 

Was ist angesagt? (18)

JAIDEEP SINGH
JAIDEEP SINGHJAIDEEP SINGH
JAIDEEP SINGH
 
00454
0045400454
00454
 
PRAM algorithms from deepika
PRAM algorithms from deepikaPRAM algorithms from deepika
PRAM algorithms from deepika
 
Exact network reconstruction from consensus signals and one eigen value
Exact network reconstruction from consensus signals and one eigen valueExact network reconstruction from consensus signals and one eigen value
Exact network reconstruction from consensus signals and one eigen value
 
Shor's discrete logarithm quantum algorithm for elliptic curves
 Shor's discrete logarithm quantum algorithm for elliptic curves Shor's discrete logarithm quantum algorithm for elliptic curves
Shor's discrete logarithm quantum algorithm for elliptic curves
 
ICDE-2015 Shortest Path Traversal Optimization and Analysis for Large Graph C...
ICDE-2015 Shortest Path Traversal Optimization and Analysis for Large Graph C...ICDE-2015 Shortest Path Traversal Optimization and Analysis for Large Graph C...
ICDE-2015 Shortest Path Traversal Optimization and Analysis for Large Graph C...
 
C055011012
C055011012C055011012
C055011012
 
Analysis of Algorithms II - PS3
Analysis of Algorithms II - PS3Analysis of Algorithms II - PS3
Analysis of Algorithms II - PS3
 
Dueling Network Architectures for Deep Reinforcement Learning
Dueling Network Architectures for Deep Reinforcement LearningDueling Network Architectures for Deep Reinforcement Learning
Dueling Network Architectures for Deep Reinforcement Learning
 
M045077578
M045077578M045077578
M045077578
 
Parallel-kmeans
Parallel-kmeansParallel-kmeans
Parallel-kmeans
 
Daa unit 6_efficiency of algorithms
Daa unit 6_efficiency of algorithmsDaa unit 6_efficiency of algorithms
Daa unit 6_efficiency of algorithms
 
Introduction to Algorithms Complexity Analysis
Introduction to Algorithms Complexity Analysis Introduction to Algorithms Complexity Analysis
Introduction to Algorithms Complexity Analysis
 
A Load-Balanced Parallelization of AKS Algorithm
A Load-Balanced Parallelization of AKS AlgorithmA Load-Balanced Parallelization of AKS Algorithm
A Load-Balanced Parallelization of AKS Algorithm
 
Equivalent condition and two algorithms for hamiltonian graphs
Equivalent condition and two algorithms for hamiltonian graphsEquivalent condition and two algorithms for hamiltonian graphs
Equivalent condition and two algorithms for hamiltonian graphs
 
Algorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to AlgorithmsAlgorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to Algorithms
 
Efficient asic architecture of rsa cryptosystem
Efficient asic architecture of rsa cryptosystemEfficient asic architecture of rsa cryptosystem
Efficient asic architecture of rsa cryptosystem
 
Data Structures and Algorithm Analysis
Data Structures  and  Algorithm AnalysisData Structures  and  Algorithm Analysis
Data Structures and Algorithm Analysis
 

Ähnlich wie Cyclometic Criticisms

Performance analysis of machine learning approaches in software complexity pr...
Performance analysis of machine learning approaches in software complexity pr...Performance analysis of machine learning approaches in software complexity pr...
Performance analysis of machine learning approaches in software complexity pr...
Sayed Mohsin Reza
 
DSP unit1,2,3 VSQs-vrc.pdf important question
DSP unit1,2,3 VSQs-vrc.pdf important questionDSP unit1,2,3 VSQs-vrc.pdf important question
DSP unit1,2,3 VSQs-vrc.pdf important question
Sahithikairamkonda
 
[Ris cy business]
[Ris cy business][Ris cy business]
[Ris cy business]
Dino, llc
 

Ähnlich wie Cyclometic Criticisms (20)

Modelling of ntc thermistor using artificial neural network for non linearity...
Modelling of ntc thermistor using artificial neural network for non linearity...Modelling of ntc thermistor using artificial neural network for non linearity...
Modelling of ntc thermistor using artificial neural network for non linearity...
 
Cd32504509
Cd32504509Cd32504509
Cd32504509
 
Cd32504509
Cd32504509Cd32504509
Cd32504509
 
Performance analysis of machine learning approaches in software complexity pr...
Performance analysis of machine learning approaches in software complexity pr...Performance analysis of machine learning approaches in software complexity pr...
Performance analysis of machine learning approaches in software complexity pr...
 
Ch1
Ch1Ch1
Ch1
 
Complexity Analysis
Complexity Analysis Complexity Analysis
Complexity Analysis
 
70
7070
70
 
Sorting_project_2.pdf
Sorting_project_2.pdfSorting_project_2.pdf
Sorting_project_2.pdf
 
DSP unit1,2,3 VSQs-vrc.pdf important question
DSP unit1,2,3 VSQs-vrc.pdf important questionDSP unit1,2,3 VSQs-vrc.pdf important question
DSP unit1,2,3 VSQs-vrc.pdf important question
 
A Novel Algorithm on Wavelet Based Robust Invisible Digital Image Watermarkin...
A Novel Algorithm on Wavelet Based Robust Invisible Digital Image Watermarkin...A Novel Algorithm on Wavelet Based Robust Invisible Digital Image Watermarkin...
A Novel Algorithm on Wavelet Based Robust Invisible Digital Image Watermarkin...
 
OTP, Phishing, QR code, Shares, Visual Cryptography.
OTP, Phishing, QR code, Shares, Visual Cryptography.OTP, Phishing, QR code, Shares, Visual Cryptography.
OTP, Phishing, QR code, Shares, Visual Cryptography.
 
On Selection of Periodic Kernels Parameters in Time Series Prediction
On Selection of Periodic Kernels Parameters in Time Series Prediction On Selection of Periodic Kernels Parameters in Time Series Prediction
On Selection of Periodic Kernels Parameters in Time Series Prediction
 
ON SELECTION OF PERIODIC KERNELS PARAMETERS IN TIME SERIES PREDICTION
ON SELECTION OF PERIODIC KERNELS PARAMETERS IN TIME SERIES PREDICTIONON SELECTION OF PERIODIC KERNELS PARAMETERS IN TIME SERIES PREDICTION
ON SELECTION OF PERIODIC KERNELS PARAMETERS IN TIME SERIES PREDICTION
 
R18B.Tech.CSESyllabus.pdf
R18B.Tech.CSESyllabus.pdfR18B.Tech.CSESyllabus.pdf
R18B.Tech.CSESyllabus.pdf
 
R18B.Tech.CSESyllabus.pdf
R18B.Tech.CSESyllabus.pdfR18B.Tech.CSESyllabus.pdf
R18B.Tech.CSESyllabus.pdf
 
[Ris cy business]
[Ris cy business][Ris cy business]
[Ris cy business]
 
Scalable Algorithm Design with MapReduce
Scalable Algorithm Design with MapReduceScalable Algorithm Design with MapReduce
Scalable Algorithm Design with MapReduce
 
Automatic Task-based Code Generation for High Performance DSEL
Automatic Task-based Code Generation for High Performance DSELAutomatic Task-based Code Generation for High Performance DSEL
Automatic Task-based Code Generation for High Performance DSEL
 
Belief Propagation Decoder for LDPC Codes Based on VLSI Implementation
Belief Propagation Decoder for LDPC Codes Based on VLSI ImplementationBelief Propagation Decoder for LDPC Codes Based on VLSI Implementation
Belief Propagation Decoder for LDPC Codes Based on VLSI Implementation
 
A Hybrid Method of CART and Artificial Neural Network for Short Term Load For...
A Hybrid Method of CART and Artificial Neural Network for Short Term Load For...A Hybrid Method of CART and Artificial Neural Network for Short Term Load For...
A Hybrid Method of CART and Artificial Neural Network for Short Term Load For...
 

Kürzlich hochgeladen

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Kürzlich hochgeladen (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 

Cyclometic Criticisms

  • 1. A critique of cyclomatic complexity as a software 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. Overview • Introduction • Overview of Cyclomatic Complexity • Theoretical assumptions that reasoned for objection • Modification Suggested • Conclusion Martin Shepperd, Software Engineering Journal March 1988 2
  • 3. Introduction ‘Halstead’s Software Science’ Cyclomatic Complexity approach of MacCabe Martin Shepperd, Software Engineering Journal March 1988 3
  • 4. Overview of the Cyclomatic Complexity 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. Controversy (1) On the basis of the counting rule Myers interval Thus 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. 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. 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. 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. 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. 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. 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’ and IF 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