REUSE--1 A Framework, Methodology and Tool for Reusable Software Components* Prof. Steven A. Demurjian, Sr., Jeffrey R. Ellis, Rodrigo Caballero, Felix.

Slides:



Advertisements
Similar presentations
Ch:8 Design Concepts S.W Design should have following quality attribute: Functionality Usability Reliability Performance Supportability (extensibility,
Advertisements

Ch4: Software Architecture and Design. 1 Object-oriented paradigm  Object-oriented decomposition:  Agents comprised of two parts:  Hidden implementation:
REUSE--1 A Framework, Methodology and Tool for Reusable Software Components Prof. Steven A. Demurjian Computer Science & Engineering Department The University.
10 Software Engineering Foundations of Computer Science ã Cengage Learning.
The design process IACT 403 IACT 931 CSCI 324 Human Computer Interface Lecturer:Gene Awyzio Room:3.117 Phone:
Framework is l Reusable Code, often domain specific (GUI, Net, Web, etc) l expressed as l a set of classes and l the way objects in those classes collaborate.
Object-Oriented Application Development Using VB.NET 1 Chapter 5 Object-Oriented Analysis and Design.
© 2005 by Prentice Hall Appendix 2 Automated Tools for Systems Development Modern Systems Analysis and Design Fourth Edition Jeffrey A. Hoffer Joey F.
CSE298 CSE300 Overview of Presentation Reuse Background Reuse Background Development Process Development Process Component-Based Development Component-Based.
Unified theory of software evolution Reengineering – Business process reengineering and software reengineering BPR model – Business definition, process.
Introduction To System Analysis and Design
Fall 2007CS 225 Introduction to Software Design Chapter 1.
REUSE--1 A Framework, Methodology and Tool for Reusable Software Components* † Special Thanks to Jeff Ellis, Rodrigo Caballero, Margie Price, Donald Needham.
Copyright 2002 Prentice-Hall, Inc. Chapter 4 Automated Tools for Systems Development 4.1 Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer.
REUSE--1 A Framework, Methodology and Tool for Reusable Software Components* Prof. Steven A. Demurjian, Sr., Jeffrey R. Ellis, Rodrigo Caballero, Felix.
Reuse-1 CSE298 CSE300 CSE Distributed Object Computing Professor: Dr. Steven A. Demurjian Topic: Object Oriented Reuse Members: Xiaopei Wang, Hai.
System Engineering Instructor: Dr. Jerry Gao. System Engineering Jerry Gao, Ph.D. Jan System Engineering Hierarchy - System Modeling - Information.
Ch4: Software Architecture and Design. 1 The role of analysis and design  Software construction may be partitioned into the following phases:  Req.
Ch4: Software Architecture and Design. 1 How to choose objects and classes  The first and most often raised concern for newcomers to OO concepts  Typical.
UTECA 3/26/99 CSE.RU-1.1 Object-Oriented Design Methodology to Facilitate Reuse Prof. Steven A. Demurjian and Dr. Margaretha W. Price† Computer Science.
Introduction to Software Design Chapter 1. Chapter 1: Introduction to Software Design2 Chapter Objectives To become familiar with the software challenge.
The chapter will address the following questions:
Chapter 7: The Object-Oriented Approach to Requirements
CASE Tools And Their Effect On Software Quality Peter Geddis – pxg07u.
The Design Discipline.
Database System Development Lifecycle © Pearson Education Limited 1995, 2005.
Systems Analysis – Analyzing Requirements.  Analyzing requirement stage identifies user information needs and new systems requirements  IS dev team.
Chapter 2 The process Process, Methods, and Tools
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 12 Object-Oriented.
SWE 316: Software Design and Architecture – Dr. Khalid Aljasser Objectives Lecture 11 : Frameworks SWE 316: Software Design and Architecture  To understand.
ITEC224 Database Programming
An Introduction to Software Architecture
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 4 Slide 1 Software Processes.
An Introduction to Design Patterns. Introduction Promote reuse. Use the experiences of software developers. A shared library/lingo used by developers.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 20 Object-Oriented.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 09. Review Introduction to architectural styles Distributed architectures – Client Server Architecture – Multi-tier.
 CS 5380 Software Engineering Chapter 2 – Software Processes Chapter 2 Software Processes1.
Introduction To System Analysis and Design
Design engineering Vilnius The goal of design engineering is to produce a model that exhibits: firmness – a program should not have bugs that inhibit.
Assessing the influence on processes when evolving the software architecture By Larsson S, Wall A, Wallin P Parul Patel.
Chapter 10 Analysis and Design Discipline. 2 Purpose The purpose is to translate the requirements into a specification that describes how to implement.
7 Systems Analysis and Design in a Changing World, Fifth Edition.
Part VII: Design Continuous
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
Object-Oriented Analysis and Design CHAPTERS 9, 31: DOMAIN MODELS 1.
Human Computer Interaction
MODEL-BASED SOFTWARE ARCHITECTURES.  Models of software are used in an increasing number of projects to handle the complexity of application domains.
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
Testing OO software. State Based Testing State machine: implementation-independent specification (model) of the dynamic behaviour of the system State:
Copyright 2002 Prentice-Hall, Inc. Chapter 4 Automated Tools for Systems Development 4.1 Modern Systems Analysis and Design.
Chapter 4 Automated Tools for Systems Development Modern Systems Analysis and Design Third Edition 4.1.
Topic 4 - Database Design Unit 1 – Database Analysis and Design Advanced Higher Information Systems St Kentigern’s Academy.
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 4 Slide 1 Software Processes.
Object-Oriented Application Development Using VB.NET 1 Chapter 5 Object-Oriented Analysis and Design.
Lecture 21: Component-Based Software Engineering
Ch4: Software Architecture and Design. 1 Categories of classes Data Managers: class Item { private: // Private Data int UPC; char* Name; int InStock,
LECTURE 5 Nangwonvuma M/ Byansi D. Components, interfaces and integration Infrastructure, Middleware and Platforms Techniques – Data warehouses, extending.
Elaboration popo.
Modern Systems Analysis and Design Third Edition
Object-Oriented Software Engineering Using UML, Patterns, and Java,
Chapter 11 Object-Oriented Design
Modern Systems Analysis and Design Third Edition
Tools of Software Development
Chapter 4 Automated Tools for Systems Development
Modern Systems Analysis and Design Third Edition
Chapter 20 Object-Oriented Analysis and Design
Modern Systems Analysis and Design Third Edition
CS310 Software Engineering Lecturer Dr.Doaa Sami
Modern Systems Analysis and Design Third Edition
Presentation transcript:

REUSE--1 A Framework, Methodology and Tool for Reusable Software Components* Prof. Steven A. Demurjian, Sr., Jeffrey R. Ellis, Rodrigo Caballero, Felix Eickhoff, Shaikit Das, and Xiaopei Wang Computer Science & Engineering Department The University of Connecticut Prof. Donald M. Needham Computer Science Department U.S. Naval Academy (860) *Work supported in part by a grant from Electric Boat, Inc., Groton, CT.

REUSE--2Motivation  Reuse Afterthought in OO Design/Development  Majority of Reuse Focuses on “Small” Components with Minimal Savings  String Functions, Utility Routines, GUI, etc.  Easy to Understand - Easy to Reuse  “Beans” Have Improved Reuse - Still Lagging  Three Classes of Software  Domain-Independent (20%) : Libraries, Utilities, etc. Most Likely to Be Reused  Domain-Specific (65%) : Dedicated Software Reused in Other Programs of Same Domain  Application-Specific (15%): Uniqueness Unlikely to Be Reused

REUSE--3Motivation  Popular OO Design Methodologies Omit and Ignore Reuse Guidelines  Unified Modeling Language - UML  Design Patterns - Reuse Pattern/Not Software  Current Research Concentrates on Consumer (Reuser) and Not Producer (Creator)  Measure Savings from Reuse  Calculate Return on Investment  Two-Fold Goal  Elevate Reuse to Equal Partner Starting with Design  Focus on Domain-and-Organization Specific Reuse

REUSE--4Motivation

REUSE--5 Motivation Why Software Reuse?  Increase Software Productivity  Shorten Software Development Time  Improve Software System Interoperability  Develop Software With Fewer People  Move Personnel More Easily From Project to Project  Reduce Software Development and Maintenance Costs  Produce More Standardized Software  Produce Better Quality Software  Provide a Powerful Competitive Advantage

REUSE--6Objectives  Reuse as Equal Partner Starting with Design  Iterative Reusability Evaluations at Early and All Stages of Design and Development  Production of Large Reusable Components  Capabilities of Evaluation Techniques  Identify the Reusable Portions of Design  Estimate/Measure Reusability Automatically  Provide Guidelines on Improving Reusability  Usable for  Newly Created Designs  Evaluation of Legacy Code for Reuse Potential  Integrated in a Design/Development Environment

REUSE--7 Overview of Presentation  Cultural and Social Reuse Issues  Component-Based Design - History & Perspective  Reuse Framework and Methodology  Subjective Identification of Components  General vs. Specific Classes  Related Hierarchies to Quantify Components  Objective Measure of Dependencies  Classifying Dependencies  Measuring Reuse Potential  Reuse Guidelines  Methodological Basis for Increasing Reuse  Iterative Improvement in Reusability  Prototyping: DRE Tool Family/Examples  Conclusions and Future Research

REUSE--8 Cultural and Social Reuse Issues Management Support  Motorola Study: A New Reuse Program there must have Strong/Unequivocal Management Support  Raytheon Report: Support from Upper Management Most Important for Successful Reuse  Why? Increased  Cost Associated with Constructing Reusable Components  Communication, Coordination  Education, Training  Motorola and Raytheon Facilitate by Incentives  Both Producer and Consumer Benefits  Awards Provided for Demonstrated Efforts

REUSE--9 Cultural and Social Reuse Issues High Initial Cost  Reports have Indicated  High Start Up Costs  Slow Return on Investment (> 3 years)  Best Success in  Starting with Small Projects  Distributing Components for Reuse  Opportunistic Reuse  Reuse Must be Supported by  Libraries to Collect, Classify, and Disseminate Components  Ease of use for Producer and Consumer

REUSE--10 What are Components?  ADTs as Unit of Abstraction/Conceptualization  Classes are OO Equivalent of ADTs  However, in Past 10 Years  Computing Power has Exploded  Application Complexity has Increased  Classes are Part of Inheritance Hierarchy  Inheritance Hierarchy Part of Application Class Library  In Past 2-3 Years We’ve Seen  Emergence of Java  Emergence of Java Beans  Component-Based Development Tools

REUSE--11 What are Components?  How are Applications Conceptualized?  Inheritance Hierarchies Partition Domain  Packages as Collections or Related Classes  Collections of Classes, Packages, Inheritance Hierarchies form Application Class Library  How are Class Libraries Utilized?  Use Individual Classes  Use Package or Subset of Package  Use Major Portions of Inheritance Hierarchies  Tools Use at Most a “Few” Select Packages and/or Hierarchies  Tools that Span Application Classes Represent Poorly Designed Software

REUSE--12 Defining Component Concepts  A Component is Composed of One or More Classes (or Other Components) and is Intended to Support a “Constructed” Unit of Functionality  Classes Can be Utilized in Multiple Components  A Class Utilized in Multiple Components Maintains the “Same” Semantics in All of its Contexts  Our Interest Involves:  Reusable Classes  Reusable Components  A Reusable Component Consists of Classes and/or Other Components that are Expected to be Reused Together in Future Applications

REUSE--13 Cultural and Social Reuse Issues Reuse and Software Design/Development  Lesson Learned  Reuse Often Avoided by SW Engineers due to Fear of Configuration Management Problems  How is Fear Minimized?  Reuse as Integral Part of Development Process  Reuse Early and Often  Tools that Facilitate Producer Logging Component and Consumer Finding Component  Summary  We’ll Concentrate on Technical Reuse Issues  Superior Techniques Will Remain Unpopular and Unused without Associated Support

REUSE--14 Components vs. Objects  Components  Business Oriented  Coarse Grained  Standards Based  Multiple Interfaces  Provide Services  Fully Encapsulated  Understood by Everyone  Objects  Technology-Oriented  Fine Grained  Language Based  Single Interface  Provide Operations  Use Inheritance  Understood by Developers

REUSE--15 Reusable Components Types & Benefits Reusable Components Types & Benefits  Application Template  Data Model  Data Structure  System Architecture  Process Model  Process Definition  Prototype  Plan Skeleton  User Interface Skeleton/GUI  Process Skeleton  Utility Components  Organizational Perspective  Shorten Development Time  Reduce Costs  Increase Competitiveness  Personnel Perspective  Increase Productivity  Customer Perspective  Achieve Greater User Satisfaction Through the Production of More Flexible Products

REUSE--16 Component-Based Development Process TOP-DOWN: To determine what is needed to satisfy this need. BOTTOM-UP: To determine what is available to satisfy this need. OTHERS: Consider the similarity among concurrent projects. FUTURE: Consider the possibility of reusing in future projects.

REUSE--17 CBD: Component-Based Development

REUSE--18 Supplier /Consumer Model SUPPLY Build New Wrap Existing Buy CONSUME Assemble Applications MANAGE Publish Subscribe Catalog Browse

REUSE--19 Specification Implementation Executable Interfaces Component

REUSE--20 Components as Assets can Grow Complexity of Component

REUSE--21 What are Component Dependencies?  Dependency Type of Components  Versions  Aggregations  Functional  Inheritance  Association  What is Impact of Each Dependency on the Reusability of a Component?

REUSE--22 Component-Based Tools/Web Sites of Note  Software Composition Workbench  JavaBeans  Visual Café  Visual J++  Sun’s Forte  Enabler, Softlab  Microsoft Repository  UREP, Unisys  Select Software Tools, Select  Reusable Software Research Group, West Virginia University  rg-brochure-nov-98.html rg-brochure-nov-98.html  Reusable Software Research Group, Ohio State University  state.edu/rsrg/index.html state.edu/rsrg/index.html  Select Software Tools   Software Reuse Executive Primer, DOD  hist/primer/ hist/primer/  Model-Driven Software Reuse, Extended Intelligence Inc.

REUSE--23 RepositoryBrowserHierarchy Component Repository

REUSE--24 Multiple Repository Support Multiple Support

REUSE--25 CBD life cycle BusinessDirection General Business Requirements User, Business and Data services Business and Data services ComponentRequirements UserServices Harvest

REUSE : $652 million 2001: $12 billion IDC forecast CBD market

REUSE--27 Web-Site References  Reusable Software Research Group, West Virginia University  nov-98.html nov-98.html  Reusable Software Research Group, Ohio State University   Select Software Tools   Software Reuse Executive Primer, DOD   Model-Driven Software Reuse, Extended Intelligence Inc.

REUSE--28 A Framework, Methodology, and Tool for Reusable Software Components  Reuse as Equal Partner Starting with Design  Iterative Reusability Evaluations at Early and All Stages of Design and Development  Production of Large Reusable Components  Capabilities of Evaluation Techniques  Identify the Reusable Portions of Design  Estimate/Measure Reusability Automatically  Provide Guidelines on Improving Reusability  Usable for  Newly Created Designs  Evaluation of Legacy Code for Reuse Potential  Independent Tool/Integrated in Together CC  See:

REUSE--29 A Framework, Methodology, and Tool for Reusable Software Components 1. Define Components, Their Interactions, and Analyze Their Reusability 2. Store an Iteration of Design 3. Implement an Iteration 4. Store and Document Iteration of Implemen. 5. Reevaluate an Existing Design for  Correcting Errors  New Reuse Potential 6. Reuse Existing Design with a New Implementation Store & Document Designs Reusability Evaluation Implement the System Re(Design) a System Store & Document Implemens

REUSE--30 Subjective Identification of Components  Reuse Historically Occurs at Class Level  Class as “Atomic” Component only Scratches Surface in Reuse Potential for OO  But, Classes Interact  If Reuse One, Often Need Others  Thus, Reuse Set of Classes  Expand Reuse from Class to Component Level  Establish Framework for Promoting Design Reuse  Characterize General vs. Specific Classes  Quantify Related Components  Illustrate via HTSS and Financial Frame Applications  Goal: Increase Reuse Potential by Understanding Classes, Components, and their Role within Appl.

REUSE--31 General/Specific Class Characterization  Subjective Characterization by Software Designer  Best Estimate on Potential Utility of Class  General Class (G)  Those Application Classes that Facilitate Domain-and-Organization Specific Reuse  Specific Class (S)  Those Application Classes that are Limited to use in a Single Application  Purposes  Determine Classes with Highest Reuse Potential for Organization’s Future Systems  Dependencies from General to Specific are both Non-Reusable and Hinder Reuse

REUSE--32 General/Specific Class Characterization  General Class (G)  Expected to be Reused in Future Applications  Abstract Classes/Root Classes/Non-Leaf Classes in Inheritance Hierarchies  Domain Independent/Domain Specific  What are Some Examples?  Specific Class (S)  Only Applicable in Current Applications  Unlikely to be Reused in Future Applications  Classes that Retrieve from Company Database  Application Specific  What are Some Examples?

REUSE--33 High-Tech Supermarket System (HTSS)  Automate the Functions and Actions  Cashiers and Inventory Updates  User Friendly Grocery Item Locator  Fast-Track Deli Orderer  Inventory Control  User System Interfaces  Cash Register/UPC Scanner  GUI for Inventory Control  Shopper Interfaces Locator and Orderer  Deli Interface for Deli Workers   We’ll Introduce and Utilize Throughout Lecture

REUSE--34 The HTSS Software Architecture IC IC CR CR CR CR IL IL IL SDO SDOEDO EDO Order Payment Item ItemDBLocalServer Non-Local Client Int.InventoryControl ItemDBGlobalServerOrderDB SupplierDB CreditCardDB ATM-BanKDB IL: Item Locator CR: Cash Register IC: Invent. Control DO: Deli Orderer for Shopper/Employee Shopper/Employee

REUSE--35 A General Class in HTSS  Why is Item General?  What is Applicability of Item? class Item { private: // Private Data int UPC; char* Name; int InStock, OnShelf, ROLimit; float RetailCost; public: // Public Methods Item(int code, char* str, int st1, int st2, int st3, float cost); void CreateNewItem(); int GetUPC(); char* GetName(); int GetQuantity(); int CheckReorderStatus(); void PrintItem(); void UpdatePrice(float new_value); };

REUSE--36 Another General Class in HTSS  Collection Classes of General Classes are General class ItemDB {private: int Num_Items; int Curr_Item; Item* AllItems[Max_Items]; int FindFirstItem(); int FindNextItem(); int FindItemUPC(int code); int FindItemName(char* name); public: ItemDB(); // Constructor void InsertNewItem(Item* new_one); void DeleteExistingItem(int code); void FindDisplayItemUPC(int code); void FindDisplayItemName(char* name); void PrintAllItems(); };

REUSE--37 Yet Another General Class in HTSS  GUI-Based Class for Supporting Inventory Control Actions Can be Domain Independent class InvControlGUI { private: int Curr_Option; // Current menu option public: InvControl(); // Constructor void PrintMenuSetOption(); void ActivateController(); void EnterNewItem(); void RemoveExistingItem(); void FindItem(); void InvSearchQuantity(); void InvSearchReorder(); void GenerateAnOrder(); };

REUSE--38 Specific Classes in HTSS  General Classes are Refined to Represent Particular Items, Yielding Specific Classes... Item DairyItemProduceItemDeliItem DeliOrdererGUI OrdererGUI

REUSE--39 Levels of General Classes  Not All General Classes Created Equally  Level of Generality Based on Role in Application  Purposes  Accommodate Large Systems with Multiple, Different Reusable Components  Reusable Components can Overlap, but Still be Distinct Reusable Units S S S S views as General if i j views as Specific if i < j

REUSE Can you Identify Different Levels of General Classes? Item DairyItemProduceItemDeliItem NonPerishItemPerishItem

REUSE Can we Identify Different Levels of General Classes? DairyItemDeliItem Item ProduceItem NonPerishItemPerishItem BigYProdItemDoleProdItemBigYDairyItemHoodDairyItem Where can Item be Reused? Where can NonPerishItem and PerishItem be Reused? Where can ProduceItem and DairyItem be Reused? Are DoleProdItem and HoodDairyItem Specific?

REUSE--42 Properties of General/Specific Classes  Level of Generality Strictly Ordered in Hierarchy  A Descendant of a General Class Must have an Index Greater Than or Equal to Itself or be Specific  A Specific Class Can only have Specific Descendants S S S S views as General if i j views as Specific if i < j

REUSE--43 Generality and Specificity within One Inheritance Hierarchy

REUSE--44 Generality/Specificity/Dependencies Across Multiple Hierarchies

REUSE--45 General/Specific Paradigm in HTSS  Abstraction from HTSS to Domain Independent Inventory Control Application  Separation of Supermarket Domain Specifics  Leverage Commonalties for  Focused, Independent Design/Development  Future Products  Relevance  Domain-and-Organization-Specific Reuse  Expand to 24 hour Mom & Pop Stores  Expand to Other Retail Markets E.g., Auto parts, Clothing, Toy, etc.

REUSE--46 Reusability in HTSS Domain  Where do Changes for Other Domains Occur? Specific Applications for Big Y or Shaw’s or Stop/Shop (S) Root classes for Items, ItemDB, etc., which are Most General. Inventory Control/Other Components. Classes Specific to Grocery Store Domain.

REUSE--47 Reusability in HTSS Domain Specific Applications for Big Y or Shaw’s or Stop/Shop (S) Root classes for Items, ItemDB, etc., which are Most General. Inventory Control Other Components. Classes Specific to Grocery Store Domain. Inventory Control Tool for Ordering Items from Suppliers Cost Accounting Tool for Tracking Net and Gross Profit

REUSE--48 Reusability in HTSS Domain Specific Applications for Big Y or Shaw’s or Stop/Shop (S) Root classes for Items, ItemDB, etc., which are Most General. Inventory Control/Other Components. Classes Specific to Grocery Store Domain. Classes for Large Supermarket Classes for Specialty Supermarket Classes for 24 Hour Convenience

REUSE--49 The FinancialFrame Application  A Commercial C++ Framework Containing 441 Classes, Proprietary of FinancialComp  Designed for Reuse in Various Financial Apps.  Provides Basic Functionalities of Financial System  FinancialFrame’s Challenge - Manage Changes  Framework Constantly Evolving  New Functions and Modify Existing Functions  Conceptual Relevance:  Provide Realistic Context for Our Approach  Domain-and-Organization-Specific Reuse

REUSE--50 The FinancialFrame Application  Our Purpose: Work with Existing Code  Establish General and Specific Classes  Characterize Related Components  Evaluate the Goodness of G/S Characterization and Identify Potential Problem Areas  General Components that are Specific  Specific Components that are General  Problematic Relevance:  Demonstrate Ability of Approach to Localize Effect of Changes  Describe Ways to Increase FinancialFrame’s Reuse Potential

REUSE--51 General and Specific Classes in FinancialFrame FinancialCompTrader FinancialCompAccount FinancialCompDesk Main FinancialCompMainOtherMain SpecificFCMain (S) SpecificOtherMain (S)... YieldModel DiscountIndexBondBill CashFlowAnalyzer...

REUSE--52 Related Classes and Hierarchies  Class X is Related to Class Y if they are Related and Concept and are Expected to be Reused Together in Future Systems  Class X Related to Class Y is Subjectively Assigned by Software Engineer (Producer)  When Class X is Related to Class Y  X and All of X’s Descendants are Related to Y and All of Y’s Ancestors  Thus, to Reuse X or X’s Descendants, you Must Reuse Y and All of Y’s Ancestors  Class X Related to Y if Y at Same or Higher Level!  Related Classes Promote Reuse, Since They are Expected to be Reused Together

REUSE--53 Related Hierarchies/Reusable Components  Two Sub-Hierarchies are Related if to Reuse One, you Must Reuse the Other  Purpose: Identify Reusable Dependencies Among Related Classes  Reusable Component: A Set of Related Classes that are Expected to be Reused as a Group S S S S S S A Sub-Hierarchies B R

REUSE--54 Related Characterization in Levels of Components - HTSS Item NonPerishItemPerishItemEnviron R DairyItemProduceItemDeliItemSubZeroRTemp  Does R from Environ to PerishItem Make Sense?  Should R be from PerishItem to Environ?

REUSE--55 Related Characterizations in Levels of Components - HTSS  Where do Changes for Other Domains Occur? Specific Applications for Big Y or Shaw’s or Stop/Shop (S) Root classes for Items, ItemDB, etc., which are Most General. Inventory Control/Other Components. Classes Specific to Grocery Store Domain.

REUSE--56 Related Characterization in Levels of Components - FinancialFrame... YieldModel DiscountIndexBondBill Bond R  Bond is Related to IndexBond  When Bond is Reused, so Must IndexBond and YieldModel  Hence, IndexBond and its Ancestor (YieldModel) are Reused!

REUSE--57 Related Characterizations in Levels of Components - FinancialFrame  Classes/Sub-Hierarchies can be Related if and only if Classes (or Sub-Hierarchy Roots) are General and at the Same or Higher Level Specific applications at FinancialComp (S) Root classes of strategies and other most General classes (Main) Bond or other strategy Components Classes specific to FinancialComp

REUSE--58 What are Dependencies Among Classes?  Object Inclusion: Class Contains a Instance of Another Object  Attribute Definition: Class Contains Attribute that is the Type of Another Object  Method Invocation: Class Invokes a Method Defined on Another Object  Goals  Classify and Understand Dependencies  Assess “Good” vs. “Bad” Dependencies  Change “Bad” to “Good” by  Changing Class from S to G or G to S  Moving Code and/or Method Calls  Splitting a Class into Two Classes  Merging Two Classes

REUSE--59 Reusing Sub-Hierarchies in Different Components - HTSS Will be reused with Components for another domain, e.g., Toy Store Will be reused with Components for different Super- market Companies Item... DairyItemProduceItemDeliItem NonPerishItemPerishItem

REUSE--60 Reusing Sub-Hierarchies in Different Components - FinancialFrame  Dependencies Among General Related Classes  Not a Hindrance to Reuse  Represents Valuable Design Knowledge Main FinancialCompMainOtherMain SpecificFCMain (S) SpecificOtherMain (S) Will be reused with Components utilizing another company’s databases Will be reused with Components utilizing FinancialComp’s database

REUSE--61 Transitivity in Inheritance and Related Relationships Base Case: Related Characterization is Transitive, but not Commutative but not Commutative A A B B C C R R Case 1: A is not related to X Dependencies from A to X Dependencies from A to X are not Desirable are not Desirable Recall: We Reuse X and All Recall: We Reuse X and All of Its Ancestors, But Not of Its Ancestors, But Not B’s Ancestors to Reuse A B’s Ancestors to Reuse A A A B B C C X X R

REUSE--62 An Example of Case 1 in FinancialFrame  FinancialCompMain R FinancialCompTrader Thus, Dependencies Between are Desirable  Main is not R to FinancialCompTrader Thus, Dependencies Between Hinder Reuse  For “Blue” Component, we Don’t Want to Have to Reuse FinancialCompTrader with Main! Main FinancialCompMainOtherMain FinancialCompTrader R

REUSE--63 Transitivity in Inheritance and Related Relationships B B A A C C X X R  Case 2: X is Related to A Dependencies from X to Both A and B are Desirable  When Reuse X, Since X Related to B, we Reuse B and All of Its Ancestors (A)  Thus, Dependencies Between X and A are Okay!

REUSE--64 An Example of Case 2 in FinancialFrame... YieldModel DiscountIndexBondBill Bond R  Class Bond R to both IndexBond and YieldModel  Thus, Dependencies from Bond to IndexBond and YieldModel are Desirable and Reusable!  When Bond is Reused, So is IndexBond and YieldModel!

REUSE--65 Evaluative Metrics and Methodology Objective Measures of Dependencies  Object-Oriented Design:  Object-Oriented Design: Collection of General and Specific Classes, with Related Characterizations  Recall Dependencies Among Classes  Object Inclusion: Another Instance within Class  Attribute Defn.: Attribute Type of Class  Method Invocation: Defined on Another Class  Quantify Dependencies for Reuse  Good: Promotes Reuse - Leave Alone  Bad: Hinders Reuse - Try to Change  Okay: No Impact on Reuse - Can be Improved  Goals  Classify and Understand Dependencies  Measure Reuse Potential

REUSE--66 Dependencies Among Related Classes  Remember, G/S are Subjectively Assigned by Software Designer  The Two G classes are Related  Related Classes are Intended to be Reused Together Good (1) G S G S Okay (5) Okay (7) Bad (3)

REUSE--67 Sample Dependencies in HTSS InvCont DeliIC Item DeliItem Good (1) Okay (5) Okay (7) Bad (3)  InvCont and Item are Related Classes  InvCont to Item Dependencies are Good: Reused Together  Dependency from InvCont to DeliItem is Problem  Don’t Want to Reuse InvCont with DeliItem  ManagerGUI with InvCont Includes Useless DeliItem  Dependencies from DeliIC to Item and/or DeliItem  Don’t Impact Reuse  Can Reuse Item and DeliItem w/o DeliIC

REUSE--68 Dependencies Among Non-Related Classes  Remember, G/S are Subjectively Assigned by Software Designer  The Two G Classes are Not Related  Non-Related Classes are NOT Intended to be Reused Together Okay (6) Okay (8) G S G S Bad (2) Bad (4)

REUSE--69 Sample Dependencies in HTSS InvCont DeliIC Person Shopper Bad(2) Okay (6) Okay (8) Bad (4)  InvCont and Person are Classes that are Not Related  InvCont to Person or Shopper Dependencies are Bad  Don’t Want to Reuse Person/Shopper with InvCont  Must Reuse - Problem!  Dependencies from DeliIC to Person and/or Shopper  Don’t Impact Reuse  Can Reuse Person and Shopper w/o DeliIC  However, Poor Design if DeliIC Needs Person or Shopper!

REUSE--70 Summarizing Couplings of Related Classes  Type 1: Good for Reuse  Two General Classes are Reused Together  Type 3: Bad for Reuse  General to Specific  To Reuse, Specific Must be Included  Added Functionality with No Purpose  Change to Type 1 or 5/7  Types 5/7: Okay for Reuse  No Impact  Specific Classes Not Reused in New Application  May Improve Reuse if Changed to Type 1

REUSE--71 Summarizing Couplings of Non-Related Classes  Type 2: Bad for Reuse - Two General Classes  Not Expected to be Reused Together since Not Related  Change to Type 6/8  Type 4: Bad for Reuse  General to Specific  To Reuse, Specific Must be Included  Added Functionality with No Purpose  Change to Type 6/8  Types 6/8: Okay for Reuse  No Impact  Specific Classes Not Reused in New Application

REUSE--72 Dependencies in Levels of Components Summarizing Related Classes (1) (3) (5) (7) (7) (1) (1) Related to

REUSE--73 Dependencies in Levels of Components Summarizing Non-Related Classes (2) (4) (4) (6) (8) (2) (2)  Dependencies Among Unrelated Classes Always  Bad for Reuse  No Impact on Reuse

REUSE--74 Sample Actions to Improve Reusability

REUSE--75 Reuse Guidelines  Methodological Basis for Increasing Reuse  Designer Supplies General/Specific/Related for the Classes/Hierarchies in Application  Reuse Analysis Tool Calculates Couplings and Identifies Types of Reuse (Good, Bad, Okay)  Ideal Result: Maximize Reuse via Couplings  Type 1: G to G for Related Classes  Type 8: S to S for Non-Related Classes  Extended Guidelines: Menu of Choices  Different Ways to Move Couplings  Considers Impact of Movement on Design  Goal: Iterative Improvement in Reusability

REUSE--76 Core Guidelines to Move Couplings to Increase Reuse Potential G S G S Type 2 Type 8 G S G S Type 4 Type 8 G S G S Type 5 Type 1 G S G S Type 7 Type 1 G S G S Type 3 G S G S Type 7

REUSE--77 Extended Guidelines for Improving Reusability  Core Guidelines Emphasize Local Behavior  To Remove “Bad” or Improve “Okay” Coupling, Move Cause of the Coupling (e.g., Method Call)  Moving a General Method to Specific Class  Moving a Specific Method to General Class  Moving Method Up/Down a Hierarchy, Which Alters the Coupling, Can Impact Elsewhere  Expand the Analyses to Other Couplings of the Source and Destination of the Bad Coupling  Couplings to Source when Moving Down  Couplings to Destination when Moving Up  Extended Guidelines: Menu of Choices

REUSE--78 Extended Guidelines to Improve Reuse Identifying the Problem S G S m() G G Type 7 G S G S Type 3 Type 7 Recall G S G S m() G Type 3 Suppose What has Occurred?

REUSE--79 Extended Guidelines to Improve Reuse Identifying the Problem S G S m() G G Type 5 Suppose What has Occurred? G S G S m() G Type 1 G S G S Type 5 Type 1 Recall

REUSE--80 Problem and Solution  Focus on Core Guidelines May Ignore the Impact of a Change for Other Related and Coupled Classes  When a Coupling is Moved from a G to S Class  Examine All Existing Coupling to G Class  G to G Coupling Now G to S  We’ve Introduced a “Bad” Coupling  Likewise, When a Coupling Moved from S to G  Examine All Existing Coupling to S Class  S to S Coupling Now S to G  We’ve Introduced a “Bad” Coupling  Solution: Extended Guidelines to Govern all Potential Scenarios for Removing “Bad” Couplings

REUSE--81 Extended Guidelines for Type 3 Couplings  Move Coupling Dst. to General Class or Change Dst. To a General Class  Type 3 to Type 1  May Introduce Couplings from G Dst. to Specific Classes  Move Coupling Src. to Specific Class or Change Src. To a Specific Class  Type 3 to Type 7  May Introduce Couplings from General Classes to Specific Src.  Change to Non-Related/Follow Type 4  Detailed Evaluation of Implementation  Key Concerns  Local Changes with Global Impact  “Wrong” Choice Degrades Reuse G S G S Type 3 Among Related

REUSE--82 Removing Type 3 Couplings in HTSS Which Changes Make Sense? InvCont DeliIC Item DeliItem Type 3  Change InvCont to S or DeliItem to G  Neither Makes Sense  Against Design Intent!  Move Coupling Dst. to General Class  Find Problem Method Call, Attribute Access, Object Inclusion  Move from DeliItem and Item  Type 3 to Type 1  Move Coupling Src. to Specific Class  Find Problem Method Call, Attribute Access, Object Inclusion  Move from InvCont and DeliIC  Type 3 to Type 7  Detailed Evaluation of Implementation  Note: Maintain Application Semantics Type 1 Type 7

REUSE--83 Extended Guidelines for Type 2 Couplings  Move Coupling Src. to Specific Class or Change Src. To a Specific Class  Type 2 to Type 6  May Introduce Couplings from General Classes to Specific Src.  Move Src. and Dst. to Specific Classes  Type 2 to Type 8  May Introduce Couplings from G Src. to Specific Dst.  Move Coupling Dst. to Specific Class or Change Dst. To a Specific Class  Follow Type 4 Guidelines  Change to Related/Type 1/Design Impact Must be Evaluated!  Detailed Evaluation of Implementation G S G S Type 2 Non-Related

REUSE--84 Extended Guidelines for Type 4 Couplings  Move Coupling Dst. to General Class or Change Dst. To a General Class  Type 4 to Type 2 - No Help  Move Coupling Src. to Specific Class or Change Src. To a Specific Class  Type 4 to Type 8  May Introduce Couplings from General Classes to Specific Src.  Change to Related/Follow Type 3  Detailed Evaluation of Implementation G S G S Type 4 Non-Related

REUSE--85 Summary on Extended Guidelines  Total Alternatives for Removing “Bad” Couplings:  Type 2, 3, 4: Seven Possibilities Each: 21 Total  Type 5, 7: 3 Total  Changing from G to S or Movement of Coupling Potential to Impact:  Couplings to Source  Couplings from Destination  Result: Movement May Decrease Reuse Potential!  Two-Fold Solution:  Design Support for OO Reuse Metrics and Evaluation within UML, Design Patterns, etc.  Analytical Tool for Evaluating Reuse Potential of C++, Ada95, or Java Applications/Libraries

REUSE--86 Utilizing Reuse Methodology Evaluate Evolving Design/Implementation  Constructing New Applications  Software Design Proceeds in Stages  Today’s Norm: Incremental Development and Rapid Prototyping  General/Specific Classes/Related Components  Assigned Initially as Classes are Generated  Refined Throughout Increments/Versions  G to S, S to G, etc.  Related Components as Design Begins to Mature with Additional Details  Use Methodology to Find/Correct “Problems”  Video Rental System Test-Bed

REUSE--87 Utilizing Reuse Methodology Investigate Reusability of Legacy Code  Reusability of Legacy Code  Examine Legacy Code in Detail  Talk/Contact Domain Experts with Corporate Knowledge of Code  General/Specific Classes/Related Components  Take “Educated Guess” for G/S Classes and Related Components  Run DRE and Find/Correct Problems  Re-evaluate Legacy Code with Different “Educated Guesses”  Compare/Contrast Results to Identify the “Best” way to Characterize Classes/Components  See Web Site for Example in FinancialFrame

REUSE--88 The Video Rental System (VRS)  VRS is for On-Line (Browser) Rental Tapes  Maintains Customer and Video Databases  Tracks Borrowing/Returning of Tapes  Logs Rented Tapes  CGI, C++, Netscape/Explorer  From Video Rental to Auto Parts  Undergraduate Project: Spring VRS-1  Repeated as Grad Project: Fall VRS-2  Goals:  Demonstrate General/Specific/Related Ideas  Incorporate/Reuse Design in Future System  Study Effectiveness Approach in Identifying and Removing Non-Reusable Dependencies

REUSE--89 General and Specific Classes in VRS-1 VideoStoreInterface (S) StoreInterface (G) VideoCustomer (S) Customer (G) VideoCustomerInterface (S) CustomerInterface (G) VideoTape (S) Item (G) VideoTapeDB (S) ItemDB (G) RentedTapeDB (S)RentedTape (S) CustomerDB (G)HistoryList (G)Transaction (G)

REUSE--90 DRE and VRS-1 Tracking Incremental Versions

REUSE--91 Final General/Specific Classes in VRS-2 and Some Related Characterizations VideoStoreInterface (S) StoreInterface (G) Customer (G) CustomerInterface (G) Video (S) Item (G) VideoItemList (S) ItemList (G) ReportGenerator (S) Transaction (G) VideoTransaction (S) CustomerList (G) VideoCustList (S)

REUSE--92 DRE and VRS-2 Tracking Incremental Versions

REUSE--93 One Type 3 Coupling: G to S Dependency Transaction (G) write_to_checkoutfile() VideoTransaction (S) Customer (G) take_item( )... tr->calculate_currentdate() tr->calculate_duedate() tr->write_to_historyfile() tr->write_to_checkoutfile()... calculate_currentdate() calculate_duedate() write_to_historyfile() What is the Problem? What is the Problem? How is it Resolved? How is it Resolved?

REUSE--94 Resolving Type 3 G to S Dependency Customer (G) take_item( ) Transaction (G) write_to_checkoutfile() VideoTransaction (S) calculate_currentdate() calculate_duedate() write_to_historyfile()... tr->calculate_currentdate() tr->calculate_duedate() tr->write_to_historyfile() take_item_specific()... take_item_specific() VideoCustomer(S) ((VideoTransaction *) tr) -> write_to_checkoutfile()

REUSE--95 Utilizing Reuse Methodology Investigate Reusability of Legacy Code  Reusability of Legacy Code  Examine Legacy Code in Detail  Talk/Contact Domain Experts with Corporate Knowledge of Code  General/Specific Classes/Related Components  Take “Educated Guess” for G/S Classes and Related Components  Run DRE and Find/Correct Problems  Re-evaluate Legacy Code with Different “Educated Guesses”  Compare/Contrast Results to Identify the “Best” way to Characterize Classes/Components  FinancialFrame as a Test-Bed

REUSE--96 The FinancialFrame Application Initial Assumptions on G/S and Related... YieldModel DiscountIndexBondBill Bond  FinancialFrame Composed of Multiple Algorithm Familites  All Root Classes are G(0) with Subclasses G(1)  All Other Classes are G(0)  Use Actual Couplings in Code to Define Related Characterization

REUSE--97 Evaluation of FinancialFrame Possible Scenarios  Dependencies from to Classes  Occurring from a General Class (Bond) to Classes Specific to a Component (IndexBond)  Such Couplings Require a Specific Class that is Not Needed to be Reused with the General Root  Reported as Undesirable Couplings (Type 3/4)... YieldModel DiscountIndexBondBill Bond

REUSE--98 Revising FinancialFrame Application... YieldModel DiscountIndexBondBill Bond R  Bond is Changed from to  A Component Consisting of Bond, IndexBond, and YieldModel is Defined  When Bond Reused, So Must IndexBond and YieldModel - Other Classes Not Needed  However, YieldModel can Be Reused in Isolation  Thus, Modifications to Component Only Affect Reusers of Component

REUSE--99 Evaluation of FinancialFrame Possible Scenarios  Dependencies from to Classes  Occurring from a Specific Class to Other Classes Specific & Unrelated to a Component  Bond Related to Class Outside Component  Such Couplings Require a Specific Class in One Component to be Reused in Another Component, Where it is Not Needed  Reported as Undesirable Couplings (Type 2)... YieldModel DiscountIndexBondBill Bond R

REUSE--100 Reusability of FinancialFrame Components  Undesirable Couplings Identified via Either Scenario can be Removed to Increase Reuse  Results of Such Actions w.r.t. FinancialFrame  Classes can be Reused with Classes Bad Coupling No Longer Present!  When a Class is Modified, Only Users of Particular Component(s) are Notified Bad Coupling No Longer Present!  Each Component Can be Reused “As is”  Classes Outside of Component No Longer Needed  Cannot Illustrate Due to Proprietary Software  Similar Changes to VRS-2 Occur

REUSE--101 Design Reusability Evaluation (DRE) Tool  What is DRE?  Java-Based Tool for Analyzing Reusability  Takes Java Software as Input  Works with General/Specific/Related as Subjectively Defined by Software Designer  Analyzes Couplings to Identify, for Each Type (1 to 8), the Number of Couplings  Allows Designer to Investigate Cause of and Correct “Bad” or Improve “Okay” Couplings  DRE can be Utilized in Different Ways  Evaluate Evolving Design/Implementation  Investigate the Reusability of Legacy Code

REUSE--102 The DRE Tool Family  Standard DRE (SDRE)  Allows Generality and Related to be Set, and Metric to be Fired, and Dependencies to be Classified and Analyzed  Directly Edit Source Code for Dependencies  Collaborative DRE (CDRE)  XML Interoperability to Allow DRE Marking to be Saved and Restored via XML  CDRE Supports Multiple Clients Working on Same Project Simultaneously  Together DRE (TDRE)  Integrated via Plug-Ins into UML Tool

REUSE--103 Utilizing Reuse Methodology Evaluate Evolving Design/Implementation  Constructing New Applications  Software Design Proceeds in Stages  Today’s Norm: Incremental Development and Rapid Prototyping  General/Specific Classes/Related Components  Assigned Initially as Classes are Generated  Refined Throughout Increments/Versions  G to S, S to G, etc.  Related Components as Design Begins to Mature with Additional Details  Use Methodology to Find/Correct “Problems”  Video Rental System Test-Bed

REUSE--104 Utilizing Reuse Methodology Investigate Reusability of Legacy Code  Reusability of Legacy Code  Examine Legacy Code in Detail  Talk/Contact Domain Experts with Corporate Knowledge of Code  General/Specific Classes/Related Components  Take “Educated Guess” for G/S Classes and Related Components  Run DRE and Find/Correct Problems  Re-evaluate Legacy Code with Different “Educated Guesses”  Compare/Contrast Results to Identify the “Best” way to Characterize Classes/Components  FinancialFrame as a Test-Bed

REUSE--105 SDRE - Main Application Window

REUSE--106 SDRE - Main Window – Setting Generality

REUSE--107 SDRE - Main Window – Setting Relations

REUSE--108 SDRE - Main Window – Choosing Simulation Options

REUSE--109 SDRE - Help Subsystem  HTML-based Documents Describe Tool & Theory

REUSE--110 SDRE - Graphical Representation Generality Set for Design

REUSE--111 SDRE - Graphical Representation Setting Related Classes

REUSE--112 SDRE - Graphical Icons for Classes Relative Edge Base Inheritance Edge Base Generality Base Base Rectangle Source File Name Select Base Inheritance Edge Related Edge

REUSE--113 SDRE - Graphical Representation

REUSE--114 SDRE - Editing Source Code Enabled When Doubling Clicking

REUSE--115 SDRE - Editing Source Code Editor Appears with Line Highlighted

REUSE--116 SDRE - Editing Source Code Source Editor Features

REUSE--117 Collaborative DRE (CDRE)  CDRE Purposes  Enable Teams to Collaborate on Metrics Measurement  Utilize Client/Server Architecture  Share Data Between Users  Separate Project Information From Class Markings  Store Source Code Centrally  Execute Metrics on “Powerful” Server  Use Same DRE Interface as Control Client  Utilize XML in Redesign Efforts  CDRE is Intended to Bring SDRE into a Real- World Computing Environment

REUSE--118 CDRE – DRE Client

REUSE--119 CDRE – Client Login

REUSE--120 CDRE – Project Selection

REUSE--121 CDRE – Remote Class Selection

REUSE--122 Together DRE (TDRE)  Integrating DRE into TCC  Ongoing Prototyping Integrate SDRE into TCC  Utilization of TCC Extension Capabilities to Allow Generality and Related to be Set  Initiation of Complete SDRE tool via Plug-In Capabilities of TCC  Single Integrated Design/Development Environment with Reusability Assessment  Leverage TCC to Support Reusability  Incorporate G/S and Related at UML Level  Users can Execute Plug Ins for Each  Actual Properties for UML Classes Modified  Invoke SDRE Directly from TCC

REUSE--123 Reusability in Together CC

REUSE--124 Reusability in Together CC

REUSE--125 Reusability in Together CC

REUSE--126 Reusability in Together CC

REUSE--127 Towards the Formalization of a Reusability Framework for Refactoring  Formal Definitions of Reuse Model to Allow Automatic and Algorithmic Analysis of Couplings  Paper by Cabellero and Demurjian at ICSR-7  OO Application Model  Reuse Framework  Coupling Type Transition Matrix  Defines Loss, Gain, or Steady State Between the Various Coupling Types  +1 Going from G-->S to G-->G for Related Classes  -1 Going from G-->G to G-->S for Related Classes  0 Going from S-->G to S-->S for Related Classes

REUSE--128Goal  Increase Reuse Potential by Understanding Classes, Components, and their Role within Applications  Identify the Reusable Portions of Design  Estimate/Measure Reusability Automatically  Provide Guidelines on Improving Reusability  Usable for  Newly Created Designs  Evaluation of Legacy Code for Reuse Potential  Independent Tool/Integrated in Together CC  See:

REUSE--129 Model of OO Application  Definition 1: Object-Oriented Application S is Modeled As a 3-tuple (C,  i,  m )  C is the Set of Classes, Where Each Class Cp Contains a Set C p m of Methods M i  m Such that Each Method M i Belongs to Only One Class   I is the Set of Pair-wise Inheritance Relations of Classes in C   M is the Set of Pair-wise Coupling Among Methods

REUSE--130 Model - Pair-wise Couplings  Definition 2: Pair-wise Coupling  Two classes C p and C q are Pair-Wise Coupled when there is at Least One Method m i  C p M that Invokes a Method m j  C q M. CpCp m4m4 mimi m9m9 m1m1 m 20 CqCq mjmj m 18 m9m9 m5m5

REUSE--131 Basis of Reuse Framework  Class Reusability  Best Estimate on Potential Utility of Class  General: Application Classes that Facilitate Domain-and-Organization Specific Reuse  Specific: Application Classes that are Limited to use in a Single Application  Relations Among Classes  Grouping of Classes that Are Expected to Be Reused Together in Future Applications

REUSE--132 Class Reusability  General Classes  Expected to be Reused in Future Applications  Abstract Classes/Root Classes/Non-Leaf Classes in Inheritance Hierarchies  Domain Independent/Domain Specific  Specific Classes  Only Applicable in Current Applications  Unlikely to be Reused in Future Applications  Application Specific  Purpose: Determine Classes with Highest Reuse Potential for Organization’s Future Systems

REUSE--133 Model - Class Reusability  Definition 3: The Reusability Level of Class C i is Denoted by G c i  G c i =0  C i is the Most General Class in the Application  G c i =N (N>0)  C i is the Most Specific Class in the Application  Lower N, More General Class  Class Generality Vector

REUSE--134 Model - Relations Among Classes  Related Classes Promote Reuse, Since They are Expected to be Reused Together  Class C i is Related to Class C j if Expected to be Reused Together in Future Systems  Class C i Related to Class C j is Subjectively Assigned by Software Engineer (Producer)  Related Classes Assist in Reusability Assessment

REUSE--135 Quantifying Reuse Properties  Property 1: Generality and Inheritance  Parent of a Class is Equally General or More General than is Direct Children  Property 2: Generality and Related Classes  Reuse Level of Class is Equal to the Reuse Level of the Least Reusable Coupled Class  Property 3: Extraneous Functionality  Classes that Don’t Contribute to Functionality of Component have Negative Impact on Reuse  Property 4: Generality and Unrelated Classes  Couplings Between Unrelated Classes Hinder Reuse

REUSE--136 Dependencies Among Classes  Object Inclusion: Class Contains a Instance of Another Object  Attribute Definition: Class Contains Attribute that is the Type of Another Object  Method Invocation: Class Invokes a Method Defined on Another Object  Goals  Classify and Understand Dependencies  Assess “Good” vs. “Bad” Dependencies  Change “Bad” to “Good” by  Changing Class from S to G or G to S  Moving Code and/or Method Calls  Splitting a Class into Two Classes  Merging Two Classes

REUSE--137 Dependencies: Related Classes  Remember, G/S are Subjectively Assigned by Software Designer  The Two G classes are Related  Related Classes are Intended to be Reused Together Good (Type 1) G S G S Okay (Type 5) Okay (Type 7) Bad (Type 3)

REUSE--138 Dependencies: Non-Related Classes  G/S are Subjectively Assigned by Designer  The Two G Classes are Not Related  Non-Related Classes are NOT Intended to be Reused Together Okay (Type 6) Okay (Type 8) G S G S Bad (Type 2) Bad (Type 4)

REUSE--139 Sample Actions to Improve Reusability

REUSE--140 Core Guidelines to Move Couplings to Increase Reuse Potential G S G S Type 2 Type 8 G S G S Type 4 Type 8 G S G S Type 5 Type 1 G S G S Type 7 Type 1 Type 3G S G S Type 7 Type 1 G S G S Type 3

REUSE--141 Coupling Type Transitions  Defines Loss, Gain, or Steady State Between the Various Coupling Types  For Example,  Going from a G  S to a G  G Coupling Type for Related Classes is a +1  Going from a G  G to a G  S Coupling Type for Related Classes is a -1  Going from a S  G to a S  S Coupling Type for Related Classes is a 0  Define a Matrix for all Transitions Among the Eight Coupling Types in One Step  Distinguish Related from Unrelated Transitions

REUSE--142 Coupling Transitions Related Classes Unrelated Classes

REUSE--143 Reuse Improvement Factor  Metric of the Loss, Gain, or Steady State Between the Various Coupling Types After the Refactoring  Defined by where  is the Matrix for all Transitions Among the Eight Coupling Types in One Step  If  > 0  Refactoring had Negative Reuse Impact  If  < 0  Refactoring had Positive Reuse Impact  If  = 0  Refactoring had No Impact on Reuse

REUSE--144 Motivation of Refactoring Algorithm  Goal: Improve the Reuse Potential of an Application  Formalizes Guidelines to Increase Reusability Introduced by M. Price and S. Demurjian  Basic Idea  Analyze All Couplings that Can be Improved  Refactor Application Automatically  Evaluate the Impact on Reuse of Refactoring  Commit if “Reuse Improvement Factor” is Positive  Undo if “Reuse Improvement Factor” is Negative  Iterate until All Appropriate Couplings Considered

REUSE--145 Refactoring Algorithm Step 1: Identify Reuse Potential - Mark Generalities Step 2: Calculate Couplings Step 3: Identify Related Classes Step 4: Determine Coupling Types Step 5: Identify Undesirable Couplings Step 6: Refactor: Move Source or Destination Method, Change Reuse Level, Related to Unrelated Step 7: Recalculate Reuse Improvement Factor Step 8: If Reuse Factor <= 0 Goto Step 6 Else Goto Step 5 or Terminate Based on Condition

REUSE--146 Example - Assumptions  Assume Classes: C 1, C 2, C 3, C 4, C 5, C 6, C 7  Methods: m 1, m 2, m 3, m 4, m 5, m 6, m 7, m 8  Dependencies Among Methods (Couplings) Shown with Arrows

REUSE--147 Example - Generality and Related Steps 1, 2, 3 of Algorithm GGGG S S S  Establish Class Reusability   C 1, C 2, C 4, C 6  General   C 3, C 5, C 7  Specific  Calculate Couplings  Assume all Classes are Related Classes to One Another

REUSE--148 GGGG S S S Example - Determine Coupling Types Step 4 of Algorithm

REUSE--149 GGGG S S S Example - Identify Undesirable Couplings Step 5 of Algorithm

REUSE--150 Example - Refactor the Application Step 6 of Algorithm  For (m 3,m 5 ) Try to Move Source Method Down m3m3 No Improvement!

REUSE--151 Example - Refactor the Application Step 6 of Algorithm  For (m 4,m 6 ) Try to Move Source Method Down m4m4 Commit the Changes Set T=T ~

REUSE--152 Example - Refactor the Application Step 6 of Algorithm  For (m 5,m 7 ) try to Move Source Method Down m4m4 m5m5 Commit the Changes Set T=T ~

REUSE--153 Example - Refactored Class Diagram GGGG SS S

REUSE--154 Reusability and UML  Investigation of Our Reuse Model and Framework at Design Level via UML  Establishing Generality and Related in Use- Case and Class Diagrams  Counting and Tracking Dependencies in Behavior Modeling and Component Diagrams  Key Questions  Can Use Cases have Generality Levels?  How Do UC Generalities Relate to Classes?  What Dependencies Can be Tracked for Either Warning or Counting (Metrics)?  Incorporation into TCC and Transition to DRE  Build and Extend the Formal Model (Caballero)

REUSE--155 Revisiting Reuse Properties  Property 1: Generality and Inheritance  Parent of a Class is Equally General or More General than is Direct Children  Property 2: Generality and Related Classes  Reuse Level of Class is Equal to the Reuse Level of the Least Reusable Coupled Class  Property 3: Generality and Unrelated Classes  Couplings Between Unrelated Classes Hinder Reuse

REUSE--156 Reuse Definition, Assessment, and Analysis in UML  Examination of Reuse in …  Use Case Diagrams  Class Diagrams  Behavior Modeling Diagrams  Component Diagrams  Reuse Improvement During Design  Transition from Design into Development  Consistency of Approach with Existing Reuse Model and Formal Refactoring Guidelines  Definite Additional Properties (see Previous Slide)  Introduce Refactoring Guidelines that Enforce the Properties of Reuse for UML Diagrams

REUSE--157 Reuse Definition, Assessment, and Analysis in UML  Examination of Reuse in …  Use Case Diagrams  Class Diagrams  Behavior Modeling Diagrams  Component Diagrams  Reuse Improvement During Design  Transition from Design into Development  Consistency of Approach with Existing Reuse Model and Formal Refactoring Guidelines  Definite Additional Properties (see Previous Slide)  Introduce Refactoring Guidelines that Enforce the Properties of Reuse for UML Diagrams

REUSE--158 Use Cases with Generalities  Application has Three Systems  Each System with One or More Use Case  Each Use Case has Generality Level  Relationships Among Use Cases are:  Extend  Include  Generalize  Generalities Must be Consistent within Systems and Between UCs Given Relationships

REUSE--159 Use Cases with Include, Extend, and Inheritance  Dependencies Among Use Cases  Dependencies are Transitive w.r.t. Generalities

REUSE--160 Properties for Use Cases  Property 4: UC A extends UC B means UC A adds behavior to UC B, so UC A is at most as general as UC B or G UC-B  G UC-A  Property 5: UC A includes UC B is a relation of the behavior sequence of supplier UC B to the interaction sequence UC A. Thus, UC A is at most as general as UC B or G UC-B  G UC-A.  Property 6: UC A generalizes UC B relates child UC B to parent UC A, meaning that UC B is at most as general as UC A or G UC-A  G UC-B.

REUSE--161 Corresponding Refactoring Guidelines  RG1 or RG2 to Enforce Property 4 or Property 5:  The refactoring rule is: If G UC-B > G UC-A then refactor by making UC B more general (or UC A more specific) so G UC-B  G UC-A or by removing the extend/include.  RG3 to Enforce Property 6:  The refactoring rule is: If G UC-A > G UC-B then refactor by making UC A more general (or UC A more specific) so G UC-A  G UC-B or or by removing the generalization.

REUSE--162 Identifying Problems RG3 for Pay Cash  RG2 for Place Order: to G2 or Remove  RG2 for Place Order: to G2 or Remove  RG3 for Pay Cash: to G1 or Arrange Payment to G0 or Remove  RG3 for Pay Cash: to G1 or Arrange Payment to G0 or Remove

REUSE--163 UML Reuse and Class Diagrams  Definition 3:  UC A is related to ℭ A = {C 1, C 2, …, C n } for some n, if UC A relies on ℭ A for functionality.  Property 7: UCs and Classes - Generality  Suppose UC A has ℭ A = {C 1, C 2, …, C n }. Then, the generality of UC A must be as specific as the most specific class in ℭ A, and may be more specific, i.e., G UC-A = max{generality  C i  ℭ A }.  RG4 to Enforce Property 7  The refactoring rule is: generality change of UC A or one or more C i in ℭ A until G UC-A = max{generality  C i  ℭ A }, or the removal of all classes in ℭ A that cause the G UC-A = max{generality  C i  ℭ A } to be violated.

REUSE--164 Classes and Generality Levels

REUSE--165 UML Reuse and Class Diagrams  Property 8: UCs and Classes - Related  Suppose that UC A is related to ℭ A and UC B is related to ℭ B. If UC A is related to UC B (extend, include, or generalize), then there has to be at least one transitive relation chain from one C i  ℭ A to one C j  ℭ B.  RG5 to Enforce Property 8  The refactoring rule is: Add one or more dependencies between class(es) C i  ℭ A and class(es) C j  ℭ B, or remove the relation between UC A and UC B

REUSE--166 UML Reuse and Class Diagrams  Property 9: UCs to UCs - Related  Suppose that UC A is related to ℭ A and UC B is related to ℭ B, and that UC A is not related to UC B (there is not an extend, include, or generalize). Then, if at least one C i  ℭ A is directly related (meaning not by transitive relation chain) to at least one C j  ℭ B, there must be a refactoring to correct the problem.  RG6 to Enforce Property 9  The refactoring rule is: make UC A related to UC B or remove all dependencies between all C i  ℭ A and all C j  ℭ B.

REUSE--167 UML Reuse and Class Diagrams  Property 10: UCs and Classes - Related  Suppose that UC A is related to ℭ A. Then for all C i  ℭ A, if there is a transitive relation chain from C i to some C j  ℭ A, then UC A must also be related to C j in some manner. UC A can be either related directly to C j or it can be related to some UC B, to which C j is related  RG7 to Enforce Property 10  The refactoring rule is:  C i  ℭ A related to some C j  ℭ A include C j in ℭ A ( ℭ A = ℭ A  C j ), or relate UC A to some UC B where C j  ℭ B, or unrelate UC A to C i ( ℭ A = ℭ A - C j ).

REUSE--168 Refactored UC Diagram from Earlier Slide

REUSE--169 UML Reuse and Behavior Diagrams  Sequence and Collaboration Diagrams Can Also Impact on Reuse - Why?  Both Alter Dependencies  Introduce/Remove Associations  For Example:  Sequence Diagram Can Introduce New Dependencies Among Classes ( ℭ Sets)  Collaboration Diagram Could Also Introduce Similar Dependencies that Require Refactoring  See Paper for Details

REUSE--170 UML Reuse and Component Diagrams  Definitions for UML Components  Definition 4: Component and Classes that Implement it  Definition 5: Component and Façade that hides Implementation Details  Definition 6: Component and Abstract Classes/Interfaces  Accompanying Properties/Refactoring Guidelines  Property 11/RG8 - Components vs. Classes  Property 12/RG9 - Component vs. Component  Property 13/RG10 - Component vs. Façade  See Section 3.4 of Paper for Further Details

REUSE--171 Modifications to Together CC  Leverage Open APIs and Plug In Structure to Incorporate Reuse Model for UML into TCC  Multi-Phase Approach  Directly Extend Property Windows of Use Cases and Classes for Generality Definition  Augment with new Window for Related  Add New Metrics Pane that Supports Analysis as Presented (Definitions, Properties, and RGs)  Briefly, we’ll Review Modifications  Please See Web Site for Full Details

REUSE--172 Setting Project Options

REUSE--173 UC: Generality and Related

REUSE--174 Classes: Generality and Related

REUSE--175 Components and Facades

REUSE--176 Running DRE and Metrics

REUSE--177 Analyzing Reuse and Refactoring  Affected Elements: Elements affected by warning.   Description: Provides a description of the warning   Refactoring Guideline: One or more refactoring guidelines for the currently selected warning

REUSE--178 TCC: DRE-UML Warnings   Use Case Diagrams:  Generalities and Related Classes  Dependencies to other Use Cases (include, extend, generalize)   Class Diagrams:  Generalities and Related Classes  Dependencies to other Classes (association, dependency, generalization)   Sequence/Collaboration Diagrams: Method Calls   Component Diagrams:  Related and Façade Classes  Implemented Interfaces  Dependencies of Components and Interfaces

REUSE--179Conclusions  Comprehensive Reusability Model and Evaluation  General/Specific/Related Characterizations  Capture/Analyze Reusability of OO Software  Design Level (UML) and Code Level (DRE)  Achieve Highest Gain Through Early Identification and Reusability Evaluations!  Methodology and Empirical Verification  Guidelines to Encourage Reuse  Applicable to Reuse of Designs and Code  DRE Tool Family: SDRE, CDRE, TDRE  Strong Demonstration of Domain-and-Organization-Specific Reuse

REUSE--180 Future Work - Reusability - Summary  Possible Short/Long-Term Research  Focus on Comprehensive Reuse Framework  Guided Reusability Assessment/GA Analysis  Component Repository with Search Capability  Leverage Domain/Organization Specificity  XML and Java Components

REUSE--181 Genetic Algorithm and Reuse  Towards Guided Software Reusability Assessment  Multi-Step Iterative Process:  Determine Set of Assumptions Regarding Generality  Levels of Generality that are Required  Related Implied by Dependencies or Set by User  Key Issue is to Define Constraints that Will Underlie the GA Fitness Function  Run the Genetic Algorithm on Code for Fixed Population and Number of Generations  Evaluation of Results - Potential to Rerun with Changed Assumptions, Population, Generations  Converge Towards “Reasonable” Marking

REUSE--182 Future: Formal Reuse Model  Future Work  Exploring Weightings (+2, +3, -3, etc.) for Transitions Among Coupling Types  Explore and Refine the Reuse Model  Theoretical Verification of Reuse Model  Use of GA to Obtain “Near” Optimal Marking  Practical Perspective  Integrating Metric and Model in SDRE  Testing with “Real” Examples and Prior Examples