Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Object-Oriented Design in Practice. Could/Should We Do Better? Dr. Radu Marinescu Timişoara, 12.02.2003 Object-Oriented Design in Practice. Could/Should.

Similar presentations


Presentation on theme: "1 Object-Oriented Design in Practice. Could/Should We Do Better? Dr. Radu Marinescu Timişoara, 12.02.2003 Object-Oriented Design in Practice. Could/Should."— Presentation transcript:

1 1 Object-Oriented Design in Practice. Could/Should We Do Better? Dr. Radu Marinescu Timişoara, 12.02.2003 Object-Oriented Design in Practice. Could/Should We Do Better? Dr. Radu Marinescu

2 2 Object-Oriented Design in Practice. Could/Should We Do Better? Dr. Radu Marinescu Timişoara, 12.02.2003 Problems with (Object-Oriented) Design  From Dreams to Reality  Dreams: object-oriented mechanisms will automatically increase the quality of software  e.g. make systems easier to maintain or reuse  Reality: uncountable number of OO legacy systems in the industry  inflexible, hard to understand, hard to extend…  Why?  Time Pressure  Changing Requirements  Immature Developers

3 3 Object-Oriented Design in Practice. Could/Should We Do Better? Dr. Radu Marinescu Timişoara, 12.02.2003 Design and Quality  …“Design is hard ” [Opdyke92]  Object-oriented design makes no exception...  Quality is in danger Pressure of the market to control of quality but…  …“ You can’t control what you can’t measure ” [DeMarco82]  What should we measure?  How should we measure? Software needs design but…

4 4 Object-Oriented Design in Practice. Could/Should We Do Better? Dr. Radu Marinescu Timişoara, 12.02.2003 Design Flaws…  Design problems are frequent  legacy systems with high business value  must maintain and enhance the system  Design problems are expensive  high effort required for maintenance and extension  Design problems will always be there!  at least because of time pressure.  …but I believe also because of changing requirements Why care?... are malign characteristics of design entities  hinder the maintenance and evolution of the system  by violating the principles and rules of good (OO) design

5 5 Object-Oriented Design in Practice. Could/Should We Do Better? Dr. Radu Marinescu Timişoara, 12.02.2003...you would change just a small design fragment and suddenly......33% of all the classes in the system may require changes?! Just Imagine that...

6 6 Object-Oriented Design in Practice. Could/Should We Do Better? Dr. Radu Marinescu Timişoara, 12.02.2003  But there is hope!  Design rules, guidelines and heuristics  Apply them and they will provide the desired quality  Break them and they will break your design! Is There Any Hope?  “There is no silver bullet!” [Brooks84]  Encapsulation? Inheritance? Polymorphism?  NO! These are just mechanisms  Like in chess...  … just knowing the pieces and the moves is not enough Hard to control, because rules are hard to quantify! How could we control the usage of design rules ?

7 7 Object-Oriented Design in Practice. Could/Should We Do Better? Dr. Radu Marinescu Timişoara, 12.02.2003 Detection of Design Problems Problem Detection  The process of identifying the parts of a software system affected by a particular design flaw  It‘s not easy!  manual and empirical  time-expensive and non-scalable "Measuring" the Design  map source-code entities to numerical values  used as quality indicators Idea: Use metrics to detect design problems!

8 8 Object-Oriented Design in Practice. Could/Should We Do Better? Dr. Radu Marinescu Timişoara, 12.02.2003 Problems with Software Measurement Definitions of Metrics Mapping attributes of a software product to numeric values [Fent97] Imprecise, confusing, or conflicting definitions Interpretation Models Not provided or hardly reusable in a different context Interpretation level is too fine-grained to lead to design decisions metrics values are like symptoms indicate an abnormality, but can’t indicate the cause reduces the relevance of measurement results There is a large gap between what we do measure and what we should measure! Need mechanism for higher-level interpretation of metrics!

9 9 Object-Oriented Design in Practice. Could/Should We Do Better? Dr. Radu Marinescu Timişoara, 12.02.2003 The measurable expression of a rule, by which design fragments that are conformant to the rule can be identified in the source-code Detection Strategy  Generic mean for defining metrics-based design rules  use metrics together!  Based on mechanisms of filtering and composition  Filtering Mechanism  Statistical functions that return a subset of a data-set  Composition Operators  articulate the composition of a detection rule

10 10 Object-Oriented Design in Practice. Could/Should We Do Better? Dr. Radu Marinescu Timişoara, 12.02.2003 Defining a Detection Strategy Analysis Detection Technique Select Metrics Detection Strategy Informal Rules (design-related) Top-level classes in a design should share work uniformly Beware of classes with much non-communicative behavior Beware of classes that access directly data from other classes access many “foreign” data large and complex classes or non-cohesive AOFD TopValues(20%) and... WMC HigherThan(30) or TCC LowerThan(0.33)

11 11 Object-Oriented Design in Practice. Could/Should We Do Better? Dr. Radu Marinescu Timişoara, 12.02.2003 Classification of Design Flaws

12 12 Object-Oriented Design in Practice. Could/Should We Do Better? Dr. Radu Marinescu Timişoara, 12.02.2003 ProDeOOS at Work...

13 13 Object-Oriented Design in Practice. Could/Should We Do Better? Dr. Radu Marinescu Timişoara, 12.02.2003 Sources (Java, C++) Meta-Model parsing using Metrics Detection Strategy (*.sod) Statistical Filters 1.. n 1.. m executing with PRODEOOS List of Candidates manual inspection Process of Design Inspection

14 14 Object-Oriented Design in Practice. Could/Should We Do Better? Dr. Radu Marinescu Timişoara, 12.02.2003 Summary  Design flaws are dangerous the larger the system, the higher the risk  We can assess the quality of design by measuring its conformance to principles of OO design  Ability to detect a significant set of design flaws at all levels, from methods to subsystems  Strong tool support for the entire approach high degree of automatization and scalability

15 15 Object-Oriented Design in Practice. Could/Should We Do Better? Dr. Radu Marinescu Timişoara, 12.02.2003 Could We Do Better... for You?  Approach successfully applied on industrial systems  > 100.000 LOC and up to 5.000.000 LOC  proved to be scalable and accurate  Concepts already implemented in two important CASE tools  metrics (since 2001) and detection strategies (since 2002) metricsdetection strategies  in Borland Together CC and WSE  second important CASE tool provider interested in implementing the concepts.  Consultancy for software companies on quality assurance and re-engineering  all over Europe, for the last 3.5 years ! This is not just about science and research!

16 16 Object-Oriented Design in Practice. Could/Should We Do Better? Dr. Radu Marinescu Timişoara, 12.02.2003 Should We Do Better... Together?


Download ppt "1 Object-Oriented Design in Practice. Could/Should We Do Better? Dr. Radu Marinescu Timişoara, 12.02.2003 Object-Oriented Design in Practice. Could/Should."

Similar presentations


Ads by Google