SlideShare una empresa de Scribd logo
1 de 19
Descargar para leer sin conexión
Software Quality Management 
          Unit – IV 

                      G. Roy Antony Arnold 
                           Asst. Prof. / CSE
• The li
   h lines of code ( OC) count i usually f
              f d (LOC)             is  ll for
  executable statements.
• LOC count represents the program size and
  complexity, it is not a surprise that

                            .
• More recent studies point to a curvilinear
  relationship between lines of code and defect
  rate:
Maximum Source     Average Defect per
Lines of Modules   1,000 Source Lines
       63                 1.5
      100                 1.4
      158                 0.9
      251                 0.5
      398                 1.1
      630                 1.9
      1000                1.3
     >1000                1.4
• Wh
  When module size b
             d l     i    becomes very l    large, the
                                                    h
  complexity increases to a level beyond a
  programmer s
  programmer's immediate span of control and total
  comprehension.
• The curvilinear model between size and defect
  density sheds new light on software quality
  engineering. It implies that there may be an
    g        g         p                      y
  optimal program size that can lead to the lowest
  defect rate.
• Such an optimum may depend on language,
  project, product, and environment; apparently
  many more empirical i
                  i i l investigations are needed.
                             ti ti              d d
• Halstead (1977) distinguishes software
  science from computer science.
• The premise of software science is that any
  programming task consists of selecting and
  arranging a finite number of program
  “tokens”, which are
   tokens
                              .
• A computer program, according to software
                             di        f
  science,
                                         .
• Th primitive measures of H l t d' software science
  The i iti              f Halstead's ft       i
  are




• Based on these primitive measures, Halstead
  developed a system of equations expressing

                                             and other
  features such as development effort and the projected
  number of faults in the software.
Vocabulary, 
Length, 
Length,
Volume, 
Level, 
Difficulty, 
Difficulty
Effort, 
Faults, 
• The measurement of cyclomatic complexity b
   h               f    l    i      l i by
  McCabe (1976) was designed

  (maintainability).
• It is the classical graph theory cyclomatic
  number,
          .
• To determine the paths, the program
  procedure is represented

       .
• The general formula to compute cyclomatic
      p    y
  complexity is:

• Wh
  Where,
 V(G) – Cyclomatic Number of G
  ( ) y
 e – Number of edges
 n – Number of nodes
 n Number of nodes
 p – Number of unconnected parts of the graph
• If we count the edges, nodes, and 
  disconnected parts of the graph, 


• The iteration test in a looping statement is
  The iteration test in a looping statement is 
  counted as one binary decision. In the 
  preceding simple example, since there are 
  two binary decisions, M = 2 + 1 = 3
• The cyclomatic complexity metric is 
  additive. The complexity of several graphs 
  additive The complexity of several graphs
  considered as a group is equal to the sum 
                    g p          p
  of the individual graphs' complexities.
needing detailed inspections.
      g             p
                                   likely to 
have a low defect rate and therefore 
have a low defect rate and therefore
candidates for development without 
detailed inspections.
     l

     , identify troublesome code, and 
estimate testing effort.
estimate testing effort
• McCabe's cyclomatic complexity index is a
                                      .
• It does not distinguish different kinds of control
  flow complexity such as
            p    y
                                        .
• In studying the quality and syntactic indicators
  among a sample of twenty modules of a COBOL
  compiler product
             product,             found that
          at the module level can be estimated
  through the following equations:
• Lo found that most developers were having difficulty 
                             p             g          y
  mastering the DO WHILE construct.
• As a result, minimizing the use of DO WHILE was one of 
  the actions the team took to reduce defects in the 
  compiler product.
• St t
  Structure metrics try to take into account the 
              ti t t t k i t               t th
                                        .
• The most common design structure metrics 
  are the 
  are the                        , which are 
                                   which are
  based on the                proposed by 
                         (1979) and 
  (1978):
             A count of the modules that call a given 
    module
           : A count of modules that are called by a 
    given module
    given module
• I        l    d l    ith l       f i
  In general, modules with a large fan‐in are 
                                                     . 
• In contrast, modules that are large and complex are 
  likely to have a small fan‐in.
                        structure complexity is 
  defined as:

• Henry and Selig's work (1990) defines a hybrid form 
  of their information‐flow metric as
  of their information flow metric as

  where, C internal complexity of procedure p
  where, Cip – internal complexity of procedure p
• C d d Gl (1990) d l
  Card and Glass (1990) developed a system complexity model
                                d      t       l it     d l

  Ct – System Complexity St – Structural (intermodule)
       System Complexity, S Structural (intermodule) 
   complexity, Dt – Data (intermodule) complexity
• They defined relative system complexity as

  n – no. Of modules in the system
• S
  Structure complexity is further defined as
                 l i i f h d fi d

              S=
                   ∑   f 2 (i )
                       n

  Where S – Structural Complexity, f(i) – Fan‐out of Module i,      
  n – no. Of modules in the system
• D t C
  Data Complexity is further defined as
           l it i f th d fi d



  Di  Data Complexity of Module i, V(i)  I/O 
  Di – Data Complexity of Module i, V(i) – I/O
  Variables in module i, f(i) – fan‐out of module i



  D – Data (intramodule) Complexity, D(i) – Data 
  Complexity of module i, n = Number of new 
  modules in the system

Más contenido relacionado

La actualidad más candente

Maintenance & Re-Engineering of Software
Maintenance & Re-Engineering of SoftwareMaintenance & Re-Engineering of Software
Maintenance & Re-Engineering of SoftwareAdeel Riaz
 
Error Detection & Recovery
Error Detection & RecoveryError Detection & Recovery
Error Detection & RecoveryAkhil Kaushik
 
1 2. project management
1 2. project management1 2. project management
1 2. project managementakashsaini8
 
Design Concept software engineering
Design Concept software engineeringDesign Concept software engineering
Design Concept software engineeringDarshit Metaliya
 
Equivalence class testing
Equivalence  class testingEquivalence  class testing
Equivalence class testingMani Kanth
 
Halsted’s Software Science-An analytical technique
Halsted’s Software Science-An analytical techniqueHalsted’s Software Science-An analytical technique
Halsted’s Software Science-An analytical techniqueNur Islam
 
Software Measurement and Metrics.pptx
Software Measurement and Metrics.pptxSoftware Measurement and Metrics.pptx
Software Measurement and Metrics.pptxubaidullah75790
 
Software project-scheduling
Software project-schedulingSoftware project-scheduling
Software project-schedulingsaurabhshertukde
 
Software engineering lecture notes
Software engineering lecture notesSoftware engineering lecture notes
Software engineering lecture notesSiva Ayyakutti
 
Putnam Resource allocation model.ppt
Putnam Resource allocation model.pptPutnam Resource allocation model.ppt
Putnam Resource allocation model.pptAnupamaSharma80
 
Software process and project metrics
Software process and project metricsSoftware process and project metrics
Software process and project metricsIndu Sharma Bhardwaj
 

La actualidad más candente (20)

Maintenance & Re-Engineering of Software
Maintenance & Re-Engineering of SoftwareMaintenance & Re-Engineering of Software
Maintenance & Re-Engineering of Software
 
Error Detection & Recovery
Error Detection & RecoveryError Detection & Recovery
Error Detection & Recovery
 
Asymptotic Notation
Asymptotic NotationAsymptotic Notation
Asymptotic Notation
 
Compiler Chapter 1
Compiler Chapter 1Compiler Chapter 1
Compiler Chapter 1
 
1 2. project management
1 2. project management1 2. project management
1 2. project management
 
Design Concept software engineering
Design Concept software engineeringDesign Concept software engineering
Design Concept software engineering
 
Software Metrics
Software MetricsSoftware Metrics
Software Metrics
 
Equivalence class testing
Equivalence  class testingEquivalence  class testing
Equivalence class testing
 
What is agile model
What is agile modelWhat is agile model
What is agile model
 
Software Evolution
Software EvolutionSoftware Evolution
Software Evolution
 
Halsted’s Software Science-An analytical technique
Halsted’s Software Science-An analytical techniqueHalsted’s Software Science-An analytical technique
Halsted’s Software Science-An analytical technique
 
Software Measurement and Metrics.pptx
Software Measurement and Metrics.pptxSoftware Measurement and Metrics.pptx
Software Measurement and Metrics.pptx
 
Managment spectrum
Managment spectrumManagment spectrum
Managment spectrum
 
Software quality
Software qualitySoftware quality
Software quality
 
Software project-scheduling
Software project-schedulingSoftware project-scheduling
Software project-scheduling
 
Software engineering lecture notes
Software engineering lecture notesSoftware engineering lecture notes
Software engineering lecture notes
 
Walkthroughs
WalkthroughsWalkthroughs
Walkthroughs
 
Putnam Resource allocation model.ppt
Putnam Resource allocation model.pptPutnam Resource allocation model.ppt
Putnam Resource allocation model.ppt
 
Reliability growth models
Reliability growth modelsReliability growth models
Reliability growth models
 
Software process and project metrics
Software process and project metricsSoftware process and project metrics
Software process and project metrics
 

Similar a Complexity metrics and models

Software engineering
Software engineeringSoftware engineering
Software engineeringRohan Bhatkar
 
Vulnerability Detection Based on Git History
Vulnerability Detection Based on Git HistoryVulnerability Detection Based on Git History
Vulnerability Detection Based on Git HistoryKenta Yamamoto
 
Introduction to OpenSees by Frank McKenna
Introduction to OpenSees by Frank McKennaIntroduction to OpenSees by Frank McKenna
Introduction to OpenSees by Frank McKennaopenseesdays
 
naveed-kamran-software-architecture-agile
naveed-kamran-software-architecture-agilenaveed-kamran-software-architecture-agile
naveed-kamran-software-architecture-agileNaveed Kamran
 
Software Architectures, Week 2 - Decomposition techniques
Software Architectures, Week 2 - Decomposition techniquesSoftware Architectures, Week 2 - Decomposition techniques
Software Architectures, Week 2 - Decomposition techniquesAngelos Kapsimanis
 
INTRODUCTION TO C PROGRAMMING in basic c language
INTRODUCTION TO C PROGRAMMING in basic c languageINTRODUCTION TO C PROGRAMMING in basic c language
INTRODUCTION TO C PROGRAMMING in basic c languageGOKULKANNANMMECLECTC
 
Keynote at IWLS 2017
Keynote at IWLS 2017Keynote at IWLS 2017
Keynote at IWLS 2017Manish Pandey
 
Scalable constrained spectral clustering
Scalable constrained spectral clusteringScalable constrained spectral clustering
Scalable constrained spectral clusteringNishanth Harapanahalli
 
Software architacture recovery
Software architacture recoverySoftware architacture recovery
Software architacture recoveryImdad Ul Haq
 
IncQuery-D: Incremental Queries in the Cloud
IncQuery-D: Incremental Queries in the CloudIncQuery-D: Incremental Queries in the Cloud
IncQuery-D: Incremental Queries in the CloudGábor Szárnyas
 
Software_effort_estimation for Software engineering.pdf
Software_effort_estimation for Software engineering.pdfSoftware_effort_estimation for Software engineering.pdf
Software_effort_estimation for Software engineering.pdfsnehan789
 
Generating test cases using UML Communication Diagram
Generating test cases using UML Communication Diagram Generating test cases using UML Communication Diagram
Generating test cases using UML Communication Diagram Praveen Penumathsa
 
Software Product Measurement and Analysis in a Continuous Integration Environ...
Software Product Measurement and Analysis in a Continuous Integration Environ...Software Product Measurement and Analysis in a Continuous Integration Environ...
Software Product Measurement and Analysis in a Continuous Integration Environ...Gabriel Moreira
 

Similar a Complexity metrics and models (20)

Digital_system_design_A (1).ppt
Digital_system_design_A (1).pptDigital_system_design_A (1).ppt
Digital_system_design_A (1).ppt
 
Software engineering
Software engineeringSoftware engineering
Software engineering
 
Vulnerability Detection Based on Git History
Vulnerability Detection Based on Git HistoryVulnerability Detection Based on Git History
Vulnerability Detection Based on Git History
 
Introduction to OpenSees by Frank McKenna
Introduction to OpenSees by Frank McKennaIntroduction to OpenSees by Frank McKenna
Introduction to OpenSees by Frank McKenna
 
Cost effort.ppt
Cost effort.pptCost effort.ppt
Cost effort.ppt
 
naveed-kamran-software-architecture-agile
naveed-kamran-software-architecture-agilenaveed-kamran-software-architecture-agile
naveed-kamran-software-architecture-agile
 
Software metrics
Software metricsSoftware metrics
Software metrics
 
Software Architectures, Week 2 - Decomposition techniques
Software Architectures, Week 2 - Decomposition techniquesSoftware Architectures, Week 2 - Decomposition techniques
Software Architectures, Week 2 - Decomposition techniques
 
computer architecture.
computer architecture.computer architecture.
computer architecture.
 
INTRODUCTION TO C PROGRAMMING in basic c language
INTRODUCTION TO C PROGRAMMING in basic c languageINTRODUCTION TO C PROGRAMMING in basic c language
INTRODUCTION TO C PROGRAMMING in basic c language
 
Keynote at IWLS 2017
Keynote at IWLS 2017Keynote at IWLS 2017
Keynote at IWLS 2017
 
Scalable constrained spectral clustering
Scalable constrained spectral clusteringScalable constrained spectral clustering
Scalable constrained spectral clustering
 
Software architacture recovery
Software architacture recoverySoftware architacture recovery
Software architacture recovery
 
IncQuery-D: Incremental Queries in the Cloud
IncQuery-D: Incremental Queries in the CloudIncQuery-D: Incremental Queries in the Cloud
IncQuery-D: Incremental Queries in the Cloud
 
Ch01lect1 et
Ch01lect1 etCh01lect1 et
Ch01lect1 et
 
Chapter 12
Chapter 12Chapter 12
Chapter 12
 
Software_effort_estimation for Software engineering.pdf
Software_effort_estimation for Software engineering.pdfSoftware_effort_estimation for Software engineering.pdf
Software_effort_estimation for Software engineering.pdf
 
Generating test cases using UML Communication Diagram
Generating test cases using UML Communication Diagram Generating test cases using UML Communication Diagram
Generating test cases using UML Communication Diagram
 
Software Product Measurement and Analysis in a Continuous Integration Environ...
Software Product Measurement and Analysis in a Continuous Integration Environ...Software Product Measurement and Analysis in a Continuous Integration Environ...
Software Product Measurement and Analysis in a Continuous Integration Environ...
 
Metrics
MetricsMetrics
Metrics
 

Más de Roy Antony Arnold G (20)

6 sigma
6 sigma6 sigma
6 sigma
 
Run chart
Run chartRun chart
Run chart
 
Reliability growth models for quality management
Reliability growth models for quality managementReliability growth models for quality management
Reliability growth models for quality management
 
6 sigma
6 sigma6 sigma
6 sigma
 
Quality management models
Quality management modelsQuality management models
Quality management models
 
Pareto diagram
Pareto diagramPareto diagram
Pareto diagram
 
Ishikawa diagram
Ishikawa diagramIshikawa diagram
Ishikawa diagram
 
Histogram
HistogramHistogram
Histogram
 
Customer satisfaction
Customer satisfactionCustomer satisfaction
Customer satisfaction
 
Control chart
Control chartControl chart
Control chart
 
Check lists
Check listsCheck lists
Check lists
 
Capability maturity model
Capability maturity modelCapability maturity model
Capability maturity model
 
Structure chart
Structure chartStructure chart
Structure chart
 
Seven new tools
Seven new toolsSeven new tools
Seven new tools
 
Scatter diagram
Scatter diagramScatter diagram
Scatter diagram
 
Qms
QmsQms
Qms
 
Relations diagram
Relations diagramRelations diagram
Relations diagram
 
Rayleigh model
Rayleigh modelRayleigh model
Rayleigh model
 
Customer satisfaction
Customer satisfactionCustomer satisfaction
Customer satisfaction
 
Case tools
Case toolsCase tools
Case tools
 

Complexity metrics and models

  • 1. Software Quality Management  Unit – IV  G. Roy Antony Arnold  Asst. Prof. / CSE
  • 2. • The li h lines of code ( OC) count i usually f f d (LOC) is ll for executable statements. • LOC count represents the program size and complexity, it is not a surprise that . • More recent studies point to a curvilinear relationship between lines of code and defect rate:
  • 3.
  • 4. Maximum Source  Average Defect per Lines of Modules 1,000 Source Lines 63 1.5 100 1.4 158 0.9 251 0.5 398 1.1 630 1.9 1000 1.3 >1000 1.4
  • 5. • Wh When module size b d l i becomes very l large, the h complexity increases to a level beyond a programmer s programmer's immediate span of control and total comprehension. • The curvilinear model between size and defect density sheds new light on software quality engineering. It implies that there may be an g g p y optimal program size that can lead to the lowest defect rate. • Such an optimum may depend on language, project, product, and environment; apparently many more empirical i i i l investigations are needed. ti ti d d
  • 6. • Halstead (1977) distinguishes software science from computer science. • The premise of software science is that any programming task consists of selecting and arranging a finite number of program “tokens”, which are tokens . • A computer program, according to software di f science, .
  • 7. • Th primitive measures of H l t d' software science The i iti f Halstead's ft i are • Based on these primitive measures, Halstead developed a system of equations expressing and other features such as development effort and the projected number of faults in the software.
  • 9. • The measurement of cyclomatic complexity b h f l i l i by McCabe (1976) was designed (maintainability). • It is the classical graph theory cyclomatic number, . • To determine the paths, the program procedure is represented .
  • 10. • The general formula to compute cyclomatic p y complexity is: • Wh Where, V(G) – Cyclomatic Number of G ( ) y e – Number of edges n – Number of nodes n Number of nodes p – Number of unconnected parts of the graph
  • 11. • If we count the edges, nodes, and  disconnected parts of the graph,  • The iteration test in a looping statement is The iteration test in a looping statement is  counted as one binary decision. In the  preceding simple example, since there are  two binary decisions, M = 2 + 1 = 3 • The cyclomatic complexity metric is  additive. The complexity of several graphs  additive The complexity of several graphs considered as a group is equal to the sum  g p p of the individual graphs' complexities.
  • 12.
  • 13. needing detailed inspections. g p likely to  have a low defect rate and therefore  have a low defect rate and therefore candidates for development without  detailed inspections. l , identify troublesome code, and  estimate testing effort. estimate testing effort
  • 14. • McCabe's cyclomatic complexity index is a . • It does not distinguish different kinds of control flow complexity such as p y . • In studying the quality and syntactic indicators among a sample of twenty modules of a COBOL compiler product product, found that at the module level can be estimated through the following equations:
  • 15. • Lo found that most developers were having difficulty  p g y mastering the DO WHILE construct. • As a result, minimizing the use of DO WHILE was one of  the actions the team took to reduce defects in the  compiler product.
  • 16. • St t Structure metrics try to take into account the  ti t t t k i t t th . • The most common design structure metrics  are the  are the , which are  which are based on the  proposed by  (1979) and  (1978): A count of the modules that call a given  module : A count of modules that are called by a  given module given module
  • 17. • I l d l ith l f i In general, modules with a large fan‐in are  .  • In contrast, modules that are large and complex are  likely to have a small fan‐in. structure complexity is  defined as: • Henry and Selig's work (1990) defines a hybrid form  of their information‐flow metric as of their information flow metric as where, C internal complexity of procedure p where, Cip – internal complexity of procedure p
  • 18. • C d d Gl (1990) d l Card and Glass (1990) developed a system complexity model d t l it d l Ct – System Complexity St – Structural (intermodule) System Complexity, S Structural (intermodule)  complexity, Dt – Data (intermodule) complexity • They defined relative system complexity as n – no. Of modules in the system • S Structure complexity is further defined as l i i f h d fi d S= ∑ f 2 (i ) n Where S – Structural Complexity, f(i) – Fan‐out of Module i,       n – no. Of modules in the system
  • 19. • D t C Data Complexity is further defined as l it i f th d fi d Di  Data Complexity of Module i, V(i)  I/O  Di – Data Complexity of Module i, V(i) – I/O Variables in module i, f(i) – fan‐out of module i D – Data (intramodule) Complexity, D(i) – Data  Complexity of module i, n = Number of new  modules in the system