Download presentation
Presentation is loading. Please wait.
Published byBaldwin Fleming Modified over 9 years ago
1
Paradigm Independent Software Complexity Metrics Dr. Zoltán Porkoláb Department of Programming Languages and Compilers Eötvös Loránd University, Faculty of Informatics e-mail: gsd@elte.hu
2
2SQI 2005.04.11. The structure of the presentation The role of software metrics Metrics: an overview Object-oriented software metrics Multiparadigm programming The AV-graph Results
3
3SQI 2005.04.11. Role of software metrics Cost of the software Specification Specification Design Design Implementation Implementation Testing & Bug-fixing Testing & Bug-fixing Maintenance Maintenance More than 70% of cost is for testing and maintenance (Zuse 1998) Software quality
4
4SQI 2005.04.11. Software metrics Software metrics: Measuring the development process (process metrics) Measuring the development process (process metrics) Measuring the product (product metrics) Measuring the product (product metrics) Product metrics: External metrics: External metrics: Reliability metrics Functional metrics Efficiency metrics Internal product metrics: Internal product metrics:SizeComplexity Style
5
5SQI 2005.04.11. Product metrics Size metrics: LOC, eLOC LOC, eLOC Ignore the semantic Ignore the semantic Structural metrics: McCabe 1976 Motivation: predict testing efforts Motivation: predict testing efforts For structured programs: V(G) = p + 1 For structured programs: V(G) = p + 1 Howatt and Baker 1989 Motivation: involve nesting level Motivation: involve nesting level SN(G) = |N|+ND(G) SN(G) = |N|+ND(G)
6
6SQI 2005.04.11. Object-oriented metrics in theory Chidamber-Kemerer (1994) OO metrics suite: WMC (Weighted Methods per Class) WMC (Weighted Methods per Class) DIT (Depth of Inheritance Tree, DIT) DIT (Depth of Inheritance Tree, DIT) NOC (Number of Child Classes) NOC (Number of Child Classes) CBO (Coupling Between Object Classes) fan-in and fan out CBO (Coupling Between Object Classes) fan-in and fan out RFC (Response for Class) RFC (Response for Class) LCOM (Lack of Cohesion in Methods) LCOM (Lack of Cohesion in Methods) Chidamber - Kemerer Henderson - Sellers
7
7SQI 2005.04.11. Object-Oriented metrics in practice Eclipse ( www.eclipse.org ) www.eclipse.org McCabe cyclomatic complexity McCabe cyclomatic complexity Efferent coupling (≠ fan out!) Efferent coupling (≠ fan out!) Lack of Cohesion Lack of Cohesion LOC (Lines of Code) LOC (Lines of Code) Number of Fields in Classes Number of Fields in Classes Nesting Depth Nesting Depth Number of Method Parameters Number of Method Parameters Number of Statements Number of Statements Weighted Methods per Class Weighted Methods per Class
8
8SQI 2005.04.11. Software paradigm Evolution of Software paradigm Structured programming Structured programming Object-oriented programming Object-oriented programming Classes, inheritance, virtual function Generative programming Generative programming Aspect-Oriented (Kitzales 1994) Intentional (Simonyi 1995) Template metaprogramming (Veldhuizen 1994) Multiparadigm programming (Coplien 1998) Simultaneous usage of paradigms Simultaneous usage of paradigms
9
9SQI 2005.04.11. 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 from these features.
10
10SQI 2005.04.11.Components Control Structure of Program Most of the programs share the same control statements Most of the programs share the same control statements Complexity of Data Types Reflects the complexity of data types used (like classes) Reflects the complexity of data types used (like classes) Complexity of Data Access Connection between control structure and data Connection between control structure and data Direction of data flow Nesting depth
11
11SQI 2005.04.11.AV-graph s main P1P1 t main b P4P4 a c d1d1 d3d3 d4d4 d2d2 data node output node input node
12
12SQI 2005.04.11. 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; }; Complexity of Class s set_next_month P1P1 t snm b ac s set_next_day P2P2 t snm e P3P3 gf P4P4 d1d1 d3d3 d2d2
13
13SQI 2005.04.11. Our Measuring tool Supported languages Java 1.3 Java 1.3 Java 1.4 (assert) Java 1.4 (assert) Java 5 (generics) Java 5 (generics)Implementation standalone application and Eclipse Plug-in standalone application and Eclipse Plug-inOuput CSV CSV XML XML
14
14SQI 2005.04.11. Test Data Java Standard Library 1.4.2 367.000 eLOC 367.000 eLOC jBOSS 3.2.3 300.000 eLOC 300.000 eLOCOmg.org.CORBA 5.000 eLOC 5.000 eLOC The measure tool (with mostly generated parser) 7.000 eLOC 7.000 eLOC Eclipse 3.0M6 900.000 eLOC 900.000 eLOC 17.000 class – more than 1.5 million lines
15
15SQI 2005.04.11. Results No statistical correlation between the OO and multi paradigm metrics: OO metrics only measure the big picture OO metrics only measure the big picture MPM consider more properties: higher density MPM consider more properties: higher density The structural complexity of methods are extremely increase the overall complexity. The structural complexity of methods are extremely increase the overall complexity.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.