SlideShare une entreprise Scribd logo
1  sur  11
Télécharger pour lire hors ligne
Cyclomatic complexity
The complexity of algorithms
Code Coverage Where Does It Fit? -
Tom McCabe (tmccabe@mccabe.com)
2
Test Focus: Requirements
Validation Audience: User
Code Coverage: Supplemental
Positive Test: Testing things in your specs that
you already know about
Test Focus: Implementation
Validation Audience: Code
Code Coverage: Primary
Negative Test: Testing things that may not
be in your specs but in the
implementation
White Box vs. Black Box Testing
Black Box Testing
White Box Testing
•
*or Breadth of Testing vs. Depth of Testing as detailed in Department of Army Pamphlet 73-1
18 times
n It is IMPOSSIBLE to test All Statistical Paths
n So, from structural coverage view,
When Should We Stop Testing?
n Not care? (planes do, missiles do)
n All lines?
n All branches?
n All cyclomatic paths?
18
0 10Optimum
Number of Tests?
All Statistical Paths = 10
18
If allow 1 Nanosecond per test, time is :
T =
10 x 3600 x 24 x 365
9
10 18
= 31.7 Years
IV. Testing Software for Reliability - Structured Testing
Impossibility of Testing Everything
A complexity measure
•Definition: The cyclomatic number v(G)
of a graph G with e edges, n nodes, and p
connected components is e-n+p.
•Theorem: In a strongly connected graph
the cyclomatic number is equal to the
maximal number of linearly independent
circuits.
With this example
• V(G) = 10 – 6 + 1 = 5
• # of regions = 5
Pick paths for the 5 circuits
• Using theorem 1 we choose a set of
circuits that are paths. The following set
B is a basis set of paths.
• B: (abef) , (a(be)2f) , ((abe)2f) , (acf) ,
(adcf)
• Linear combinations of paths in B will
generate any path. For example,
• (abea(be)3f) = 2(a(be)2f) – (abef)
• (a(be)2abef) = (a(be)2f)+((abe)2f)-(abef)
Methods of computing v(G)
• E-n+2
• # decisions + 1
• # of regions in a planar flow graph
8
Function A
Complexity = 20
5.17s
Unstructuredness (evg) = 1
Function B
Complexity = 18
Unstructuredness (evg) = 17
So B is MUCH harder to maintain!
Complexity (decisions) & # lines here are similar, but ...
Applications
Testing
Essential complexity --- reverse
engineering
Design Complexity ---- system
integration
Data complexity --- Y2K testing
Pareto Distribution of errors ---
reverse engineering
Code Breaker ---- Reuse
Security threats
Data Slicing ----- Reuse
Code walkthroughs ---- validation
Design validation
Requirements Validation
Google book search – McCabe Complexity – 22,000 books
Google web search (McCabe
complexity): 456,000
references
In 2009 Tom McCabe’s
publication on Software
Complexity was chosen as one
of the retrospective 23 highest
impact papers in computer
science by the ACM-SIGSOFT

Contenu connexe

Tendances

Algorithm
AlgorithmAlgorithm
Algorithm
farishah
 
White Box Testing And Control Flow & Loop Testing
White Box Testing And Control Flow & Loop TestingWhite Box Testing And Control Flow & Loop Testing
White Box Testing And Control Flow & Loop Testing
Ankit Mulani
 
Which is not a step in the problem
Which is not a step in the problemWhich is not a step in the problem
Which is not a step in the problem
kasguest
 
Analysis of Algorithms II - PS5
Analysis of Algorithms II - PS5Analysis of Algorithms II - PS5
Analysis of Algorithms II - PS5
AtakanAral
 

Tendances (18)

Collatz Conjecture Research
Collatz Conjecture ResearchCollatz Conjecture Research
Collatz Conjecture Research
 
phases of algorithm
phases of algorithmphases of algorithm
phases of algorithm
 
Flowcharts and algorithms
Flowcharts and algorithmsFlowcharts and algorithms
Flowcharts and algorithms
 
Algorithm
AlgorithmAlgorithm
Algorithm
 
Asufe juniors-training session2
Asufe juniors-training session2Asufe juniors-training session2
Asufe juniors-training session2
 
White Box Testing And Control Flow & Loop Testing
White Box Testing And Control Flow & Loop TestingWhite Box Testing And Control Flow & Loop Testing
White Box Testing And Control Flow & Loop Testing
 
Randomized Algorithms
Randomized AlgorithmsRandomized Algorithms
Randomized Algorithms
 
Which is not a step in the problem
Which is not a step in the problemWhich is not a step in the problem
Which is not a step in the problem
 
Topic 1.4: Randomized Algorithms
Topic 1.4: Randomized AlgorithmsTopic 1.4: Randomized Algorithms
Topic 1.4: Randomized Algorithms
 
EE 337 Lab 1 for Section 1 (2nd year UG)
 EE 337 Lab 1 for Section 1 (2nd year UG) EE 337 Lab 1 for Section 1 (2nd year UG)
EE 337 Lab 1 for Section 1 (2nd year UG)
 
Bp150520
Bp150520Bp150520
Bp150520
 
Partially connected 3D NoC - Access Noxim.
Partially connected 3D NoC - Access Noxim. Partially connected 3D NoC - Access Noxim.
Partially connected 3D NoC - Access Noxim.
 
Code optimization lecture
Code optimization lectureCode optimization lecture
Code optimization lecture
 
Vb (2)
Vb (2)Vb (2)
Vb (2)
 
Vb
VbVb
Vb
 
Fundamentals of Computing and C Programming - Part 3
Fundamentals of Computing and C Programming - Part 3Fundamentals of Computing and C Programming - Part 3
Fundamentals of Computing and C Programming - Part 3
 
Analysis of Algorithms II - PS5
Analysis of Algorithms II - PS5Analysis of Algorithms II - PS5
Analysis of Algorithms II - PS5
 
Video caption generation via seq-to-seq model (TensorFlow implementation)
Video caption generation via seq-to-seq model (TensorFlow implementation)Video caption generation via seq-to-seq model (TensorFlow implementation)
Video caption generation via seq-to-seq model (TensorFlow implementation)
 

Similaire à 20130523 05 - Cyclomatic complexity

Stephan berg track f
Stephan berg   track fStephan berg   track f
Stephan berg track f
Alona Gradman
 
Reducing Structural Bias in Technology Mapping
Reducing Structural Bias in Technology MappingReducing Structural Bias in Technology Mapping
Reducing Structural Bias in Technology Mapping
satrajit
 
A Survey on Dynamic Symbolic Execution for Automatic Test Generation
A Survey on  Dynamic Symbolic Execution  for Automatic Test GenerationA Survey on  Dynamic Symbolic Execution  for Automatic Test Generation
A Survey on Dynamic Symbolic Execution for Automatic Test Generation
Sung Kim
 
Java questions1
Java questions1Java questions1
Java questions1
yash4884
 

Similaire à 20130523 05 - Cyclomatic complexity (20)

20100309 02 - Software testing (McCabe)
20100309 02 - Software testing (McCabe)20100309 02 - Software testing (McCabe)
20100309 02 - Software testing (McCabe)
 
Stephan berg track f
Stephan berg   track fStephan berg   track f
Stephan berg track f
 
White Box testing by Pankaj Thakur, NITTTR Chandigarh
White Box testing by Pankaj Thakur, NITTTR ChandigarhWhite Box testing by Pankaj Thakur, NITTTR Chandigarh
White Box testing by Pankaj Thakur, NITTTR Chandigarh
 
Software Engineering : Software testing
Software Engineering : Software testingSoftware Engineering : Software testing
Software Engineering : Software testing
 
Biochip
BiochipBiochip
Biochip
 
Black Box Testing.pdf
Black Box Testing.pdfBlack Box Testing.pdf
Black Box Testing.pdf
 
Software Engineering (Testing techniques)
Software Engineering (Testing techniques)Software Engineering (Testing techniques)
Software Engineering (Testing techniques)
 
Software Engineering (Testing techniques)
Software Engineering (Testing techniques)Software Engineering (Testing techniques)
Software Engineering (Testing techniques)
 
Reducing Structural Bias in Technology Mapping
Reducing Structural Bias in Technology MappingReducing Structural Bias in Technology Mapping
Reducing Structural Bias in Technology Mapping
 
zkStudyClub: CirC and Compiling Programs to Circuits
zkStudyClub: CirC and Compiling Programs to CircuitszkStudyClub: CirC and Compiling Programs to Circuits
zkStudyClub: CirC and Compiling Programs to Circuits
 
Dsoop (co 221) 1
Dsoop (co 221) 1Dsoop (co 221) 1
Dsoop (co 221) 1
 
Multimodal Residual Learning for Visual Question-Answering
Multimodal Residual Learning for Visual Question-AnsweringMultimodal Residual Learning for Visual Question-Answering
Multimodal Residual Learning for Visual Question-Answering
 
SCALABLE PATTERN MATCHING OVER COMPRESSED GRAPHS VIA DE-DENSIFICATION
SCALABLE PATTERN MATCHING OVER COMPRESSED GRAPHS VIA DE-DENSIFICATIONSCALABLE PATTERN MATCHING OVER COMPRESSED GRAPHS VIA DE-DENSIFICATION
SCALABLE PATTERN MATCHING OVER COMPRESSED GRAPHS VIA DE-DENSIFICATION
 
11 whiteboxtesting
11 whiteboxtesting11 whiteboxtesting
11 whiteboxtesting
 
Efficient anomaly detection via matrix sketching
Efficient anomaly detection via matrix sketchingEfficient anomaly detection via matrix sketching
Efficient anomaly detection via matrix sketching
 
Web-Scale Graph Analytics with Apache® Spark™
Web-Scale Graph Analytics with Apache® Spark™Web-Scale Graph Analytics with Apache® Spark™
Web-Scale Graph Analytics with Apache® Spark™
 
A Survey on Dynamic Symbolic Execution for Automatic Test Generation
A Survey on  Dynamic Symbolic Execution  for Automatic Test GenerationA Survey on  Dynamic Symbolic Execution  for Automatic Test Generation
A Survey on Dynamic Symbolic Execution for Automatic Test Generation
 
Java questions1
Java questions1Java questions1
Java questions1
 
Undecidable Problems and Approximation Algorithms
Undecidable Problems and Approximation AlgorithmsUndecidable Problems and Approximation Algorithms
Undecidable Problems and Approximation Algorithms
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
 

Plus de LeClubQualiteLogicielle

20151013 - Crédit Mutuel ARKEA : mise en place d'une traçabilité outillée des...
20151013 - Crédit Mutuel ARKEA : mise en place d'une traçabilité outillée des...20151013 - Crédit Mutuel ARKEA : mise en place d'une traçabilité outillée des...
20151013 - Crédit Mutuel ARKEA : mise en place d'une traçabilité outillée des...
LeClubQualiteLogicielle
 

Plus de LeClubQualiteLogicielle (20)

20171122 03 - Les tests de performance en environnement DevOps
20171122 03 - Les tests de performance en environnement DevOps20171122 03 - Les tests de performance en environnement DevOps
20171122 03 - Les tests de performance en environnement DevOps
 
20171122 04 - Automatisation - formation et certifications
20171122 04 - Automatisation - formation et certifications20171122 04 - Automatisation - formation et certifications
20171122 04 - Automatisation - formation et certifications
 
20171122 01 - REX : Intégration et déploiement continu chez Engie
20171122 01 - REX : Intégration et déploiement continu chez Engie20171122 01 - REX : Intégration et déploiement continu chez Engie
20171122 01 - REX : Intégration et déploiement continu chez Engie
 
20171122 02 - Engage developers to use better coding practices
20171122 02 - Engage developers to use better coding practices20171122 02 - Engage developers to use better coding practices
20171122 02 - Engage developers to use better coding practices
 
20171122 - Accueil Club Qualité Logicielle
20171122 - Accueil Club Qualité Logicielle 20171122 - Accueil Club Qualité Logicielle
20171122 - Accueil Club Qualité Logicielle
 
20151013 - Crédit Mutuel ARKEA : mise en place d'une traçabilité outillée des...
20151013 - Crédit Mutuel ARKEA : mise en place d'une traçabilité outillée des...20151013 - Crédit Mutuel ARKEA : mise en place d'une traçabilité outillée des...
20151013 - Crédit Mutuel ARKEA : mise en place d'une traçabilité outillée des...
 
20151013 - Agirc arrco : Behavior driven development
20151013 - Agirc arrco : Behavior driven development20151013 - Agirc arrco : Behavior driven development
20151013 - Agirc arrco : Behavior driven development
 
20151013 - Réduire les coûts des tests de performance ?
20151013 - Réduire les coûts des tests de performance ?20151013 - Réduire les coûts des tests de performance ?
20151013 - Réduire les coûts des tests de performance ?
 
20151013 - Accueil Club Qualité Logicielle
20151013 - Accueil Club Qualité Logicielle 20151013 - Accueil Club Qualité Logicielle
20151013 - Accueil Club Qualité Logicielle
 
20151013 - DevOps et qualification continue
20151013 - DevOps et qualification continue20151013 - DevOps et qualification continue
20151013 - DevOps et qualification continue
 
20140410 - Cartographie applicative multi-technologies et analyse d'impact
20140410 - Cartographie applicative multi-technologies et analyse d'impact20140410 - Cartographie applicative multi-technologies et analyse d'impact
20140410 - Cartographie applicative multi-technologies et analyse d'impact
 
20140410 - Implémentation de squash TM-TA - Architecture et méthodologie
20140410 - Implémentation de squash TM-TA - Architecture et méthodologie20140410 - Implémentation de squash TM-TA - Architecture et méthodologie
20140410 - Implémentation de squash TM-TA - Architecture et méthodologie
 
20140410 - Gestion des identités, traçabilité des accés - Analogie avec la qu...
20140410 - Gestion des identités, traçabilité des accés - Analogie avec la qu...20140410 - Gestion des identités, traçabilité des accés - Analogie avec la qu...
20140410 - Gestion des identités, traçabilité des accés - Analogie avec la qu...
 
20140410 - Choisir et implanter un outil de test
20140410 - Choisir et implanter un outil de test20140410 - Choisir et implanter un outil de test
20140410 - Choisir et implanter un outil de test
 
20130113 02 - TMMI, un modèle pour rentabiliser une organisation de test et a...
20130113 02 - TMMI, un modèle pour rentabiliser une organisation de test et a...20130113 02 - TMMI, un modèle pour rentabiliser une organisation de test et a...
20130113 02 - TMMI, un modèle pour rentabiliser une organisation de test et a...
 
20130113 06 - Travaux de recherche sur la corrélation entre qualité du code e...
20130113 06 - Travaux de recherche sur la corrélation entre qualité du code e...20130113 06 - Travaux de recherche sur la corrélation entre qualité du code e...
20130113 06 - Travaux de recherche sur la corrélation entre qualité du code e...
 
20130113 05 - Inspection continue et roadmap 2013
20130113 05 - Inspection continue et roadmap 201320130113 05 - Inspection continue et roadmap 2013
20130113 05 - Inspection continue et roadmap 2013
 
20130113 04 - Tests d'integration et virtualisation - La vision IBM
20130113 04 - Tests d'integration et virtualisation - La vision IBM20130113 04 - Tests d'integration et virtualisation - La vision IBM
20130113 04 - Tests d'integration et virtualisation - La vision IBM
 
20130523 06 - The mathematics the way algorithms think / the mathematics the ...
20130523 06 - The mathematics the way algorithms think / the mathematics the ...20130523 06 - The mathematics the way algorithms think / the mathematics the ...
20130523 06 - The mathematics the way algorithms think / the mathematics the ...
 
20130523 04 - Grille d'évaluation - Gestion du patrimoine de test
20130523 04 - Grille d'évaluation - Gestion du patrimoine de test20130523 04 - Grille d'évaluation - Gestion du patrimoine de test
20130523 04 - Grille d'évaluation - Gestion du patrimoine de test
 

Dernier

+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Dernier (20)

%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 

20130523 05 - Cyclomatic complexity

  • 2. Code Coverage Where Does It Fit? - Tom McCabe (tmccabe@mccabe.com) 2 Test Focus: Requirements Validation Audience: User Code Coverage: Supplemental Positive Test: Testing things in your specs that you already know about Test Focus: Implementation Validation Audience: Code Code Coverage: Primary Negative Test: Testing things that may not be in your specs but in the implementation White Box vs. Black Box Testing Black Box Testing White Box Testing • *or Breadth of Testing vs. Depth of Testing as detailed in Department of Army Pamphlet 73-1
  • 3. 18 times n It is IMPOSSIBLE to test All Statistical Paths n So, from structural coverage view, When Should We Stop Testing? n Not care? (planes do, missiles do) n All lines? n All branches? n All cyclomatic paths? 18 0 10Optimum Number of Tests? All Statistical Paths = 10 18 If allow 1 Nanosecond per test, time is : T = 10 x 3600 x 24 x 365 9 10 18 = 31.7 Years IV. Testing Software for Reliability - Structured Testing Impossibility of Testing Everything
  • 4. A complexity measure •Definition: The cyclomatic number v(G) of a graph G with e edges, n nodes, and p connected components is e-n+p. •Theorem: In a strongly connected graph the cyclomatic number is equal to the maximal number of linearly independent circuits.
  • 5. With this example • V(G) = 10 – 6 + 1 = 5 • # of regions = 5
  • 6. Pick paths for the 5 circuits • Using theorem 1 we choose a set of circuits that are paths. The following set B is a basis set of paths. • B: (abef) , (a(be)2f) , ((abe)2f) , (acf) , (adcf) • Linear combinations of paths in B will generate any path. For example, • (abea(be)3f) = 2(a(be)2f) – (abef) • (a(be)2abef) = (a(be)2f)+((abe)2f)-(abef)
  • 7. Methods of computing v(G) • E-n+2 • # decisions + 1 • # of regions in a planar flow graph
  • 8. 8 Function A Complexity = 20 5.17s Unstructuredness (evg) = 1 Function B Complexity = 18 Unstructuredness (evg) = 17 So B is MUCH harder to maintain! Complexity (decisions) & # lines here are similar, but ...
  • 9. Applications Testing Essential complexity --- reverse engineering Design Complexity ---- system integration Data complexity --- Y2K testing Pareto Distribution of errors --- reverse engineering Code Breaker ---- Reuse Security threats Data Slicing ----- Reuse Code walkthroughs ---- validation Design validation Requirements Validation
  • 10. Google book search – McCabe Complexity – 22,000 books
  • 11. Google web search (McCabe complexity): 456,000 references In 2009 Tom McCabe’s publication on Software Complexity was chosen as one of the retrospective 23 highest impact papers in computer science by the ACM-SIGSOFT