SlideShare a Scribd company logo
Software Quality Assessment Practices
Presented By : Moutasm Tamimi , 2018
Outline: Metrics on application
• Lines of Code (LOC)
• Lines of Comments
• Percentage Comment
• Number of IL Instructions
• Number of Assemblies
• Number of Namespaces
• Number of Types Number of Methods
• Number of Fields
• Number of Parameters
• Number of Variables
• Efferent coupling (Ce)
• Afferent coupling (Ca)
• Instability (I)
• Abstractness
• Cohesion metrics
• Relational Cohesion (H)
• Depth of inheritance tree (DIT)
• Number of children (NOC)
• Association between classes (ABC)
• Cyclomatic complexity (CC)
Presented By : Moutasm Tamimi , 2018
Software metric
A software metric is a standard of measure
of a degree to which a software system or
process possesses some property.
Presented By : Moutasm Tamimi , 2018
Lines of Code (LOC)
Metrics type description Example
Lines of Code (LOC) Physical Line of Code (LOC)=4
Logical Lines of Code (LLOC)=2
for (i = 0; i < 100; i++)
{
printf("hello");
}
Recommendations
1. Methods where NbLinesOfCode is higher than 20 are hard to understand and maintain
2. Methods where NbLinesOfCode is higher than 40 are extremely complex and should be split in
smaller methods
Presented By : Moutasm Tamimi , 2018
Lines of Comments
Metrics type Description Example
Lines of Comments a comment is a programmer-readable
explanation or annotation in the source code
of a computer program. They are added with
the purpose of making the source code easier
for humans to understand, and are generally
ignored by compilers and interpreters.
/* welcome to the system
…..
*/
Percentage Comment 100 * NbLinesOfComment / (
NbLinesOfComment + NbLinesOfCode)
NbLinesOfComment =10
NbLinesOfCode=50
Percentage Comment =
100*10/(10+50)= 16.6
Recommendations
This metric is not helpful to assess the quality of source code
Presented By : Moutasm Tamimi , 2018
Number of Intermediate language Instructions
Metrics type Description Example
Nb IL Instructions Intermediate language. Code exists on
many levels. Abstraction is a ladder. At the
highest levels of abstraction, we have C#
code. At a lower level, we have an
intermediate language.
Instructions. The IL has instructions
(opcodes - operation code) that manipulate
the stack. These instructions, called
intermediate language opcodes, reside in a
relational database called the metadata
Recommendations
NbILInstructions is higher than 100 are hard to understand and maintain.
Methods where NbILInstructions is higher than 200 are extremely complex and should be split in smaller methods
Presented By : Moutasm Tamimi , 2018
Assemblies, Namespace, Type, Method, Field
Metrics type Description Example
NbAssemblies Defined for application
An assembly provides a fundamental unit of physical code
grouping.
(Security, Type Identity
Reference Scope, Versioning
Deployment)
System.Windows.Forms.dll
assembly
NbNamespaces Defined for application, assemblies
A namespace provides a fundamental unit of logical code
grouping.
class library packages
NbTypes An abstract or a concrete class, a structure, an enumeration, a
delegate class or an interface.
Classes
NbMethods A method can be an abstract, virtual or non-virtual method, a
method declared in an interface, a constructor, a class
constructor, a finalizer, a property/indexer getter or setter, an
event adder or remover
Methods
Recommendations
NbMethods > 20 might be hard to understand and maintain but there might be cases where it is relevant to have a high value
for NbMethods
NbFields field can be a regular field, an enumeration's value or a read-
only or a const field
Int x;
Example
Presented By : Moutasm Tamimi , 2018
Package infrastructure
Presented By : Moutasm Tamimi , 2018
Outline: Metrics on application
• Lines of Code (LOC)
• Lines of Comments
• Percentage Comment
• Number of IL Instructions
• Number of Assemblies
• Number of Namespaces
• Number of Types Number of Methods
• Number of Fields
• Number of Parameters
• Number of Variables
• Efferent coupling (Ce)
• Afferent coupling (Ca)
• Instability (I)
• Abstractness
• Cohesion metrics
• Relational Cohesion (H)
• Depth of inheritance tree (DIT)
• Number of children (NOC)
• Association between classes (ABC)
• Cyclomatic complexity (CC)
Presented By : Moutasm Tamimi , 2018
Coupling
• The degree of interdependence between software modules; a
measure of how closely connected two routines or modules are; the
strength of the relationships between modules.
Presented By : Moutasm Tamimi , 2018
Coupling
• Tight coupling (high coupling) A module has many relations with
many other modules, less maintainability
• Loose coupling (low coupling) A module has fewer relationships with
other modules.
low coupling is better situation
• maintainability – changes are confined in a single module
• testability – modules involved in unit testing can be limited to a minimum
• readability – classes that need to be analyzed are kept at a minimum
• Understand one class without reading others
• Change one class without affecting others
Presented By : Moutasm Tamimi , 2018
Efferent coupling (Ce)
Efferent coupling (Ce) of types within this package
that depend on types outside this package.
Ex It measures the number of data types
Ex Outgoing Dependencies or the Number of Types
inside a Package that Depend on Types of other
Packages
A large efferent coupling can indicate that a
package is unfocussed and may also indicate that it
is unstable since it depends on the stability of all
the types to which it is coupled
Presented By : Moutasm Tamimi , 2018
Afferent coupling (Ca)
• Number of types outside this package that depend on types within
this package.
Presented By : Moutasm Tamimi , 2018
Instability (I)
• This metric is used to measure the relative susceptibility of class to
changes. According to the definition instability is the ration of
outgoing dependencies to all package dependencies and it accepts
value from 0 to 1.
• I=0 indicates a completely stable package, painful to modify.
• I=1 indicates a completely instable package.
Presented By : Moutasm Tamimi , 2018
Abstractness
• Abstractness (A): ratio of the number of internal abstract types to the
number of internal types.
• A=0 indicates a completely concrete package.
• A=1 indicates a completely abstract package
Presented By : Moutasm Tamimi , 2018
Cohesion metrics
• Cohesion metrics measure how well the methods of a class are related to
each other. A cohesive class performs one function. A non-cohesive class
performs two or more unrelated functions. A non-cohesive class may need
to be restructured into two or more smaller classes.
• Relational Cohesion (H): average number of internal relationships per
type:
• H = (R + 1) / N,
R = number of type relationships internal to the package,
N = number of types in the package.
• Classes inside an assembly should be strongly related, the cohesion should
be high. On the other hand, too high values may indicate over-coupling. A
good range is 1.5 ≤ H ≤ 4.0
Presented By : Moutasm Tamimi , 2018
Cohesion metrics
• Low Cohesion: Functionalities of a module are independent of each
other.
• High Cohesion: Functionalities of a module are strongly related.
- High cohesion is better situation.
• Readability – (closely) related functions are contained in a single module
• Maintainability – debugging tends to be contained in a single module
• Reusability – classes that have concentrated functionalities are not polluted
with useless functions
• Understand what a class or method does
• Use descriptive names
Presented By : Moutasm Tamimi , 2018
Cohesion and coupling
Presented By : Moutasm Tamimi , 2018
Example
Presented By : Moutasm Tamimi , 2018
Inheritance
• Depth of inheritance tree (DIT) for a class or a structure is its number
of base classes (including System.Object thus DIT ≥ 1).
Types where DIT > 6 might be hard to maintain.
Not a rule since sometime classes inherit from tier classes which have a high
DIT.
E.g., the average depth of inheritance for framework classes which derive from
System.Windows.Forms.Control is 5.3
• Number of children: (NOC) for a class is the number of types that
subclass it directly or indirectly. Number of children for an interface is
the number of types that implement it.
Presented By : Moutasm Tamimi , 2018
Example
Presented By : Moutasm Tamimi , 2018
lack of cohesion of methods
• The single responsibility principle states that
a class should not have more than one
reason to change.
• A high LCOM value generally pinpoints a
poorly cohesive class.
• Types where LCOM > 0.8 and |F| > 10 and
|M| >10 might be problematic. However, it is
very hard to avoid such non-cohesive types
Presented By : Moutasm Tamimi , 2018
Association between classes (ABC)
• The association between classes (ABC) is the number of members of
others types that a class directly uses in its the body of its methods.
Presented By : Moutasm Tamimi , 2018
Cyclomatic complexity (CC)
• Cyclomatic Complexity (CC) Number of these expressions in the
method body
• “if, while, for, foreach, case, default, continue, goto, &&, ||, catch, ?
: (ternary operator), ?? (nonnull operator)”
• These expressions are not counted:
• “else, do, switch, try, using, throw, finally, return, object creation,
method call, field access”
• CC > 15 are hard to understand, CC > 30 are extremely complex and
should be split into smaller methods (unless generated code)
Presented By : Moutasm Tamimi , 2018
IL Cyclomatic Complexity (ILCC)
• ILCC: Number of distinct code offsets targeted by jump/branch IL
instructions. Language independent.
• ILCC is generally larger than CC.
• ILCC( if ) = 1
• ILCC( for ) = 2
• ILCC( foreach ) = 3
• ILCC > 20 are hard to understand, ILCC > 40 are extremely complex and
should be split into smaller methods (unless generated code)
Presented By : Moutasm Tamimi , 2018
Thank you
• https://www.slideshare.net/moutasmtamimi/
“Keep in update content”
Speaker Information
 Moutasm tamimi
 Masters of Software Engineering
 Independent Consultant , IT Researcher.
 CEO at ITG7.com , IT-CRG.com
 Email: tamimi@itg7.com
Click Here
Click HereI T G 7
Click Here
Click HereIT-CRG

More Related Content

Similar to Software Quality Assessment Practices

C++ Basics
C++ BasicsC++ Basics
C++ Basics
Himanshu Sharma
 
C STANDARDS (C17).pptx
C STANDARDS (C17).pptxC STANDARDS (C17).pptx
C STANDARDS (C17).pptx
SKUP1
 
C STANDARDS (C17) (1).pptx
C STANDARDS (C17) (1).pptxC STANDARDS (C17) (1).pptx
C STANDARDS (C17) (1).pptx
SKUP ACADEMY
 
C STANDARDS (C17) (1).pptx
C STANDARDS (C17) (1).pptxC STANDARDS (C17) (1).pptx
C STANDARDS (C17) (1).pptx
SKUP ACADEMY
 
C STANDARDS (C17).pptx
C STANDARDS (C17).pptxC STANDARDS (C17).pptx
C STANDARDS (C17).pptx
LECO9
 
What To Leave Implicit
What To Leave ImplicitWhat To Leave Implicit
What To Leave Implicit
Martin Odersky
 
Understanding software metrics
Understanding software metricsUnderstanding software metrics
Understanding software metrics
Tushar Sharma
 
Programming with C++
Programming with C++Programming with C++
Programming with C++
ssuser802d47
 
Generics Module 2Generics Module Generics Module 2.pptx
Generics Module 2Generics Module Generics Module 2.pptxGenerics Module 2Generics Module Generics Module 2.pptx
Generics Module 2Generics Module Generics Module 2.pptx
AlvasCSE
 
Effective Software Design
Effective Software Design Effective Software Design
Effective Software Design
Darshan Ashpal
 
Intro to Data Structure & Algorithms
Intro to Data Structure & AlgorithmsIntro to Data Structure & Algorithms
Intro to Data Structure & Algorithms
Akhil Kaushik
 
Rust presentation convergeconf
Rust presentation convergeconfRust presentation convergeconf
Rust presentation convergeconf
Krishna Kumar Thokala
 
Software Measurement: Lecture 1. Measures and Metrics
Software Measurement: Lecture 1. Measures and MetricsSoftware Measurement: Lecture 1. Measures and Metrics
Software Measurement: Lecture 1. Measures and Metrics
Programeter
 
Generics
GenericsGenerics
algo 1.ppt
algo 1.pptalgo 1.ppt
algo 1.ppt
example43
 
Introduction
IntroductionIntroduction
Introduction
Mohamed Diallo
 
OOM Unit I - III.pdf
OOM Unit I - III.pdfOOM Unit I - III.pdf
OOM Unit I - III.pdf
ShaikRafikhan1
 
Grasp principles
Grasp principlesGrasp principles
Grasp principles
Yuriy Shapovalov
 
The Dark Side of Code Metrics
The Dark Side of Code MetricsThe Dark Side of Code Metrics
The Dark Side of Code Metrics
Donald Belcham
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and Repair
Lionel Briand
 

Similar to Software Quality Assessment Practices (20)

C++ Basics
C++ BasicsC++ Basics
C++ Basics
 
C STANDARDS (C17).pptx
C STANDARDS (C17).pptxC STANDARDS (C17).pptx
C STANDARDS (C17).pptx
 
C STANDARDS (C17) (1).pptx
C STANDARDS (C17) (1).pptxC STANDARDS (C17) (1).pptx
C STANDARDS (C17) (1).pptx
 
C STANDARDS (C17) (1).pptx
C STANDARDS (C17) (1).pptxC STANDARDS (C17) (1).pptx
C STANDARDS (C17) (1).pptx
 
C STANDARDS (C17).pptx
C STANDARDS (C17).pptxC STANDARDS (C17).pptx
C STANDARDS (C17).pptx
 
What To Leave Implicit
What To Leave ImplicitWhat To Leave Implicit
What To Leave Implicit
 
Understanding software metrics
Understanding software metricsUnderstanding software metrics
Understanding software metrics
 
Programming with C++
Programming with C++Programming with C++
Programming with C++
 
Generics Module 2Generics Module Generics Module 2.pptx
Generics Module 2Generics Module Generics Module 2.pptxGenerics Module 2Generics Module Generics Module 2.pptx
Generics Module 2Generics Module Generics Module 2.pptx
 
Effective Software Design
Effective Software Design Effective Software Design
Effective Software Design
 
Intro to Data Structure & Algorithms
Intro to Data Structure & AlgorithmsIntro to Data Structure & Algorithms
Intro to Data Structure & Algorithms
 
Rust presentation convergeconf
Rust presentation convergeconfRust presentation convergeconf
Rust presentation convergeconf
 
Software Measurement: Lecture 1. Measures and Metrics
Software Measurement: Lecture 1. Measures and MetricsSoftware Measurement: Lecture 1. Measures and Metrics
Software Measurement: Lecture 1. Measures and Metrics
 
Generics
GenericsGenerics
Generics
 
algo 1.ppt
algo 1.pptalgo 1.ppt
algo 1.ppt
 
Introduction
IntroductionIntroduction
Introduction
 
OOM Unit I - III.pdf
OOM Unit I - III.pdfOOM Unit I - III.pdf
OOM Unit I - III.pdf
 
Grasp principles
Grasp principlesGrasp principles
Grasp principles
 
The Dark Side of Code Metrics
The Dark Side of Code MetricsThe Dark Side of Code Metrics
The Dark Side of Code Metrics
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and Repair
 

More from Moutasm Tamimi

Reengineering PDF-Based Documents Targeting Complex Software Specifications
Reengineering PDF-Based Documents Targeting Complex Software SpecificationsReengineering PDF-Based Documents Targeting Complex Software Specifications
Reengineering PDF-Based Documents Targeting Complex Software Specifications
Moutasm Tamimi
 
Software Evolution and Maintenance Models
Software Evolution and Maintenance ModelsSoftware Evolution and Maintenance Models
Software Evolution and Maintenance Models
Moutasm Tamimi
 
Software evolution and maintenance basic concepts and preliminaries
Software evolution and maintenance   basic concepts and preliminariesSoftware evolution and maintenance   basic concepts and preliminaries
Software evolution and maintenance basic concepts and preliminaries
Moutasm Tamimi
 
An integrated security testing framework and tool
An integrated security testing framework  and toolAn integrated security testing framework  and tool
An integrated security testing framework and tool
Moutasm Tamimi
 
Critical Success Factors along ERP life-cycle in Small medium enterprises
Critical Success Factors along ERP life-cycle in Small medium enterprises Critical Success Factors along ERP life-cycle in Small medium enterprises
Critical Success Factors along ERP life-cycle in Small medium enterprises
Moutasm Tamimi
 
Critical Success Factors (CSFs) In International ERP Implementations with que...
Critical Success Factors (CSFs) In International ERP Implementations with que...Critical Success Factors (CSFs) In International ERP Implementations with que...
Critical Success Factors (CSFs) In International ERP Implementations with que...
Moutasm Tamimi
 
Best Practices For Business Analyst - Part 3
Best Practices For Business Analyst - Part 3Best Practices For Business Analyst - Part 3
Best Practices For Business Analyst - Part 3
Moutasm Tamimi
 
Concepts Of business analyst Practices - Part 1
Concepts Of business analyst Practices - Part 1Concepts Of business analyst Practices - Part 1
Concepts Of business analyst Practices - Part 1
Moutasm Tamimi
 
Recovery in Multi database Systems
Recovery in Multi database SystemsRecovery in Multi database Systems
Recovery in Multi database Systems
Moutasm Tamimi
 
Software Quality Models: A Comparative Study paper
Software Quality Models: A Comparative Study  paperSoftware Quality Models: A Comparative Study  paper
Software Quality Models: A Comparative Study paper
Moutasm Tamimi
 
ISO 29110 Software Quality Model For Software SMEs
ISO 29110 Software Quality Model For Software SMEsISO 29110 Software Quality Model For Software SMEs
ISO 29110 Software Quality Model For Software SMEs
Moutasm Tamimi
 
Windows form application - C# Training
Windows form application - C# Training Windows form application - C# Training
Windows form application - C# Training
Moutasm Tamimi
 
Asp.net Programming Training (Web design, Web development)
Asp.net Programming Training (Web design, Web  development)Asp.net Programming Training (Web design, Web  development)
Asp.net Programming Training (Web design, Web development)
Moutasm Tamimi
 
Database Management System - SQL Advanced Training
Database Management System - SQL Advanced TrainingDatabase Management System - SQL Advanced Training
Database Management System - SQL Advanced Training
Moutasm Tamimi
 
Database Management System - SQL beginner Training
Database Management System - SQL beginner Training Database Management System - SQL beginner Training
Database Management System - SQL beginner Training
Moutasm Tamimi
 
Measurement and Quality in Object-Oriented Design
Measurement and Quality in Object-Oriented DesignMeasurement and Quality in Object-Oriented Design
Measurement and Quality in Object-Oriented Design
Moutasm Tamimi
 
SQL Injection and Clickjacking Attack in Web security
SQL Injection and Clickjacking Attack in Web securitySQL Injection and Clickjacking Attack in Web security
SQL Injection and Clickjacking Attack in Web security
Moutasm Tamimi
 

More from Moutasm Tamimi (17)

Reengineering PDF-Based Documents Targeting Complex Software Specifications
Reengineering PDF-Based Documents Targeting Complex Software SpecificationsReengineering PDF-Based Documents Targeting Complex Software Specifications
Reengineering PDF-Based Documents Targeting Complex Software Specifications
 
Software Evolution and Maintenance Models
Software Evolution and Maintenance ModelsSoftware Evolution and Maintenance Models
Software Evolution and Maintenance Models
 
Software evolution and maintenance basic concepts and preliminaries
Software evolution and maintenance   basic concepts and preliminariesSoftware evolution and maintenance   basic concepts and preliminaries
Software evolution and maintenance basic concepts and preliminaries
 
An integrated security testing framework and tool
An integrated security testing framework  and toolAn integrated security testing framework  and tool
An integrated security testing framework and tool
 
Critical Success Factors along ERP life-cycle in Small medium enterprises
Critical Success Factors along ERP life-cycle in Small medium enterprises Critical Success Factors along ERP life-cycle in Small medium enterprises
Critical Success Factors along ERP life-cycle in Small medium enterprises
 
Critical Success Factors (CSFs) In International ERP Implementations with que...
Critical Success Factors (CSFs) In International ERP Implementations with que...Critical Success Factors (CSFs) In International ERP Implementations with que...
Critical Success Factors (CSFs) In International ERP Implementations with que...
 
Best Practices For Business Analyst - Part 3
Best Practices For Business Analyst - Part 3Best Practices For Business Analyst - Part 3
Best Practices For Business Analyst - Part 3
 
Concepts Of business analyst Practices - Part 1
Concepts Of business analyst Practices - Part 1Concepts Of business analyst Practices - Part 1
Concepts Of business analyst Practices - Part 1
 
Recovery in Multi database Systems
Recovery in Multi database SystemsRecovery in Multi database Systems
Recovery in Multi database Systems
 
Software Quality Models: A Comparative Study paper
Software Quality Models: A Comparative Study  paperSoftware Quality Models: A Comparative Study  paper
Software Quality Models: A Comparative Study paper
 
ISO 29110 Software Quality Model For Software SMEs
ISO 29110 Software Quality Model For Software SMEsISO 29110 Software Quality Model For Software SMEs
ISO 29110 Software Quality Model For Software SMEs
 
Windows form application - C# Training
Windows form application - C# Training Windows form application - C# Training
Windows form application - C# Training
 
Asp.net Programming Training (Web design, Web development)
Asp.net Programming Training (Web design, Web  development)Asp.net Programming Training (Web design, Web  development)
Asp.net Programming Training (Web design, Web development)
 
Database Management System - SQL Advanced Training
Database Management System - SQL Advanced TrainingDatabase Management System - SQL Advanced Training
Database Management System - SQL Advanced Training
 
Database Management System - SQL beginner Training
Database Management System - SQL beginner Training Database Management System - SQL beginner Training
Database Management System - SQL beginner Training
 
Measurement and Quality in Object-Oriented Design
Measurement and Quality in Object-Oriented DesignMeasurement and Quality in Object-Oriented Design
Measurement and Quality in Object-Oriented Design
 
SQL Injection and Clickjacking Attack in Web security
SQL Injection and Clickjacking Attack in Web securitySQL Injection and Clickjacking Attack in Web security
SQL Injection and Clickjacking Attack in Web security
 

Recently uploaded

AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
Green Software Development
 
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfRevolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Undress Baby
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
Hornet Dynamics
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
ICS
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
What is Augmented Reality Image Tracking
What is Augmented Reality Image TrackingWhat is Augmented Reality Image Tracking
What is Augmented Reality Image Tracking
pavan998932
 
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise EditionWhy Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Envertis Software Solutions
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
Sven Peters
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
 
SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
Yara Milbes
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
Rakesh Kumar R
 
What is Master Data Management by PiLog Group
What is Master Data Management by PiLog GroupWhat is Master Data Management by PiLog Group
What is Master Data Management by PiLog Group
aymanquadri279
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
Remote DBA Services
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 

Recently uploaded (20)

AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
 
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfRevolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
What is Augmented Reality Image Tracking
What is Augmented Reality Image TrackingWhat is Augmented Reality Image Tracking
What is Augmented Reality Image Tracking
 
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise EditionWhy Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
 
SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
 
What is Master Data Management by PiLog Group
What is Master Data Management by PiLog GroupWhat is Master Data Management by PiLog Group
What is Master Data Management by PiLog Group
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 

Software Quality Assessment Practices

  • 1. Software Quality Assessment Practices Presented By : Moutasm Tamimi , 2018
  • 2. Outline: Metrics on application • Lines of Code (LOC) • Lines of Comments • Percentage Comment • Number of IL Instructions • Number of Assemblies • Number of Namespaces • Number of Types Number of Methods • Number of Fields • Number of Parameters • Number of Variables • Efferent coupling (Ce) • Afferent coupling (Ca) • Instability (I) • Abstractness • Cohesion metrics • Relational Cohesion (H) • Depth of inheritance tree (DIT) • Number of children (NOC) • Association between classes (ABC) • Cyclomatic complexity (CC) Presented By : Moutasm Tamimi , 2018
  • 3. Software metric A software metric is a standard of measure of a degree to which a software system or process possesses some property. Presented By : Moutasm Tamimi , 2018
  • 4. Lines of Code (LOC) Metrics type description Example Lines of Code (LOC) Physical Line of Code (LOC)=4 Logical Lines of Code (LLOC)=2 for (i = 0; i < 100; i++) { printf("hello"); } Recommendations 1. Methods where NbLinesOfCode is higher than 20 are hard to understand and maintain 2. Methods where NbLinesOfCode is higher than 40 are extremely complex and should be split in smaller methods Presented By : Moutasm Tamimi , 2018
  • 5. Lines of Comments Metrics type Description Example Lines of Comments a comment is a programmer-readable explanation or annotation in the source code of a computer program. They are added with the purpose of making the source code easier for humans to understand, and are generally ignored by compilers and interpreters. /* welcome to the system ….. */ Percentage Comment 100 * NbLinesOfComment / ( NbLinesOfComment + NbLinesOfCode) NbLinesOfComment =10 NbLinesOfCode=50 Percentage Comment = 100*10/(10+50)= 16.6 Recommendations This metric is not helpful to assess the quality of source code Presented By : Moutasm Tamimi , 2018
  • 6. Number of Intermediate language Instructions Metrics type Description Example Nb IL Instructions Intermediate language. Code exists on many levels. Abstraction is a ladder. At the highest levels of abstraction, we have C# code. At a lower level, we have an intermediate language. Instructions. The IL has instructions (opcodes - operation code) that manipulate the stack. These instructions, called intermediate language opcodes, reside in a relational database called the metadata Recommendations NbILInstructions is higher than 100 are hard to understand and maintain. Methods where NbILInstructions is higher than 200 are extremely complex and should be split in smaller methods Presented By : Moutasm Tamimi , 2018
  • 7. Assemblies, Namespace, Type, Method, Field Metrics type Description Example NbAssemblies Defined for application An assembly provides a fundamental unit of physical code grouping. (Security, Type Identity Reference Scope, Versioning Deployment) System.Windows.Forms.dll assembly NbNamespaces Defined for application, assemblies A namespace provides a fundamental unit of logical code grouping. class library packages NbTypes An abstract or a concrete class, a structure, an enumeration, a delegate class or an interface. Classes NbMethods A method can be an abstract, virtual or non-virtual method, a method declared in an interface, a constructor, a class constructor, a finalizer, a property/indexer getter or setter, an event adder or remover Methods Recommendations NbMethods > 20 might be hard to understand and maintain but there might be cases where it is relevant to have a high value for NbMethods NbFields field can be a regular field, an enumeration's value or a read- only or a const field Int x;
  • 8. Example Presented By : Moutasm Tamimi , 2018
  • 9. Package infrastructure Presented By : Moutasm Tamimi , 2018
  • 10. Outline: Metrics on application • Lines of Code (LOC) • Lines of Comments • Percentage Comment • Number of IL Instructions • Number of Assemblies • Number of Namespaces • Number of Types Number of Methods • Number of Fields • Number of Parameters • Number of Variables • Efferent coupling (Ce) • Afferent coupling (Ca) • Instability (I) • Abstractness • Cohesion metrics • Relational Cohesion (H) • Depth of inheritance tree (DIT) • Number of children (NOC) • Association between classes (ABC) • Cyclomatic complexity (CC) Presented By : Moutasm Tamimi , 2018
  • 11. Coupling • The degree of interdependence between software modules; a measure of how closely connected two routines or modules are; the strength of the relationships between modules. Presented By : Moutasm Tamimi , 2018
  • 12. Coupling • Tight coupling (high coupling) A module has many relations with many other modules, less maintainability • Loose coupling (low coupling) A module has fewer relationships with other modules. low coupling is better situation • maintainability – changes are confined in a single module • testability – modules involved in unit testing can be limited to a minimum • readability – classes that need to be analyzed are kept at a minimum • Understand one class without reading others • Change one class without affecting others Presented By : Moutasm Tamimi , 2018
  • 13. Efferent coupling (Ce) Efferent coupling (Ce) of types within this package that depend on types outside this package. Ex It measures the number of data types Ex Outgoing Dependencies or the Number of Types inside a Package that Depend on Types of other Packages A large efferent coupling can indicate that a package is unfocussed and may also indicate that it is unstable since it depends on the stability of all the types to which it is coupled Presented By : Moutasm Tamimi , 2018
  • 14. Afferent coupling (Ca) • Number of types outside this package that depend on types within this package. Presented By : Moutasm Tamimi , 2018
  • 15. Instability (I) • This metric is used to measure the relative susceptibility of class to changes. According to the definition instability is the ration of outgoing dependencies to all package dependencies and it accepts value from 0 to 1. • I=0 indicates a completely stable package, painful to modify. • I=1 indicates a completely instable package. Presented By : Moutasm Tamimi , 2018
  • 16. Abstractness • Abstractness (A): ratio of the number of internal abstract types to the number of internal types. • A=0 indicates a completely concrete package. • A=1 indicates a completely abstract package Presented By : Moutasm Tamimi , 2018
  • 17. Cohesion metrics • Cohesion metrics measure how well the methods of a class are related to each other. A cohesive class performs one function. A non-cohesive class performs two or more unrelated functions. A non-cohesive class may need to be restructured into two or more smaller classes. • Relational Cohesion (H): average number of internal relationships per type: • H = (R + 1) / N, R = number of type relationships internal to the package, N = number of types in the package. • Classes inside an assembly should be strongly related, the cohesion should be high. On the other hand, too high values may indicate over-coupling. A good range is 1.5 ≤ H ≤ 4.0 Presented By : Moutasm Tamimi , 2018
  • 18. Cohesion metrics • Low Cohesion: Functionalities of a module are independent of each other. • High Cohesion: Functionalities of a module are strongly related. - High cohesion is better situation. • Readability – (closely) related functions are contained in a single module • Maintainability – debugging tends to be contained in a single module • Reusability – classes that have concentrated functionalities are not polluted with useless functions • Understand what a class or method does • Use descriptive names Presented By : Moutasm Tamimi , 2018
  • 19. Cohesion and coupling Presented By : Moutasm Tamimi , 2018
  • 20. Example Presented By : Moutasm Tamimi , 2018
  • 21. Inheritance • Depth of inheritance tree (DIT) for a class or a structure is its number of base classes (including System.Object thus DIT ≥ 1). Types where DIT > 6 might be hard to maintain. Not a rule since sometime classes inherit from tier classes which have a high DIT. E.g., the average depth of inheritance for framework classes which derive from System.Windows.Forms.Control is 5.3 • Number of children: (NOC) for a class is the number of types that subclass it directly or indirectly. Number of children for an interface is the number of types that implement it. Presented By : Moutasm Tamimi , 2018
  • 22. Example Presented By : Moutasm Tamimi , 2018
  • 23. lack of cohesion of methods • The single responsibility principle states that a class should not have more than one reason to change. • A high LCOM value generally pinpoints a poorly cohesive class. • Types where LCOM > 0.8 and |F| > 10 and |M| >10 might be problematic. However, it is very hard to avoid such non-cohesive types Presented By : Moutasm Tamimi , 2018
  • 24. Association between classes (ABC) • The association between classes (ABC) is the number of members of others types that a class directly uses in its the body of its methods. Presented By : Moutasm Tamimi , 2018
  • 25. Cyclomatic complexity (CC) • Cyclomatic Complexity (CC) Number of these expressions in the method body • “if, while, for, foreach, case, default, continue, goto, &&, ||, catch, ? : (ternary operator), ?? (nonnull operator)” • These expressions are not counted: • “else, do, switch, try, using, throw, finally, return, object creation, method call, field access” • CC > 15 are hard to understand, CC > 30 are extremely complex and should be split into smaller methods (unless generated code) Presented By : Moutasm Tamimi , 2018
  • 26. IL Cyclomatic Complexity (ILCC) • ILCC: Number of distinct code offsets targeted by jump/branch IL instructions. Language independent. • ILCC is generally larger than CC. • ILCC( if ) = 1 • ILCC( for ) = 2 • ILCC( foreach ) = 3 • ILCC > 20 are hard to understand, ILCC > 40 are extremely complex and should be split into smaller methods (unless generated code) Presented By : Moutasm Tamimi , 2018
  • 28. Speaker Information  Moutasm tamimi  Masters of Software Engineering  Independent Consultant , IT Researcher.  CEO at ITG7.com , IT-CRG.com  Email: tamimi@itg7.com Click Here Click HereI T G 7 Click Here Click HereIT-CRG