Technical Metrics - PowerPoint PPT Presentation

1 / 25
About This Presentation
Title:

Technical Metrics

Description:

Bugs reported. Product. Measures of the product are called 'technical metrics' 329-5 ... F. Kemerer IEEE Transactions on Software Engineering, June 1994, pp 476-493 ... – PowerPoint PPT presentation

Number of Views:54
Avg rating:3.0/5.0
Slides: 26
Provided by: Ralp47
Category:

less

Transcript and Presenter's Notes

Title: Technical Metrics


1
Technical Metrics
2
Metrics
  • What can we measure?
  • Process
  • Man hours
  • Bugs reported
  • Product
  • Measures of the product are called technical
    metrics

3
Mon-technical metrics
  • Number of people on project
  • time taken, money spent
  • bugs found
  • by testers/developers
  • by users
  • bugs fixed, features added

4
Technical Metrics
  • Size of code
  • Number of files
  • Number of classes
  • Number of processes
  • Complexity of code
  • Dependencies
  • Depth of nesting

5
Technical or non-technical?
  • Number of tests
  • Number of failing tests
  • Number of classes in design model
  • Number of relations per class
  • Size of user manual
  • Time taken by average transation

6
Measuring size of system
  • Function Points
  • Lines of code
  • Number of classes, functions, files, etc.
  • Are they repeatable?
  • Do they work on analysis model, design model, or
    code?

7
Lines of code
  • Easy to measure
  • All projects produce it
  • Not a very good standard
  • Measuring software productivity by lines of code
    is like measuring progress on an airplane by how
    much it weighs. --Bill Gates

8
Lines of code
  • Blanks? Comments?
  • copy(char p,q) while(p) q p
  • copy(char p,q)
  • while(p)
  • q p

9
Lines of code language matters
http//www.LineaEngineering.Com/Resources/Producti
vity_/productivity_.html
Lines of code
Man months
People and months
10
Lines of code
  • Lines of code is valid metric when
  • same language
  • standard formatting
  • code has been reviewed

11
Complexity
  • Complex systems are
  • hard to understand
  • hard to change
  • hard to reuse
  • Cyclomatic complexity
  • Cohesion and coupling
  • Software science

12
Cyclomatic Complexity
  • A measure of logical complexity
  • Tells how many tests are needed to execute every
    statement of program
  • Number of branches (if, while, for) 1

13
Cyclomatic Complexity
  • def processInterest()
  • for acc in account_list
  • if hasInterest(acc)
  • acc.balance acc.balance
  • acc.balance acc.interest

14
Cyclomatic Complexity
def addInterest
for
if
acc.balance ...
done
15
Cyclomatic complexity
  • Number of predicates 1
  • Number of edges - number of nodes 2
  • Number of regions of the flow graph

16
Testing view
  • Cyclomatic complexity is the number of
    independent paths through the procedure
  • Gives an upper bound on the number of tests
    necessary to execute every edge of control graph

17
Metrics view
  • McCabe found that modules with a cyclomatic
    complexity greater than 10 were hard to test and
    error prone.
  • Look for procedures with high cyclomatic
    complexity and rewrite them, focus testing on
    them, or focus reviewing on them.

18
Coupling and cohesion
  • Number and complexity of shared variables
  • Functions in a module should share variables
  • Functions in different modules should not
  • Number and complexity of parameters
  • Number of functions/modules that are called
  • Number of functions/modules that call me

19
Dhamas Coupling Metric
  • Module coupling
  • 1 / (number of input parameters number of
    output parameters number of global variables
    used number of modules called number of
    modules calling)
  • .5 is low coupling, .001 is high coupling.

20
Martins Coupling Metric
  • Ca Afferent coupling the number of classes
    outside this module that depend on classes inside
    this module
  • Ce Efferent coupling the number of classes
    inside this module that depend on classes outside
    this module
  • Instability Ce / (Ca Ce)

21
  • A Abstractness ( abstract classes in module /
    classes in module)

(0,1)
Abstractness
(1,0)
Instability
22
One way to use metrics
  • Measure the amount of code produced each month by
    each programmer
  • Give high producers big raise

23
Another way to use metrics
  • Measure complexity of modules
  • Pick the most complex and rewrite it

24
Using metrics
  • Use function points to determine how many lines
    of code a system will require.
  • When you write that many lines of code, stop and
    deliver the system.

25
Next time
  • A Metrics Suite for Object Oriented Design, Shyam
    R. Chidamber and Chris F. Kemerer IEEE
    Transactions on Software Engineering, June 1994,
    pp 476-493
Write a Comment
User Comments (0)
About PowerShow.com