Design Quality Assessment in Practice

Similar documents
Software Design & Evolution. Lecture 04. You cannot control what you cannot measure. Metrics & Problem Detection. Michele Lanza

Software Metrics and Problem Detection

What are Metrics?! Functions, that assign a precise numerical value to. Detecting Design Problems using Metrics

What and Why? Reverse Engineering. I. First Contact: the Forces. The Reengineering Life-Cycle

Object Oriented Metrics. Impact on Software Quality

A Systematic Review of Bad Smells Metrics. Luiz Paulo Coelho Ferreira

Technical Metrics for OO Systems

An experience report on using code smells detection tools

Restructuring. What is restructuring? Tudor Gîrba Reengineering life cycle. What? forward engineering. reverse engineering

Object Oriented Measurement

Risk-based Object Oriented Testing

Software Wartung und Evolution Modeling History with Metamodels. Harald Gall Institut für Informatik Universität Zürich

Quantify the project. Better Estimates. Resolve Software crises

Software Design and SOLID Principles

Measuring the quality of UML Designs

Influence of Design Patterns Application on Quality of IT Solutions

Maintainability and Agile development. Author: Mika Mäntylä

Single Responsibility Principle

CHAPTER 4 OBJECT ORIENTED COMPLEXITY METRICS MODEL

Software Visualization Applied S. Ducasse rmod.lille.inria.fr / stephane.ducasse.free.fr

Research Article An Empirical Study of the Effect of Power Law Distribution on the Interpretation of OO Metrics

Software Engineering

Software Metrics for Package Remodularisation

Visualizing Software Metrics for increased Refactoring

EasyChair Preprint. Software Metrics Proposal for Conformity Checking of Class Diagram to SOLID Design Principles

Evolving Software. CMSC 433 Programming Language Technologies and Paradigms Spring Example. Some Motivations for This Refactoring

Application of Object Oriented Metrics to Java and C Sharp: Comparative Study

SOLID Principles. Equuleus Technologies. Optional Subheading October 19, 2016

Administrivia. Programming Language Fall Example. Evolving Software. Project 3 coming out Midterm October 28. Refactoring October 14, 2004

Software metrics for Java and C++ practices. Référencement des métriques utiles à la caractérisation des pratiques sensibles pour Java et C++

Does Your Code Measure Up?

CHAPTER 4 HEURISTICS BASED ON OBJECT ORIENTED METRICS

Metrics and OO. SE 3S03 - Tutorial 12. Alicia Marinache. Week of Apr 04, Department of Computer Science McMaster University

Research Article ISSN:

Effective Modular Design

Kostis Kapelonis Athens Greece, March 2010

ARiSA First Contact Analysis

J2EE Development Best Practices: Improving Code Quality

METRIC ATTITUDE PLUG-IN FOR ECLIPSE USER GUIDE

6 Detection of Architecturally-Relevant Code Anomalies with Architectural-Sensitive Information

Thresholds for Software Quality Metrics in Open Source Android Projects

Language Independent Metric Support towards Refactoring Inference

Patterns in Software Engineering

FOR0383 Software Quality Assurance

A Measurement-Based Approach for Detecting Design Problems in Object-Oriented Systems

Analysis of Various Software Metrics Used To Detect Bad Smells

Similar Characteristics of Internal Software Quality Attributes for Object-Oriented Open-Source Software Projects

On the Impact of Refactoring Operations on Code Quality Metrics

Principles of Object-Oriented Design

Lecture 24 Software Visualization and Metrics Polymetric Views. EE 382V Spring 2009 Software Evolution - Instructor Miryung Kim

Metrics in assessing the quality and evolution of jedit

The Evolution and Impact of Code Smells: A Case Study of Two Open Source Systems

2IS55 Software Evolution. Software metrics (3) Alexander Serebrenik

Inheritance Usage Patterns in Open-Source Systems. Jamie Stevenson and Murray Wood. University of Strathclyde, Glasgow, UK

CHAPTER 3 ROLE OF OBJECT-ORIENTED METRICS IN SOFTWARE MEASUREMENT

Principal Component Analysis of Lack of Cohesion in Methods (LCOM) metrics

Catalogue of Metrics Used in the Book

Towards Cohesion-based Metrics as Early Quality Indicators of Faulty Classes and Components

A Study of Software Metrics

Moonzoo Kim CS Division of EECS Dept.

Reusability Metrics for Object-Oriented System: An Alternative Approach

HangMan PBL - Refactoring Use yourupdated (best) version of Hangman(with a dictionary of words).

COURSE 2 DESIGN PATTERNS

Software metrics for policy-driven software development life cycle automation

Abstraction. Design fundamentals in OO Systems. Fundamental Software Development Principles

Object-Oriented Metrics in Practice

Introduction to software metics

Effectiveness of software metrics for object-oriented system

Visually Localizing Design Problems with Disharmony Maps

EVALUATING IMPACT OF INHERITANCE ON OBJECT ORIENTED SOFTWARE METRICS

Software Quality Estimation through Object Oriented Design Metrics

Patterns in Software Engineering

Inheritance Metrics: What do they Measure?

Analyzing Java Software by Combining Metrics and Program Visualization

SOFTWARE ASSESSMENT USING OBJECT METRICS

1 Introduction. Abstract

Refactoring. Chen Tang March 3, 2004

Object-Oriented Concepts and Design Principles

Enhancing Object Oriented Coupling Metrics w.r.t. Connectivity Patterns

Chapter 8: Class and Method Design

Keywords: Abstract Factory, Singleton, Factory Method, Prototype, Builder, Composite, Flyweight, Decorator.

Development By The Numbers

Application of a Fuzzy Inference System to Measure Maintainability of Object-Oriented Software

Investigation of Metrics for Object-Oriented Design Logical Stability

2IS55 Software Evolution. Software metrics (2) Alexander Serebrenik

Component-Level Design. Slides copyright 1996, 2001, 2005, 2009 by Roger S. Pressman. For non-profit educational use only

SNS College of Technology, Coimbatore, India

ISSN: [Gupta* et al., 6(5): May, 2017] Impact Factor: 4.116

Quality-oriented Move Method Refactoring

Object-Oriented Design Quality Models A Survey and Comparison

An Empirical Investigation of Inheritance Trends in Java OSS Evolution. by Emal Nasseri

Credit where Credit is Due. Lecture 25: Refactoring. Goals for this lecture. Last Lecture

Refactorings. Refactoring. Refactoring Strategy. Demonstration: Refactoring and Reverse Engineering. Conclusion

Metrics, Do They Really Help?

Empirical Software Engineering. Empirical Software Engineering with Examples! is not a topic for examination. Classification.

How to Realization Architectural testing model using Measurement Metrics

ACICE-2013 ISSN: ; e-issn

17.11 Bean Rules persistent

Code Smells & Refactoring

PREDICTION OF SOFTWARE DEFECTS USING OBJECT-ORIENTED METRICS

Transcription:

Design Quality Assessment in Practice my two hats... Radu Marinescu radum@cs.upt.ro Associate Professor since 006 Co-Founder and Head since 003 http://www.intooitus.com/ Co-Founder (008)

Assessment with pictures Assessment with metrics Assessment with metrics 3 Assessment with tools Software is complex. 9% Succeeded forward engineering 8% Failed 53% Challenged The Standish Group, 004

forward engineering When, due to constraints, I design quickly and dirty, my project is loaded with technical debt. W.Cunningham, 99 actual development How can I control this...? You cannot control what you cannot measure. Tom de Marco

Metrics compress traits into numbers. Let s see some examples... Examples of metrics LOC - number of lines of code CYCLO - cyclomatic complexity of a function NOF - number of functions FANOUT - outgoing coupling... NOA - number of attributes DIT - depth of inheritance tree TCC - tight class cohesion Lorenz, Kidd, 994 Chidamber, Kemerer, 994

Trouble in paradise... Trouble : Thresholds

Metric Value LOC 3575 NOM? 368 NOC 384 CYCLO 5579 NOP 9 FANOUT 8590 Are these numbers normal? We need means to compare. We need comparable metrics.

Overview Pyramid provides a metrics overview. Marinescu, Lanza Overview Pyramid provides a metrics overview. Marinescu, Lanza Inheritance 0.5 CYCLO 9.7 LOC 9.4 NOM ANDC 0.3 AHH 0. 0. NOP 9 NOC 384 368 NOM 3575 58 5579 8590 48 CALLS 0.56 FANOUT 0.5 CYCLO 9.7 LOC 9.4 NOM ANDC 0.3 AHH 0. 0. NOP 9 NOC 384 368 NOM 3575 58 5579 8590 48 CALLS 0.56 FANOUT Size Communication Size Overview Pyramid provides a metrics overview. Marinescu, Lanza LOW Java AVG HIGH LOW C++ AVG HIGH CYCLO/LOC 0.6 0.0 0.4 0.0 0.5 0.30 0.5 CYCLO 9.7 LOC 9.4 NOM ANDC 0.3 AHH 0. 0. NOP 9 NOC 384 368 NOM 3575 58 5579 8590 48 CALLS 0.56 FANOUT LOC/NOM NOM/NOC... 7 0 3 4 7 0 4.000+ OSS projects 500.000.000+ LOC 5 4 0 9 6 5

The Overview Pyramid provides a metrics overview. Marinescu, Lanza The Overview Pyramid provides a metrics overview. Marinescu, Lanza 0.5 CYCLO 9.7 LOC 9.4 NOM ANDC 0.3 AHH 0. 0. NOP 9 NOC 384 368 NOM 3575 58 5579 8590 48 CALLS 0.56 FANOUT 0.5 CYCLO 9.7 LOC 9.4 NOM ANDC 0.3 AHH 0. 0. NOP 9 NOC 384 368 NOM 3575 58 5579 8590 48 CALLS 0.56 FANOUT close to high close to average close to low The Overview Pyramid provides a metrics overview. Marinescu, Lanza Trouble : Granularity close to high close to average close to low

Metrics are aggregated in quality models... Problem: we don t reason in terms of metrics, but in terms of design principles? McCall, 977

Capture violations of design principles & best practices in an automatic manner... An example... Detection Strategies are metric-based queries to detect design flaws. Marinescu God Classes tend to centralize the intelligence of the, to do everything and to use data from small data-classes. A.Riel, 996 Rule METRIC > Threshold AND Quality problem Rule METRIC < Threshold

God Classes tend to centralize the intelligence of the, to do everything and to use data from small data-classes. God Classes centralize the intelligence of the, do everything and use data from small data-classes. God Classes are complex, are not cohesive, access external data. A God Class centralizes too much intelligence in the. Class uses directly more than a few attributes of other classes ATFD > FEW Marinescu, Lanza Compose metrics into queries using logical operators Functional complexity of the class is very high WMC VERY HIGH Class cohesion is low AND GodClass TCC < ONE THIRD

Shotgun Surgery Marinescu, Lanza Shotgun Surgery Marinescu, Lanza uses is Feature Envy Data Class (partial) Feature Envy uses Data Class Intensive Coupling Dispersed Coupling God Class Brain Class Brain Method Significant Duplication Intensive Coupling Dispersed Coupling God Class Brain Class is is Brain Method is partially Significant Duplication Refused Parent Bequest Tradition Breaker Refused Parent Bequest is Tradition Breaker (subclass) Futile Hierarchy Futile Hierarchy Identity Disharmonies Collaboration Disharmonies Classification Disharmonies Identity Disharmonies Collaboration Disharmonies Classification Disharmonies Measure quality deficit based on design problems Measure quality deficit based on design problems Quality Understandability Changeability Reusability Reusability Hierarchies uses is Shotgun Surgery Cohesion (partial) Feature Envy uses Data Class Size & Complexity Encapsulation Coupling Cohesion Hierarchies Quality Understand dability Changeability Size & Complexity Encapsulation Coupling Intensive Coupling Dispersed Coupling Refused Parent Bequest God Class Brain Class is is is Tradition Breaker Futile Hierarchy is partially Brain Method (subclass) Significant Duplication

Analysis name Impact class Analysis name Impact class Relative Impact level (L/H) SCOMP ENC CPL COH HIE Blob Class Significant External Duplication Significant Hierarchy Duplication Significant Internal Duplication God Class Data Class Data Clumps Intensive Coupling Dispersed Coupling Shotgun Surgery Cyclic Dependencies (ADP Breakers) Unnecessary Coupling Unstable Dependencies (SDP Breakers) Schizophrenic Class (SRP, ISP) Feature Envy Refused Parent Bequest (LSP) Tradition Breaker (SRP) SAP Breakers (DIP) Distorted Hierarchy (deep and narrow) class hierarchy class class class class hierarchy hierarchy hierarchy Blob Class Significant External Duplication Significant Hierarchy Duplication Significant Internal Duplication God Class Data Class Data Clumps Intensive Coupling Dispersed Coupling Shotgun Surgery Cyclic Dependencies (ADP Breakers) Unnecessary Coupling Unstable Dependencies (SDP Breakers) Schizophrenic Class (SRP, ISP) Feature Envy Refused Parent Bequest (LSP) Tradition Breaker (SRP) SAP Breakers (DIP) Distorted Hierarchy (deep and narrow) class H L L H L L hierarchy H L L H class H L H H H L L L H L L L H class H L H H H H H H L H L H class H L H H class L H H L L hierarchy H H H hierarchy H L L H L L H hierarchy H L H Impact class Weight class hierarchy 3 5 Impact class Weight class hierarchy 3 5 Impact level Weight L H Stay tuned for the infusion demo incode demos! Assessment with pictures Assessment with metrics 3 Assessment with tools

Assessment with pictures Polymetric views show up to 5 metrics Use metrics in a visual context! Height metric Position metrics Width metric Lanza, Ducasse, 003 Color metric System Complexity shows class hierarchies Example attributes methods lines

000+ classes in one picture....000+ classes in one picture... ArgoUML, 004 Java JDK.5, 0 Trouble in paradise... Trouble : Heterogeneity

Trouble : Edges are a pain... They are simply too many...

Edges work only in demos and research papers. :-) Beyond polymetric views... Polymetric Maps Visualize various design concerns. Reuse the layout!

Package Map: Layout Example: Package Maps Eclipse-JDT, 00 Package Map: Design Problems Package Map: Coupling none many client (uses other classes) no severe affected by design problems Eclipse-JDT, 00 none many provider (is used by other classes) Eclipse-JDT, 00

Package Map: Coupling A picture is worth a thousand words Interactive! Eclipse-JDT, 00 3 A demo is worth a thousand pictures Assessment with tools Proverb

infusion infusion Quality Deficit becomes quantifiable Detection of well-know design problems 3 Meaningful contextual advices 4 Interactive visualizations 3.5 MLOC A demo is worth a thousand pictures It s demo time!

Try out infusion yourself! Design Quality Assessment in Practice http://www.intooitus.com/products/infusion Radu Marinescu radum@cs.upt.ro