Ingegneria del Software Corso di Laurea in Informatica per il Management. Object Oriented Principles



Similar documents
COSC 3351 Software Design. Recap for the first quiz. Edgar Gabriel. Spring For the 1 st Quiz

Ingegneria del Software Corso di Laurea in Informatica per il Management. Agile software development

How To Understand The Software Process

The Dependency Inversion Principle

OO Design Quality Metrics

Agile Software Development

Object Oriented Design

Chapter 24 - Quality Management. Lecture 1. Chapter 24 Quality management

Software Engineering. So(ware Evolu1on

Code Qualities and Coding Practices

Chapter 9 Software Evolution

Test-Driven Approach for Safety-Critical Software Development

Prof. Paolo Nesi. Lab: DISIT, Sistemi Distribuiti e Tecnologie Internet

Program Understanding in Software Engineering

Unit Test Case Design Metrics in Test Driven Development

Object-Oriented Middleware for Distributed Systems

Design Principles and Design Patterns

A Software Engineering Process for Operational Space Weather Systems. S. Dave Bouwer, W. Kent Tobiska Space Environment Technologies

Engineering Process Software Qualities Software Architectural Design

The Rules 1. One level of indentation per method 2. Don t use the ELSE keyword 3. Wrap all primitives and Strings

CSC408H Lecture Notes

Compiling Object Oriented Languages. What is an Object-Oriented Programming Language? Implementation: Dynamic Binding

Component Based Software Engineering: A Broad Based Model is Needed

CS 121 Midterm Exam Fall 12 CLOSED BOOK THE RULES - PLEASE READ CAREFULLY

The «SQALE» Analysis Model An analysis model compliant with the representation condition for assessing the Quality of Software Source Code

BCS HIGHER EDUCATION QUALIFICATIONS Level 6 Professional Graduate Diploma in IT. March 2013 EXAMINERS REPORT. Software Engineering 2

Object Oriented Analysis and Design and Software Development Process Phases

Agile Software Development

Quality Management. Objectives

Quality Management. Ian Sommerville 2004 Software Engineering, 7th edition. Chapter 27 Slide 1

Engineering Design. Software. Theory and Practice. Carlos E. Otero. CRC Press. Taylor & Francis Croup. Taylor St Francis Croup, an Informa business

SOFTWARE PROCESS MODELS

DATA QUALITY DATA BASE QUALITY INFORMATION SYSTEM QUALITY

Pattern. seconda parte. Types of patterns. ...other good guidance... some GRASP. design patterns (software design) Types of software patterns

Quality Management. Managing the quality of the software process and products

Quality Management. Objectives. Topics covered. Process and product quality Quality assurance and standards Quality planning Quality control

EVALUATING METRICS AT CLASS AND METHOD LEVEL FOR JAVA PROGRAMS USING KNOWLEDGE BASED SYSTEMS

On the Relation between Design Contracts and Errors: A Software Development Strategy

Basic Trends of Modern Software Development

Evaluation of the Iceland State Financial and Human Resource System REPORT OF THE INDIVIDUAL EVALUATOR. Annex 2 SYSTEM AND SOFTWARE QUALITY

22C:22 (CS:2820) Object-Oriented Software Development

Introduction to Service Software Engineering

Volume 11 Issue 7 Version 1.0 December 2011 Type: Double Blind Peer Reviewed International Research Journal Publisher: Global Journals Inc.

1.1 The Nature of Software... Object-Oriented Software Engineering Practical Software Development using UML and Java. The Nature of Software...

Advanced Software Engineering. Software Development Processes

Software Engineering: Analysis and Design - CSE3308

Implementing the CIDOC CRM with a relational database

A process-driven methodological approach for the design of telecommunications management systems

II. TYPES OF LEVEL A.

What do you think? Definitions of Quality

1. What are Data Structures? Introduction to Data Structures. 2. What will we Study? CITS2200 Data Structures and Algorithms

A Comparative Study of Software Quality Models

How To Calculate Class Cohesion

A Process for ATLAS Software Development

Di 6.1a. Warum naive SOA scheitert Ein Erfahrungsbericht. Adam Bien. January 26-30, 2009, Munich, Germany ICM - International Congress Centre Munich

Software Engineering

Definitions. Software Metrics. Why Measure Software? Example Metrics. Software Engineering. Determine quality of the current product or process

City University of Hong Kong Course Syllabus. offered by Department of Computer Science with effect from Semester A 2015/16

Manufacturing View. User View. Product View. User View Models. Product View Models

September 18, Modular development in Magento 2. Igor Miniailo Magento

Saturday, June 16, 12. Introducing

SOFTWARE QUALITY MODELS: A COMPARATIVE STUDY

by Pearson Education, Inc. All Rights Reserved.

Chapter 3 Chapter 3 Service-Oriented Computing and SOA Lecture Note

How To Write Software

Software Engineering Compiled By: Roshani Ghimire Page 1

Software Engineering

Quality Management. What is quality? Managing the quality of the software process and products ISO 9000

Evolving a Ultra-Flow Software Development Life Cycle Model

CSC 408F/CSC2105F Lecture Notes

Sistemi ICT per il Business Networking

CS 451 Software Engineering Winter 2009

Construction Principles and Design Patterns. Flyweight, Bridge, Builder

Domain-Driven Design

Modernized and Maintainable Code. Frank Weil, Ph.D. UniqueSoft, LLC

BCS THE CHARTERED INSTITUTE FOR IT. BCS HIGHER EDUCATION QUALIFICATIONS BCS Level 6 Professional Graduate Diploma in IT SOFTWARE ENGINEERING 2

Chap 1. Software Quality Management

Limitations of Data Encapsulation and Abstract Data Types

Unit I Page No. 1 System Development Object Basics Development Life Cycle Methodologies Patterns Frameworks Unified Approach UML

Karunya University Dept. of Information Technology

Software Engineering. Software Engineering. Component-Based. Based on Software Engineering, 7 th Edition by Ian Sommerville

CS314: Course Summary

How To Design Software

Static Analysis and Validation of Composite Behaviors in Composable Behavior Technology

Johannes Sametinger. C. Doppler Laboratory for Software Engineering Johannes Kepler University of Linz A-4040 Linz, Austria

Object Oriented Databases. OOAD Fall 2012 Arjun Gopalakrishna Bhavya Udayashankar

"FRAMEWORKING": A COLLABORATIVE APPROACH TO CONTROL SYSTEMS DEVELOPMENT

Object-Oriented Databases

Development Process Visualization and Project Management

Object-Oriented Software Construction

Transcription:

Ingegneria del Software Corso di Laurea in Informatica per il Management Object Oriented Principles Davide Rossi Dipartimento di Informatica Università di Bologna

Design goal The goal of design-related activities is to produce high-quality software systems What is high-quality software?

Software and quality External qualities Qualities the end user can perceive Functional Non functional Internal qualities Qualities related to how the software is organized

External qualities Correctness Usability Efficiency Reliability Integrity Adaptability Accuracy Robustness Source: Steve McConnell - Code Complete

Internal qualities Maintainability Flexibility Portability Re-usability Readability Testability Understandability Source: Steve McConnell - Code Complete

Internal qualities Maintainability Flexibility Portability Re-usability Readability Testability Understandability Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. Source: Steve McConnell - Code Complete

SquaRE ISO 25010 Software product Quality Requirements and Evaluation. An evolution of ISO 9126 (and ISO 14598). Three quality models: software product quality model, data quality model, quality in use model.

ISO 25010 Software product quality (characteristics can be measured internally or externally). Functional suitability Security Reliability Compatibility Performance efficiency Maintainability Operability Portability

ISO 25010 Quality in use Effectiveness Efficiency Satisfaction Safety Usability

Consortium for IT Software Quality (SEI+OMG) Software structural quality: 5 major desirable characteristics of a piece of software needed to provide business value Reliability Efficiency Security Maintainability Size

Consortium for IT Software Quality (SEI+OMG) Software functional quality conformance to explicitly stated functional requirements level of satisfaction experienced by end-users (usability)

Do we need a framework to assess quality? Yes, at times. But most of the times we just want our software to be reusable and designed for change.

OO Principles We design OO systems, so we have to correctly identify our objects and find the right mix of encapsulation, inheritance and polymorphism in order to obtain high-quality software. Principles can be used to guarantee the maximization of software qualities.

OO Principles The critical design tool for software development is a mind well educated in design principles. [Larman].

Design smells Rigidity Fragility Immobility Viscosity Needless complexity Needless repetition Opacity Source: Robert C. Martin - Agile Principles, Patterns, and Practices

Design smells Rigidity Rigidity is the tendency for software to be difficult to change, even in simple ways. A design is rigid if a single change causes a cascade of subsequent changes in dependent modules. The more modules that must be changed, the more rigid the design. Fragility Fragility is the tendency of a program to break in many places when a single change is made. Often, the new problems are in areas that have no conceptual relationship with the area that was changed. Fixing those problems leads to even more problems.

Design smells Immobility A design is immobile when it contains parts that could be useful in other systems, but the effort and risk involved with separating those parts from the original system are too great. This is an unfortunate but very common occurrence. Viscosity Viscosity of the software: some options to make changes in a software system preserve the design; others do not. When the design-preserving methods are more difficult to use than the hacks, the viscosity of the design is high. Viscosity of environment: when the development environment is slow and inefficient.

Design smells Needless Complexity Needless complexity of a design in when it contains elements that aren't currently useful. This frequently happens when developers anticipate changes to the requirements and put facilities in the software to deal with those potential changes. Needless Repetition Copy and paste may be useful text-editing operations, but they can be disastrous code-editing operations. When the same code appears over and over again, in slightly different forms, the developers are missing an abstraction.

Design smells Opacity Opacity is the tendency of a module to be difficult to understand. Code can be written in a clear and expressive manner, or it can be written in an opaque and convoluted manner. Code that evolves over time tends to become more and more opaque with age. A constant effort to keep the code clear and expressive is required in order to keep opacity to a minimum.

SOLID Single responsibility principle Open-closed principle Liskov substitution principle Interface segregation principle Dependency inversion principle

SRP: Single responsibility principle A class should have one, and only one, reason to change. Each responsibility is an axis of change. If a class has more than one responsibility, the responsibilities become coupled. Changes to one responsibility may impair or inhibit the class's ability to meet the others. This kind of coupling leads to fragile designs.

OCP: open-closed principle A class should be open for extension, but closed for modification (1). Can be generalized to: software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification. Failing to respect OCP leads to a change resulting in cascades of changes (rigidity). OCP advises us to refactor our design to avoid that. (1) Bertrand Meyer - Object Oriented Software Construction

Refactoring Refactoring is a disciplined technique for restructuring a software system so that its internal structure is modified without changing its external behavior

LSP: Liskov substitution principle The relation among classes in a hierarchy should be sub-typing What is wanted here is something like the following substitution property: If for each object o1 of type S there is an object o2 of type T such that for all programs P defined in terms of T, the behavior of P is unchanged when o1 is substituted for o2 then S is a subtype of T. (1) (1) Barbara Liskov - Data Abstraction and Hierarchy

LSP: Liskov substitution principle If a method f, accepting as argument a reference to B, misbehaves when is passed a reference to an instance of D, subclass of B, then D is fragile in the presence of f. The Liskov Substitution Principle is one of the prime enablers of OCP.

ISP: interface segregation principle The dependency of one class to another one should depend on the smallest possible interface. Or: clients should not be forced to depend on methods they do not use. Failing to respect this principle can lead to unneeded dependencies and to degenerate implementations of interfaces, causing needless complexity and potential violations of LSP.

DIP: dependency inversion principle Depend upon Abstractions. A) High level modules should not depend upon low level modules. Both should depend upon abstractions. B) Abstractions should not depend upon details. Details should depend upon abstractions.

Layered architectures "All well structured object-oriented architectures have clearly-defined layers, with each layer providing some coherent set of services through a well-defined and controlled interface." [Booch] Layered is a family of very common architectural styles.

Beware of layers A naive application of the layered style can easily lead to a violation of the DIP. A common solution is to make lower layers dependent upon a service interface declared in upper layers.