11:57© 2005-2012, hello2morrow1 Software Sustainability Alexander v. Zitzewitz hello2morrow, Inc.

Slides:



Advertisements
Similar presentations
Design Concepts and Principles
Advertisements

Software Engineering 2003 Jyrki Nummenmaa 1 OBJECT ARCHITECTURE DESIGN These slides continue with our example application, based on the simplified.
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
Metrics for Process and Projects
Stability and Volatility is Software Design H. Rahnama Tutorial in software engineering.
Transitioning to XP or The Fanciful Opinions of Don Wells.
CS350/550 Software Engineering Lecture 1. Class Work The main part of the class is a practical software engineering project, in teams of 3-5 people There.
1 CS115 Class 7: Architecture Due today –Requirements –Read Architecture paper pages 1-15 Next Tuesday –Read Practical UML.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Design Patterns.
1 An introduction to design patterns Based on material produced by John Vlissides and Douglas C. Schmidt.
Chapter 25 More Design Patterns.
From 3 weeks to 30 minutes – a journey through the ups and downs of test automation.
Object-oriented Software Engineering with Reuse Contracts Koen De Hondt, Carine Lucas, Kim Mens, Tom Mens, Patrick Steyaert, Roel Wuyts Programming Technology.
SWE 316: Software Design and Architecture – Dr. Khalid Aljasser Objectives Lecture 11 : Frameworks SWE 316: Software Design and Architecture  To understand.
Team Skill 6: Building the Right System From Use Cases to Implementation (25)
An Introduction to Design Patterns. Introduction Promote reuse. Use the experiences of software developers. A shared library/lingo used by developers.
Architecture GRASP Realization of use cases in interaction diagrams Design class diagram Design ( how )
Design Design and Software Architecture. The design phase The analysis phase describes what the system should be doing The design phase describes how.
Yazd University, Electrical and Computer Engineering Department Course Title: Advanced Software Engineering By: Mohammad Ali Zare Chahooki The Project.
COMP 6471 Software Design Methodologies Winter 2006 Dr Greg Butler
Design engineering Vilnius The goal of design engineering is to produce a model that exhibits: firmness – a program should not have bugs that inhibit.
CSSE 374: More GRASP’ing for Object Responsibilities
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 1: Software and Software Engineering.
SWE © Solomon Seifu ELABORATION. SWE © Solomon Seifu Lesson 12-5 Software Engineering Design Goals.
4/1/05F-1 © 2001 T. Horton CS 494 Object-Oriented Analysis & Design Packages and Components in Java and UML.
Software Engineering Principles. SE Principles Principles are statements describing desirable properties of the product and process.
ECE450 - Software Engineering II1 ECE450 – Software Engineering II Today: Introduction to Software Architecture.
Software Engineering B.Tech IT/II Sem-II Term: Unit-7 PPT SLIDES Text Books:1.Software Engineering, A practitioner’s approach Roger s. Pressman.
SOFTWARE PROCESS AND PROJECT METRICS. Topic Covered  Metrics in the process and project domains  Process, project and measurement  Process Metrics.
1-1 Software Development Objectives: Discuss the goals of software development Identify various aspects of software quality Examine two development life.
02:01© hello2morrow1 Love your Architecture Alexander v. Zitzewitz blog.hello2morrow.com.
Lecture 4 – XP and Agile 17/9/15. Plan-driven and agile development Plan-driven development A plan-driven approach to software engineering is based around.
Software Design Patterns Curtsy: Fahad Hassan (TxLabs)
CSE 303 – Software Design and Architecture
Overview of SAIP and LSSA. Software Architecture in Practice Provides a set of techniques, not a prescriptive method for architectural design. Based on.
Yazd University, Electrical and Computer Engineering Department Course Title: Advanced Software Engineering By: Mohammad Ali Zare Chahooki The Project.
Banaras Hindu University. A Course on Software Reuse by Design Patterns and Frameworks.
Software Design Patterns in Test Automation
1 These slides are designed to accompany Software Engineering: A Practitioner’s Approach, 7/e (McGraw-Hill 2009). Slides copyright 2009 by Roger Pressman.
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
Test Driven Development Introduction Issued date: 8/29/2007 Author: Nguyen Phuc Hai.
CS223: Software Engineering Lecture 18: The XP. Recap Introduction to Agile Methodology Customer centric approach Issues of Agile methodology Where to.
CSHenrik Bærbak Christensen1 Flexibility and Maintainability And their metrics: coupling and cohesion.
Clean Code and How to Achieve Zero Defects Jason Jolley Director, Application Development Micro Strategies, Inc.
Principled N-Tier Design or, a Solution to the Solution Problem Steve | ardalis.com Telerik, Inc.
09:18© , hello2morrow1 Golden Rules to Improve Your Architecture Alexander v. Zitzewitz hello2morrow Inc.
Testing Integral part of the software development process.
Principles of Package Design COMPOSE AT A HIGHER LEVEL OF ABSTRACTION.
Development of Concepts for R&D Management R&D in an Individual Enterprise.
Copyright © Jim Fawcett Spring 2017
Unit - 3 OBJECT ORIENTED DESIGN PROCESS AND AXIOMS
GRASP – Designing Objects with Responsibilities
Software Architecture & Difference from Design
CSE687 - Object Oriented Design class notes Survey of the C++ Programming Language Jim Fawcett Spring 2004.
Software Engineering B.Tech Ii csE Sem-II
Copyright © by Curt Hill
CSE 403 Software Engineering
Software Quality Engineering
Software Maintenance
Principles of Package Architecture
Design Tips.
Software Design Lecture : 8
CSE 303 Concepts and Tools for Software Development
Baisc Of Software Testing
OBJECT ARCHITECTURE DESIGN
Better Architecture Management Made Easy
Dependency Inversion principle
Logical Architecture & UML Package Diagrams
Presentation transcript:

11:57© , hello2morrow1 Software Sustainability Alexander v. Zitzewitz hello2morrow, Inc.

Code Quality? Yes please, if it is free… Do you have binding rules for code quality? Do you measure quality rule violations on a daily base? Is your architecture defined in a formal way? Do you measure architecture violations on a daily base? Does quality management happen at the end of development? Do you think, that more needs to be done in that area and that this would be beneficial for the team and the company? © , hello2morrow2

Part I: Symptoms of Structural Erosion 11:57© , hello2morrow3

11:57© , hello2morrow4 Erosion of Architecture – Symptoms (Robert C. Martin) Rigidity – The system is hard to change because every change forces many other changes. Fragility – Changes cause the system to break in conceptually unrelated places. Immobility – It's hard to disentangle the system into reusable components. Viscosity – Doing things right is harder than doing things wrong. Opacity – It is hard to read and understand. It does not express its intent well. Overall: “The software starts to rot like a bad piece of meat”

11:57© , hello2morrow5 Erosion of Architecture – Reasons System knowledge and skills are not evenly distributed Complexity grows faster than system size Unwanted dependencies are created without being noticed Coupling and complexity are growing quickly. When you realize it, it is often too late Most projects don’t measure quality on a regular base Management considers software as a black box Quality measurement is done at the end of development Time pressure is always a good excuse to sacrifice structure The Law of Entropy?

Cost of Structural Erosion / Technical Debt 11:57© , hello2morrow6

Part II: Technical Quality and Sustainability © , hello2morrow7

How to Define Technical Quality? “Technical quality of software can be defined as the level of conformance of a software system to a set a set of rules and guidelines derived from common sense and best practices. Those rules should cover software architecture, programming in general, testing and coding style.” Technical quality cannot be achieved by testing only Technical quality manifests itself in very line of code Four aspects of technical quality: Architecture / Dependency-Structure Software metrics Programming rules Testability and test coverage Which of those aspects has the biggest cost impact? Measuring of technical quality requires static analysis © , hello2morrow8

How to Achieve Software Sustainability? Sustainability cannot be achieved without the implementation of rules and guidelines Achieving sustainability requires effort and this effort needs to be considered in iteration planning. By investing a relatively small additional effort today a huge future effort can be avoided. On the short term, building sustainable software always costs more. On the long term it can reduce the overall cost of a project by more than 50%. Many projects suffer from being short-sighted. Mostly there is no long term planning or strategy in place to achieve a sustainable code base. Typically it is sufficient to spend about 20% of the time available in each iteration on sustainability © , hello2morrow9

Sustainability and Technical Quality Sustainability and technical quality are two sides of the same coin. Technical quality is a precondition for changeability, maintainability, testability and extensibility. Investments in technical quality only pay off in the medium and long term, but the return on investment is close to astronomical © , hello2morrow10

11:57© , hello2morrow11 Your System User Interface Business Logic Data Access How to model Architecture Step 1: Cut horizontally into Layers Step 2: Cut vertically into vertical slices by functional aspects ContractsCustomerUserCommon Step 3: Defines the rules of engagement Natural subsystems

11:57© , hello2morrow12 How to measure coupling ACD = Average Component Dependency Average number of direct and indirect dependencies rACD = ACD / number of elements NCCD: normalized cumulated component dependency CCD = 15 ACD = 15/6 = 2, Dependency Inversion ACD = 12/6 = Cycles ACD = 26/6 = 4,33

11:57© , hello2morrow13 How to keep the coupling low? Dependency Inversion Principle (Robert C. Martin) Build on abstractions, not on implementations Best pattern for a flexible architecture with low coupling Have a look at dependency injection frameworks (e.g. Spring)

11:57© , hello2morrow14 Architecture metrics of Robert C. Martin D i = Number of incoming dependencies D o = Number of outgoing dependencies Instability I = D o / (D i +D o ) Build on abstractions, not on implementations X is „stable“ Y is „instable“

11:57© , hello2morrow15 Abstractness (Robert C. Martin) N c = Total number of types in a type container N a = Number of abstract classes and interfaces in a type container Abstractness A = N a /N c

11:57© , hello2morrow16 D = A + I – 1 Value range [ ] Negative values are in the „Zone of pain“ Positive values belong to the „Zone of uselessness“ Good values are close to zero (e.g. -0,25 to +0,25) „Distance“ is quite context sensitive Metric „distance“ (Robert C. Martin)

Cyclical Dependencies are Harmful "Guideline: No Cycles between Packages. If a group of packages have cyclic dependency then they may need to be treated as one larger package in terms of a release unit. This is undesirable because releasing larger packages (or package aggregates) increases the likelihood of affecting something." [AUP] "The dependencies between packages must not form cycles." [ASD] "Cyclic physical dependencies among components inhibit understanding, testing and reuse. Every directed a-cyclic graph can be assigned unique level numbers; a graph with cycles cannot. A physical dependency graph that can be assigned unique level numbers is said to be levelizable. In most real-world situations, large designs must be levelizable if they are to be tested effectively. Independent testing reduces part of the risk associated with software integration " [LSD]

Example: Cyclical Dependency AlarmClock AlarmHandler PresentationModel Main AlarmToConsole AlarmToFile

Breaking the Cycle AlarmClock AlarmHandler Main > IAlarmHandler AlarmToConsole AlarmToFile Presentation > Model

Another Cyclical Dependency Customer ___________________ Order[] listOrders() { …} OrderCustomer Order __________________ Customer cust;

Cycle broken... Customer ___________________ OrderCustomer Order __________________ Customer cust; static Order[] listOrders(Customer c) { …}

Consequences of Structural Erosion © , hello2morrow22

Metric “Structural Debt Index” Packages that are part of package cycle groups are sorted by calculating the difference between outgoing and incoming dependencies. Special rules for draws. Packages with more outgoing dependencies are above packages with more incoming dependencies All upward going dependencies are considered bad SDI = 10 * (type dependencies to cut) + (code refs of dependencies to cut) Metric should give an idea how difficult it is to clean up a tangled mess © , hello2morrow23

Part III: How to Implement Sustainability © , hello2morrow24

Improvements Require Transparency Six Sigma for Software DefineMeasureAnalyzeImproveControl © , hello2morrow25

Preconditions for Sustainability Nothing can be delivered that does not meet the standards defined fro technical quality. Rules and guidelines are documented and checked in an automated way. Each project needs to defined an architectural model. Cyclical dependencies have to be avoided. Quality metrics and checking for rule violations are part of the daily/nightly build. Quality criteria are a core component of development guidelines. Sustainability as a goal must be supported by all management levels © , hello2morrow26

11:57© , hello2morrow27 Some Simple Rules for Sustainable Projects Rule 1: Define a cycle free logical architecture down to the level of subsystems and a strict and consistent package naming convention Rule 2: Do not allow cyclic dependencies between different packages Rule 3: Keep the relative ACD low (< 7% for 500 compilation units, NCCD < 6) Rule 4: Limit the size of Java files (700 LOC is a reasonable value) Rule 5: Limit the cyclomatic complexity of methods (e.g. 15) Rule 6: Limit the size of a Java package (e.g. less than 50 types)

DZone’s “Designing Quality Software” Refcard © , hello2morrow28 Refcard #130:

Relevant White-Papers: © , hello2morrow29 Download from

11:57© , hello2morrow30 Awards and nominations Second prize of Jax innovation award in April 2007 Nomination for European ICT prize 2007 Awarded as most exciting innovation on Systems 2005

Q & A Some of our more than 300 customers:

Q & A My Address: © , hello2morrow32