Please enable JavaScript.
Coggle requires JavaScript to display documents.
Software Metric & Quality - Coggle Diagram
Software Metric & Quality
Why do we need to measure?
Compare to make good quality decision
achieve effectiveness and proficiency
know what to expect and improve
to quantify the quality
objective measure: everyone know how and why to use
What is the use of software measurement
how good is the design
bad design hard to understand, implement, maintain and evolve
how complex is the code
hard to understand, test, debug and change
how much efforts will be required
to develop the software ( design, implement, test, maintain, debug, deploy)
attribute that can be capture
software quality: how good is the software
effort or resource estimates
progress of development
complexity/ difficulty
process quality: how good is the process
quality factor: usability, correctness, efficiency, modularity, portability, simplicity, understandability, security, robustness, completion...
consider Lines of Code (LOC)
tell code size/ now how good the code is
what to measure in software
size
togetherness of module's component
to achieve high cohesion
dependence of modules on each other
separation concern
code complexity or organization of code
times spent on different processes
number of requirements
based on goals of measurement
measurement scale
nominal scale
items are assigned to groups/ categories
no number is generated
no ordering is implied
eg:
recursive/ non-recursive programs
programs that use portable features & those that use non-portable features
binary executable programs, source programs, DLL components, object libraries
types of errors
ordinal scale
measurements are ordered
higher number represent higher value
but the numbers are only for ordering purpose (cold/warm/hot)
eg:
CMMI maturity levels (1: initial, 2:repeatable, 3:defined, 4:managed, 5:optimizing)
how often software fails (daily/weekly/monthly/yearly/never)
interval scale
interval that separates classes
know exactly when the item crosses one class to another
classes are ordered
addition & subtraction is fine
but can't take ratio/ can't use multiplication & division
eg:
temperature in celcius/ fahrenheit scale
30 degree to 31 degree is 1 degree hotter than earlier
can't say 50 degree is twice hot as 25 degree
ratio scale
has ordering, interval sized, ratios are possible
value 0 represent absence of the measured attributed
eg:
length: 5 feet is half of 10 feet
absolute scale
counting entities in the entity set
all arithmetic operations are meaningful
there is only way to measure: counting
eg:
length of the program, when measured as statement count (LOC), is not the absolute scale (as can measure in a different way: lines/ words)
but LOC as statement count is an absolute scale measure of the number of lines of code
Size metrics
length: physical size of product
Lines of Code (LOC): explain how comments, blank lines, declarations, more statements on one line are handled
ELOC/ NLOC: non commented effective lines of code
CLOC: number of commented lines
functionality: how much provided
Function Points (FP):
number of external inputs
number of external outputs
number of external inquiries
number of external files
number of internal files
each counted entity has weight: simple/ average/ complex
complexity: problem, algorithmic solution, solution structure, cognitive complexity (understandability)
'O' notation: constant, logarithmic, linear, quadratic, exponential
Time and space complexity
measuring structure
McCabe's Cyclometric Complexity
measure number of regions in the flow graph
number of predicate nodes in the flow graph + 1
Coupling and cohesion
coupling
data, stamp, control, common, content, none
eg:
number of interconnections per modules
max of number of interconnections per modules
average number of interconnections in the system
ordinal classes of cohesion
functional (abstraction)
sequential (module has workflow like functions)
communicational (many functions but using same data)
coincidental (accidental)
object oriented metrics: CK/ MOOD
number of methods in class
average number of methods per class
inheritance tree depth (DIT)
number of children (NOC)
response for a class (RFC)
coupling between objects (CBO)
lack of cohesion among methods (LCOM)
attribute hiding factor (AHF)
method inheritance factor (MIF)
attribute inheritance factor (AIF)
polymorphism factor (PF)
coupling factor (CF)
Quality guidelines for coding & development