SlideShare a Scribd company logo
1 of 22
Applicability of Three
Cognitive Complexity
Metrics
Arvin Foroutan
Stan Pastukhov
Software Complexity
Can be the execution time required to
perform a computation
Or maybe the level of difficulty of tasks such
as coding, debugging, testing or modifying
software
Cognitive Complexity
The human effort needed to perform a task
Or the difficulty in understanding the
software
Why is this important?
Unlike new software development,
maintaining and expanding existing code is
extremely difficult
Prone to cost overruns, delays, and defects
Cognitive Weight
The degree of difficulty or relative time and
effort for comprehending a given piece of
software
Modeled by a number of basic control
structures (BCS)
Sequential, Branch, Iteration,
Recursion and Parallel
The Big 3: Which is best?
Cognitive Weight Complexity Measure (CWCM)
Cognitive Functional Size (CFS)
Cognitive Information Complexity Measure (CICM)
Cognitive Weight Complexity Measure
(CWCM)
Considers only the cognitive weights (Wc) of
the basic control structures of the software
Language independent
Simple and easy to calculate
Gives the complexity in small numbers
Bubble Sort - CWCM Metric
CWCM = Wc
Where:
Wc = Total cognitive weight of software
BCS (iteration) W1 = 3
BCS (iteration) W2 = 3
BCS (branch) W3 = 2
BCS (branch) W4= 2
Wc = 3(3(2)) + 2) = 24
Cognitive Functional Size (CFS)
Based on cognitive weights of basic control
structures and number of inputs and outputs
Easy to calculate
Does not rely on the implementation
technologies
Uses sound principles
Bubble Sort - CFS metric
CFS = (No + Ni) * Wc
Where:
No = Number of outputs
Ni = Number of inputs
Wc = Sum of cognitive weights of linear blocks
CFS = (0 + 1) * 24 = 24
Cognitive Information Complexity Metric
(CICM)
Calculated by getting the product of cognitive
weight (Wc) of the basic control structures
and the weighted information count (WICS)
Dependent on the internal architecture of
the software
Slightly more difficult to calculate
Gives complexity in larger numbers
Bubble Sort - CICM Metric
CICM = WICS * Wc
Where:
WlCS = Sum of weighted information count
of all the lines in the software
Wc = Total cognitive weight of software
WlCS = 2/19 + 2/18 + 2/17 + 1/16 + 7/15
+ 1/14 + 8/13 + 5/12 + 3/11+ 5/10 + 4/9 +
1/8 + 0 + 0 + 2/5 + 0 + 0 + 0 + 0 + 0
WlCS = 3.71
Wc = 24
CICM = 3.71 * 24 = 89.04
Objective
To study the relationship between the three
cognitive complexity metrics and to find out
which is the best metric to be used in the real
world
What did they measure?
Ten different programs were tested
All written in Java
None were similar to each other
Programs To Be Measured
Blink.java
BubbleSort.java
Class2.java
CoalescedChainingApp.java
CollisionExperiment.java
FactMain.java
FibonacciMain.java
JumpingBox.java
LauncherThread.java
ListStack.java
Survey
To get an expert opinion of the complexities
of each program:
30 software developers with 5+ years experience from
five leading IT organizations in Sri Lanka
Each ranked the programs on a scale between 1-10
1 being the least complex
10 being the most complex
All other programs fall in between
CFS Values For The 10 Programs
Program CFS
Blink.java 22
Bubblesort.java 84
Class2.java 10
CoalescedChainingApp.java 171
CollisionExperiment.java 92
FactMain.java 12
FibonacciMain.java 18
JumpingBox 270
LauncherThread.java 24
ListStack.java 75
CWCM Values For The 10 Programs
Program CWCM
Blink.java 22
Bubblesort.java 69
Class2.java 10
CoalescedChainingApp.java 57
CollisionExperiment.java 23
FactMain.java 12
FibonacciMain.java 18
JumpingBox 45
LauncherThread.java 6
ListStack.java 25
CICM Values For The 10 Programs
Program CICM
Blink.java 122.54
Bubblesort.java 311.88
Class2.java 36.41
CoalescedChainingApp.java 326.61
CollisionExperiment.java 115.46
FactMain.java 42.24
FibonacciMain.java 73.62
JumpingBox 170.55
LauncherThread.java 32.22
ListStack.java 43.5
Conclusion
CWCM had the lowest correlation (0.503)
CICM had the second lowest correlation (0.588)
CFS had the highest correlation (0.903)
Based off these results, CFS is the most
suitable cognitive complexity metric to be
used in the real world
The End
Questions, comments, suggestions?

More Related Content

Viewers also liked

Human Head Museum for Children
Human Head Museum for ChildrenHuman Head Museum for Children
Human Head Museum for Children
Galala University
 

Viewers also liked (10)

Revised bser vice
Revised bser viceRevised bser vice
Revised bser vice
 
VR, AI & The Future of Mobile
VR, AI & The Future of Mobile VR, AI & The Future of Mobile
VR, AI & The Future of Mobile
 
The Nubian Experience: A study of the Social and Cultural Meanings of Archite...
The Nubian Experience: A study of the Social and Cultural Meanings of Archite...The Nubian Experience: A study of the Social and Cultural Meanings of Archite...
The Nubian Experience: A study of the Social and Cultural Meanings of Archite...
 
How to make money with ClickBank without a website
How to make money with ClickBank without a websiteHow to make money with ClickBank without a website
How to make money with ClickBank without a website
 
Human Head Museum for Children
Human Head Museum for ChildrenHuman Head Museum for Children
Human Head Museum for Children
 
Recycle 4 Change
Recycle 4 ChangeRecycle 4 Change
Recycle 4 Change
 
Brutalism Architecture (EXPLORING VERSATALITY OF R.C.C.)
Brutalism Architecture (EXPLORING VERSATALITY OF R.C.C.)Brutalism Architecture (EXPLORING VERSATALITY OF R.C.C.)
Brutalism Architecture (EXPLORING VERSATALITY OF R.C.C.)
 
Research Methods in Architecture - Literature Review - البحث المعمارى - البحث...
Research Methods in Architecture - Literature Review - البحث المعمارى - البحث...Research Methods in Architecture - Literature Review - البحث المعمارى - البحث...
Research Methods in Architecture - Literature Review - البحث المعمارى - البحث...
 
Disability and Smart Cities
Disability and Smart CitiesDisability and Smart Cities
Disability and Smart Cities
 
Module ii continued
Module ii continuedModule ii continued
Module ii continued
 

Similar to COMP589 (1)

Software engineering
Software engineeringSoftware engineering
Software engineering
Fahe Em
 
Software engineering
Software engineeringSoftware engineering
Software engineering
Fahe Em
 
Transaction Based Verification Methodology - 2000
Transaction Based Verification Methodology - 2000Transaction Based Verification Methodology - 2000
Transaction Based Verification Methodology - 2000
Steve Cox
 
Avoiding Software Insanity
Avoiding Software InsanityAvoiding Software Insanity
Avoiding Software Insanity
josephnaveen
 

Similar to COMP589 (1) (20)

nullcon 2010 - Tracking the progress of an SDL program: lessons from the gym
nullcon 2010 - Tracking the progress of an SDL program: lessons from the gymnullcon 2010 - Tracking the progress of an SDL program: lessons from the gym
nullcon 2010 - Tracking the progress of an SDL program: lessons from the gym
 
OOAD - Ch.09 - Software Project Estimation.pptx
OOAD - Ch.09 - Software Project Estimation.pptxOOAD - Ch.09 - Software Project Estimation.pptx
OOAD - Ch.09 - Software Project Estimation.pptx
 
Software engineering
Software engineeringSoftware engineering
Software engineering
 
Software engineering
Software engineeringSoftware engineering
Software engineering
 
Review and comparison of tasks scheduling in cloud computing
Review and comparison of tasks scheduling in cloud computingReview and comparison of tasks scheduling in cloud computing
Review and comparison of tasks scheduling in cloud computing
 
cost-estimation-tutorial
cost-estimation-tutorialcost-estimation-tutorial
cost-estimation-tutorial
 
Scalable constrained spectral clustering
Scalable constrained spectral clusteringScalable constrained spectral clustering
Scalable constrained spectral clustering
 
Review and Comparison of Tasks Scheduling in Cloud Computing
Review and Comparison of Tasks Scheduling in Cloud Computing   Review and Comparison of Tasks Scheduling in Cloud Computing
Review and Comparison of Tasks Scheduling in Cloud Computing
 
Tracking the Progress of an SDL Program: Lessons from the Gym
Tracking the Progress of an SDL Program: Lessons from the GymTracking the Progress of an SDL Program: Lessons from the Gym
Tracking the Progress of an SDL Program: Lessons from the Gym
 
Computer Literacy Lesson 06
Computer Literacy Lesson 06Computer Literacy Lesson 06
Computer Literacy Lesson 06
 
Software effort estimation through clustering techniques of RBFN network
Software effort estimation through clustering techniques of RBFN networkSoftware effort estimation through clustering techniques of RBFN network
Software effort estimation through clustering techniques of RBFN network
 
Transaction Based Verification Methodology - 2000
Transaction Based Verification Methodology - 2000Transaction Based Verification Methodology - 2000
Transaction Based Verification Methodology - 2000
 
SE2023 0301 Software Project Management.pptx
SE2023 0301 Software Project Management.pptxSE2023 0301 Software Project Management.pptx
SE2023 0301 Software Project Management.pptx
 
Lo 09
Lo 09Lo 09
Lo 09
 
Exp 02-COCOMO (1).pptx
Exp 02-COCOMO (1).pptxExp 02-COCOMO (1).pptx
Exp 02-COCOMO (1).pptx
 
Lesson02 - Network Design & LAN
Lesson02 - Network Design & LANLesson02 - Network Design & LAN
Lesson02 - Network Design & LAN
 
Recognize, assess, reduce, and manage technical debt
Recognize, assess, reduce, and manage technical debtRecognize, assess, reduce, and manage technical debt
Recognize, assess, reduce, and manage technical debt
 
Avoiding Software Insanity
Avoiding Software InsanityAvoiding Software Insanity
Avoiding Software Insanity
 
Specification-based Verification of Incomplete Programs
Specification-based Verification of Incomplete ProgramsSpecification-based Verification of Incomplete Programs
Specification-based Verification of Incomplete Programs
 
Desktop Management Using Microsoft SCCM
Desktop Management Using Microsoft SCCMDesktop Management Using Microsoft SCCM
Desktop Management Using Microsoft SCCM
 

COMP589 (1)

  • 1. Applicability of Three Cognitive Complexity Metrics Arvin Foroutan Stan Pastukhov
  • 2. Software Complexity Can be the execution time required to perform a computation Or maybe the level of difficulty of tasks such as coding, debugging, testing or modifying software
  • 3. Cognitive Complexity The human effort needed to perform a task Or the difficulty in understanding the software
  • 4. Why is this important? Unlike new software development, maintaining and expanding existing code is extremely difficult Prone to cost overruns, delays, and defects
  • 5. Cognitive Weight The degree of difficulty or relative time and effort for comprehending a given piece of software Modeled by a number of basic control structures (BCS) Sequential, Branch, Iteration, Recursion and Parallel
  • 6. The Big 3: Which is best? Cognitive Weight Complexity Measure (CWCM) Cognitive Functional Size (CFS) Cognitive Information Complexity Measure (CICM)
  • 7. Cognitive Weight Complexity Measure (CWCM) Considers only the cognitive weights (Wc) of the basic control structures of the software Language independent Simple and easy to calculate Gives the complexity in small numbers
  • 8. Bubble Sort - CWCM Metric CWCM = Wc Where: Wc = Total cognitive weight of software BCS (iteration) W1 = 3 BCS (iteration) W2 = 3 BCS (branch) W3 = 2 BCS (branch) W4= 2 Wc = 3(3(2)) + 2) = 24
  • 9. Cognitive Functional Size (CFS) Based on cognitive weights of basic control structures and number of inputs and outputs Easy to calculate Does not rely on the implementation technologies Uses sound principles
  • 10. Bubble Sort - CFS metric CFS = (No + Ni) * Wc Where: No = Number of outputs Ni = Number of inputs Wc = Sum of cognitive weights of linear blocks CFS = (0 + 1) * 24 = 24
  • 11. Cognitive Information Complexity Metric (CICM) Calculated by getting the product of cognitive weight (Wc) of the basic control structures and the weighted information count (WICS) Dependent on the internal architecture of the software Slightly more difficult to calculate Gives complexity in larger numbers
  • 12. Bubble Sort - CICM Metric CICM = WICS * Wc Where: WlCS = Sum of weighted information count of all the lines in the software Wc = Total cognitive weight of software WlCS = 2/19 + 2/18 + 2/17 + 1/16 + 7/15 + 1/14 + 8/13 + 5/12 + 3/11+ 5/10 + 4/9 + 1/8 + 0 + 0 + 2/5 + 0 + 0 + 0 + 0 + 0 WlCS = 3.71 Wc = 24 CICM = 3.71 * 24 = 89.04
  • 13. Objective To study the relationship between the three cognitive complexity metrics and to find out which is the best metric to be used in the real world
  • 14. What did they measure? Ten different programs were tested All written in Java None were similar to each other
  • 15. Programs To Be Measured Blink.java BubbleSort.java Class2.java CoalescedChainingApp.java CollisionExperiment.java FactMain.java FibonacciMain.java JumpingBox.java LauncherThread.java ListStack.java
  • 16. Survey To get an expert opinion of the complexities of each program: 30 software developers with 5+ years experience from five leading IT organizations in Sri Lanka Each ranked the programs on a scale between 1-10 1 being the least complex 10 being the most complex All other programs fall in between
  • 17. CFS Values For The 10 Programs Program CFS Blink.java 22 Bubblesort.java 84 Class2.java 10 CoalescedChainingApp.java 171 CollisionExperiment.java 92 FactMain.java 12 FibonacciMain.java 18 JumpingBox 270 LauncherThread.java 24 ListStack.java 75
  • 18. CWCM Values For The 10 Programs Program CWCM Blink.java 22 Bubblesort.java 69 Class2.java 10 CoalescedChainingApp.java 57 CollisionExperiment.java 23 FactMain.java 12 FibonacciMain.java 18 JumpingBox 45 LauncherThread.java 6 ListStack.java 25
  • 19. CICM Values For The 10 Programs Program CICM Blink.java 122.54 Bubblesort.java 311.88 Class2.java 36.41 CoalescedChainingApp.java 326.61 CollisionExperiment.java 115.46 FactMain.java 42.24 FibonacciMain.java 73.62 JumpingBox 170.55 LauncherThread.java 32.22 ListStack.java 43.5
  • 20.
  • 21. Conclusion CWCM had the lowest correlation (0.503) CICM had the second lowest correlation (0.588) CFS had the highest correlation (0.903) Based off these results, CFS is the most suitable cognitive complexity metric to be used in the real world