Comparison of ObjectOriented and Paradigm Independent Software Complexity Metrics - PowerPoint PPT Presentation

1 / 22
About This Presentation
Title:

Comparison of ObjectOriented and Paradigm Independent Software Complexity Metrics

Description:

... of the software. Specification. Design. Implementation. Testing & Bug-fixing ... Software metrics: Measuring the development process (process metrics) ... – PowerPoint PPT presentation

Number of Views:128
Avg rating:3.0/5.0
Slides: 23
Provided by: asztIn
Category:

less

Transcript and Presenter's Notes

Title: Comparison of ObjectOriented and Paradigm Independent Software Complexity Metrics


1
Comparison of Object-Oriented andParadigm
IndependentSoftware Complexity Metrics
  • Zoltán Porkoláb, Ádám Sillye
  • Department of Programming Languages and Compilers
  • Eötvös Loránd University, Faculty of Informatics
  • e-mail gsdmadic_at_elte.hu

2
The structure of the presentation
  • The role of software metrics
  • Metrics an overview
  • Object-oriented software metrics
  • Multiparadigm programming
  • The AV-graph
  • Empirical results

3
Role of software metrics
  • Cost of the software
  • Specification
  • Design
  • Implementation
  • Testing Bug-fixing
  • Maintenance
  • More than 70 of cost is for testing and
    maintenance (Zuse 1998)
  • Software quality

4
Software metrics
  • Software metrics
  • Measuring the development process (process
    metrics)
  • Measuring the product (product metrics)
  • Product metrics
  • External metrics
  • Reliability metrics
  • Functional metrics
  • Efficiency metrics
  • Internal product metrics
  • Size
  • Complexity
  • Style

5
Product metrics
  • Size metrics
  • LOC, eLOC
  • Ignore the semantic
  • Structural metrics
  • McCabe 1976
  • Motivation predict testing efforts
  • For structured programs V(G) p 1
  • Howatt and Baker 1989
  • Motivation involve nesting level
  • SN(G) NND(G)

6
Object-oriented metrics in theory
  • Chidamber-Kemerer (1994) OO metrics suite
  • WMC (Weighted Methods per Class)
  • DIT (Depth of Inheritance Tree, DIT)
  • NOC (Number of Child Classes)
  • CBO (Coupling Between Object Classes) fan-in and
    fan out
  • RFC (Response for Class)
  • LCOM (Lack of Cohesion in Methods)
  • Chidamber - Kemerer
  • Henderson - Sellers

7
Object-Oriented metrics in practice
  • Eclipse (www.eclipse.org)
  • McCabe cyclomatic complexity
  • Efferent coupling (? fan out!)
  • Lack of Cohesion
  • LOC (Lines of Code)
  • Number of Fields in Classes
  • Nesting Depth
  • Number of Method Parameters
  • Number of Statements
  • Weighted Methods per Class

8
Software paradigm
  • Evolution of Software paradigm
  • Structured programming
  • Object-oriented programming
  • Classes, inheritance, virtual function
  • Generative programming
  • Aspect-Oriented (Kitzales 1994)
  • Intentional (Simonyi 1995)
  • Template metaprogramming (Veldhuizen 1994)
  • Multiparadigm programming (Coplien 1998)
  • Simultaneous usage of paradigms

9
Paradigm-independent Software Metrics
  • Applicable for programs written in different
    paradigms or in mixed-paradigm environment
  • Based on general programming language features
    which are paradigm- and language-independent.The
    paradigm-dependent attributes are derived
    fromthese features.

10
Components
  • Control Structure of Program
  • Most of the programs share the same control
    statements
  • Complexity of Data Types
  • Reflects the complexity of data types used (like
    classes)
  • Complexity of Data Access
  • Connection between control structure and data
  • Direction of data flow
  • Nesting depth

11
AV-graph
12
AV-graph metrics
  • N number of nodes
  • nd(n) Pred(n) nesting depth of node n
  • ND(G) S nd(n) for all nodes
  • C(G) N ND(G)
  • C(O) N S ND(G)
  • A S (ND(G) L)

13
Complexity of class
  • Control structures
  • Complexity of method control structures
  • Complexity of data types
  • Local variables in methods
  • Attributes (could be complex types)
  • Coupling between classes
  • Inheritance
  • Complexity of data handling
  • Connection between control structure and data

14
Complexity of Class
class date public void set_next_month()
if ( month 12 ) month 1 year
year 1 else month month
1 void set_next_day() if
( month 1 month 3 ... month 12
) if ( day 31 )
set_next_month() else
day day 1 else if ( day
30 ) set_next_month() else
day day 1 private int year,
month, day
15
Our Measuring tool
  • Supported languages
  • Java 1.3
  • Java 1.4 (assert)
  • Future directions C and C
  • Implementation
  • ANTLR
  • User interface standalone application and
    Eclipse Plug-in
  • Ouput
  • CSV
  • XML

16
Applied Metrics
  • Object-Oriented Metrics
  • Inner Class Depth
  • Inheritance level
  • Number of Children
  • Number of Methods
  • Number of Fields
  • LCOM
  • Henderson-Sellers LCOM
  • Fan-out

17
Applied Metrics
  • Size Metrics
  • eLOC
  • Number of Statements
  • McCabe
  • Howatt-Baker
  • AV-graph

18
Test Data
  • Java Standard Library 1.4.2
  • 367.000 eLOC
  • jBOSS 3.2.3
  • 300.000 eLOC
  • Omg.org.CORBA
  • 5.000 eLOC
  • The measure tool (with mostly generated parser)
  • 7.000 eLOC
  • Eclipse 3.0M6
  • 900.000 eLOC
  • 17.000 class more than 1.5 million lines

19
Calibrating our tool
  • Goal
  • Achieve similar results with other measuring
    programs. (Otherwise we are unable to compare the
    results.)
  • Difficulties
  • Metrics are not defined precisely enough from the
    view of implementation.
  • Available tools
  • working on different abstract program tree.
  • use simplified metrics definitions.
  • and have several bugs.

20
Example
  • Lack of Cohesion in Methods
  • P method pairs that access different fields
  • Q method pairs that access at least one common
    field
  • LCOM P-Q if P-Q0, otherwise 0.
  • References to this and super have to be counted
    or not in the sense of cohesion?
  • No, but some tools count them.

21
Results
  • No statistical correlation between the OO and
    multi paradigm metrics
  • OO metrics only measure the big picture
  • MPM consider more properties higher density
  • The structural complexity of methods are
    extremely increase the overall complexity.

22
Conclusion
  • Implementations are not reliable yet
  • No precise definition for metrics
  • Different input data languages
  • Tools
  • Various interpretation of definitions.
  • Various bugs.
  • Results of different tools cannot be compared.
  • Future examination...
Write a Comment
User Comments (0)
About PowerShow.com