modularization in large-scale oo...

27
Modularization Modularization in Large-Scale OO System Jimin Hwa 13 th January 2010 copyright2008 All rights reserved by Jimin Hwa

Upload: others

Post on 13-Oct-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Modularization in Large-Scale OO Systemse.kaist.ac.kr/.../2013/05/Modularization-in-Large-Scale-OO-systems.… · Quality Assessment of Modularization Related Work : Sarkarn et a

ModularizationModularization in Large-Scale OO System

Jimin Hwa

13th January 2010

copyrightⓒ 2008 All rights reserved by Jimin Hwa

Page 2: Modularization in Large-Scale OO Systemse.kaist.ac.kr/.../2013/05/Modularization-in-Large-Scale-OO-systems.… · Quality Assessment of Modularization Related Work : Sarkarn et a

C t tContentsIntroduction

Issues on ModularizationQ lit t f d l d iQuality assessment of modular designModularization techniques

Research in Progress

SummarySummary

copyrightⓒ 2008 All rights reserved by Jimin Hwa 2/27

Page 3: Modularization in Large-Scale OO Systemse.kaist.ac.kr/.../2013/05/Modularization-in-Large-Scale-OO-systems.… · Quality Assessment of Modularization Related Work : Sarkarn et a

Introduction

copyrightⓒ 2008 All rights reserved by Jimin Hwa 3/27

Page 4: Modularization in Large-Scale OO Systemse.kaist.ac.kr/.../2013/05/Modularization-in-Large-Scale-OO-systems.… · Quality Assessment of Modularization Related Work : Sarkarn et a

I t d tiIntroductionComplexity of software system’s design should be managed p y y g gduring its lifetime

Understanding

Com

Modification

mplexity

Costly&faulty

<Software system’s design><Developer/maintainer>

copyrightⓒ 2008 All rights reserved by Jimin Hwa 4/27

Page 5: Modularization in Large-Scale OO Systemse.kaist.ac.kr/.../2013/05/Modularization-in-Large-Scale-OO-systems.… · Quality Assessment of Modularization Related Work : Sarkarn et a

I t d tiIntroductionComplexity management is more significant in large-scale p y g g gsoftware

the granularity of a class at much too low a level to serve as a unit for f d l i i *software modularization*

Understanding

Com

pUnderstanding

Modification

Size

plexity

Costly&faulty

copyrightⓒ 2008 All rights reserved by Jimin Hwa

<Software system’s design>* Sarkarn et al., “Metrics for measuring the quality of modularization of large-scale object-oriented software,” TSE’08

5/27

Page 6: Modularization in Large-Scale OO Systemse.kaist.ac.kr/.../2013/05/Modularization-in-Large-Scale-OO-systems.… · Quality Assessment of Modularization Related Work : Sarkarn et a

M d l i ti

Introduction

ModularizationModularization provides high-level view of a system by p g y ydecomposing it into meaningful and manageable subsystems

<Software for Banking System>

: Module Deposit Transfer

Withdraw

: Module: Class/Function

copyrightⓒ 2008 All rights reserved by Jimin Hwa

Withdraw

<High-level view of Banking System>6/27

Page 7: Modularization in Large-Scale OO Systemse.kaist.ac.kr/.../2013/05/Modularization-in-Large-Scale-OO-systems.… · Quality Assessment of Modularization Related Work : Sarkarn et a

Fl Hi hi l M d l i ti

Introduction

Flat vs. Hierarchical Modularization<Flat modular design> <Hierarchical modular design*>

1System

: ModuleCl /F i: Class/Function

: Dependency: “Part of” relationship

copyrightⓒ 2008 All rights reserved by Jimin Hwa

: Part of relationship

* R. Lutz, “Evolving good hierarchical decompositions of complex system,” J. Systems Architecture, 20017/27

Page 8: Modularization in Large-Scale OO Systemse.kaist.ac.kr/.../2013/05/Modularization-in-Large-Scale-OO-systems.… · Quality Assessment of Modularization Related Work : Sarkarn et a

E l f Fl & Hi hi l M d l i ti

Introduction

Examples of Flat & Hierarchical Modularization<Flat modular design> <Hierarchical modular design*>

* *

Class/function

Module

copyrightⓒ 2008 All rights reserved by Jimin Hwa* R. Lutz, “Evolving good hierarchical decompositions of complex system,” J. Systems Architecture, 2001

8/27

Page 9: Modularization in Large-Scale OO Systemse.kaist.ac.kr/.../2013/05/Modularization-in-Large-Scale-OO-systems.… · Quality Assessment of Modularization Related Work : Sarkarn et a

Issues on Modularization

copyrightⓒ 2008 All rights reserved by Jimin Hwa 9/27

Page 10: Modularization in Large-Scale OO Systemse.kaist.ac.kr/.../2013/05/Modularization-in-Large-Scale-OO-systems.… · Quality Assessment of Modularization Related Work : Sarkarn et a

I M d l i tiIssues on ModularizationQuality assessment of a modular designQ y g

Modularization techniques

EtcLabelingVisualization

copyrightⓒ 2008 All rights reserved by Jimin Hwa 10/27

Page 11: Modularization in Large-Scale OO Systemse.kaist.ac.kr/.../2013/05/Modularization-in-Large-Scale-OO-systems.… · Quality Assessment of Modularization Related Work : Sarkarn et a

Q lit A t f M d l i tiQuality Assessment of ModularizationTo manage the quality of the modular design of a systemg q y g y

To judge whether improvement of a modular design is d dneeded

Quality

RestructuringRestructuring is needed!

0.1 0.2 0.3 0.4 …0.5

i f

0.n

copyrightⓒ 2008 All rights reserved by Jimin Hwa

Series of a system

11/27

Page 12: Modularization in Large-Scale OO Systemse.kaist.ac.kr/.../2013/05/Modularization-in-Large-Scale-OO-systems.… · Quality Assessment of Modularization Related Work : Sarkarn et a

R l t d W k S k l ’ *

Quality Assessment of Modularization

Related Work : Sarkarn et al.’s*

Provide a set of metrics that characterizes large OO software gwith respect to the APIs of the modules of a system

: Module

…… …

: Module

: Class: Interface …

: Implementation /Inheritance

: Dependency…

…: Dependency/Use

Ex> #access to APIs

copyrightⓒ 2008 All rights reserved by Jimin Hwa* Sarkarn et al., “Metrics for measuring the quality of modularization of large-scale object-oriented software,” TSE’08

#all access to the module

12/27

Page 13: Modularization in Large-Scale OO Systemse.kaist.ac.kr/.../2013/05/Modularization-in-Large-Scale-OO-systems.… · Quality Assessment of Modularization Related Work : Sarkarn et a

R l t d W k S k l ’

Quality Assessment of Modularization

Related Work : Sarkarn et al.’sValidate the metrics by applying them to open-source y pp y g psoftware systems1. Justify the values on the basis of manual examination of the software

systems2. Detune the systems and examine the changes of metric values

*High

Quality

LowQuality

copyrightⓒ 2008 All rights reserved by Jimin Hwa

<Validation of metrics with code detuning>* Sarkarn et al., “Metrics for measuring the quality of modularization of large-scale object-oriented software,” TSE’08

13/27

Page 14: Modularization in Large-Scale OO Systemse.kaist.ac.kr/.../2013/05/Modularization-in-Large-Scale-OO-systems.… · Quality Assessment of Modularization Related Work : Sarkarn et a

R l t d W k O *

Quality Assessment of Modularization

Related Work : Ours*

Provide a metric-based model to assess the (hierarchical) ( )modular design of a system in the view of understandability

UnderstandabilityUnderstandability

Assess

Design Size

Module Complexity

Encapsu-lation

Quality Properties

Coupling Cohesion ModularAbstraction

Software Metrics & Metric-based Model

Complexity lation Abstraction

Software Modular Design(Hierarchical)

copyrightⓒ 2008 All rights reserved by Jimin Hwa* J. Hwa et al., “Hierarchical Understandability Assessment Model for Large-Scale OO System,” APSEC’09

14/27

Page 15: Modularization in Large-Scale OO Systemse.kaist.ac.kr/.../2013/05/Modularization-in-Large-Scale-OO-systems.… · Quality Assessment of Modularization Related Work : Sarkarn et a

R l t d W k O

Quality Assessment of Modularization

Related Work : OursValidate the model by applying them to series of a well-y pp y gmanaged open-source software systemM

ea …asured Vallue

0.1 0.2 0.3 0.4 …

Series of a system

0.5

[V i hift 0 4 0 5]

Expected changeby manual analysisReal change = (+)

Match?[Version shift 0.4 0.5]

= (+/-)

copyrightⓒ 2008 All rights reserved by Jimin Hwa

by manual analysis

15/27

Page 16: Modularization in Large-Scale OO Systemse.kaist.ac.kr/.../2013/05/Modularization-in-Large-Scale-OO-systems.… · Quality Assessment of Modularization Related Work : Sarkarn et a

M d l i ti T h iModularization TechniquesProvide techniques to (re-)build/structure a modular design q ( ) gof a system (semi-)automatically

Contain criteria of quality modules and a method to build such modules

St t l ti f

Homogeneous On what?

- Structural properties of design/code(Ex> cohesion)- Terms in design/code

Features in design specg

Heterogeneous

On what?

How judge?

- Features in design spec.- Features in history

- Software metrics

Heterogeneous How judge?- Concept analysis- Data mining

: Module …

copyrightⓒ 2008 All rights reserved by Jimin Hwa

<A modular structure> : Class/function

16/27

Page 17: Modularization in Large-Scale OO Systemse.kaist.ac.kr/.../2013/05/Modularization-in-Large-Scale-OO-systems.… · Quality Assessment of Modularization Related Work : Sarkarn et a

R l t d W k B S M h ll l ’ *

Modularization Techniques

Related Work : B. S. Metchell et al.’s*

Propose an approach to (re)structure a flat modular p pp ( )structure of a system

Input : Class-level design/source codeCriteria : Coupling & cohesion Method : Search-based technique(Hill-climbing, GA)

M1 M2

CF(M) = Ratio b/w internal and

Criteria

Search Assess external edges of a module M

MQ(S) = Aggregation of CFf ll d l i S

SearchAlg.

: Module

M3 for all modules in system S

copyrightⓒ 2008 All rights reserved by Jimin Hwa* B. S. Mitchell et al., “On the Automatic Modularization of Software Systems Using the Bunch Tool,” TSE’06

: Class/Function

17/27

Page 18: Modularization in Large-Scale OO Systemse.kaist.ac.kr/.../2013/05/Modularization-in-Large-Scale-OO-systems.… · Quality Assessment of Modularization Related Work : Sarkarn et a

R l t d W k O M b l l ’ *

Modularization Techniques

Related Work : O. Maqbool et al.’s*

Review several existing hierarchical clustering approaches g g ppInput : Structural design/source code written in a procedural languageCriteria : Homo/heterogeneity in the use of features of the design/code

Features : Functions, global variables and user defined typesMethod : Hierarchical clustering algorithms

Function FeaturesA 1 1 0 1 0A 1 1 0 1 0 B 0 1 0 1 1 C 1 0 1 0 1 A B CC 1 0 1 0 1

use

copyrightⓒ 2008 All rights reserved by Jimin Hwa* O. Maqbool., “Hierarchical Clustering for Software Architecture Recovery,” TSE,07

18/27

Page 19: Modularization in Large-Scale OO Systemse.kaist.ac.kr/.../2013/05/Modularization-in-Large-Scale-OO-systems.… · Quality Assessment of Modularization Related Work : Sarkarn et a

R l t d W k R L ’ *

Modularization Techniques

Related Work : R. Lutz’s*

Propose an approach for hierarchical modularization of a p ppsystem

Input : Class-level design/source codeCriteria : Min. description length of a modular design (Information-theory)Method : Genetic algorithm(GA)

M1 n1

n2 n3

3(3 entities in M1)n1…

GA M2 M3

n2

n4 7 n8

2(2 sub-modules)3(3 entities in M2)

n4Encoding

: Module

n4 n5n6

n7 n8

n9 n10…1 0 n2(edges from n1)…

copyrightⓒ 2008 All rights reserved by Jimin Hwa* R. Lutz, “Evolving good hierarchical decompositions of complex systems,” TSE’06

: Entity 1 1 M3 n7(edges from n5)

19/27

Page 20: Modularization in Large-Scale OO Systemse.kaist.ac.kr/.../2013/05/Modularization-in-Large-Scale-OO-systems.… · Quality Assessment of Modularization Related Work : Sarkarn et a

R l t d W k R L ’

Modularization Techniques

Related Work : R. Lutz’sPropose an approach for hierarchical modularization of a p ppsystem

Input : Structural design/Source codeCriteria : Min. description length of a modular design (Information-theory)Method : Genetic algorithm(GA)

3(3 entities in M1)n1… #Bits/Message length

d ib h dThe degree of compression depends on

Compressor

2(2 sub-modules)3(3 entities in M2)

n4

to describe the code

Complexity of the

compression depends on

-#entities/modules/edgesin code…

1 0 n2(edges from n1)…1 1 M3 7( d f 5)

Complexity of the modular design

in code-Frequencies of modules’ and entities’ names in code-Path length in the hierarchy

copyrightⓒ 2008 All rights reserved by Jimin Hwa

1 1 M3 n7(edges from n5) Path length in the hierarchybetween interacting entities

20/27

Page 21: Modularization in Large-Scale OO Systemse.kaist.ac.kr/.../2013/05/Modularization-in-Large-Scale-OO-systems.… · Quality Assessment of Modularization Related Work : Sarkarn et a

E l ti M d l i ti T h i

Modularization Techniques

Evaluating Modularization TechniquesExternal validation

By manually analyzing modular designs created by an approachSoliciting feedback on the clustering results from one or more of the system d ldevelopers

By comparing the modular designs by experts

Internal validationWithout benchmarkBy examining properties which the design by good techniques would have

Ex1> Stability : Small changes does not cause dramatic change of the designEx2> Shapes of hierarchies produced by hierarchical clustering algorithmsEx2> Shapes of hierarchies produced by hierarchical clustering algorithms

Vs.

copyrightⓒ 2008 All rights reserved by Jimin Hwa 21/27

Page 22: Modularization in Large-Scale OO Systemse.kaist.ac.kr/.../2013/05/Modularization-in-Large-Scale-OO-systems.… · Quality Assessment of Modularization Related Work : Sarkarn et a

R h i PResearch in Progress

copyrightⓒ 2008 All rights reserved by Jimin Hwa 22/27

Page 23: Modularization in Large-Scale OO Systemse.kaist.ac.kr/.../2013/05/Modularization-in-Large-Scale-OO-systems.… · Quality Assessment of Modularization Related Work : Sarkarn et a

M ti ti

Research in Progress

MotivationNo evidence that the real modularization by designers show y gthe structural properties of the existing techniques

The modules organized by designers may/may not show the structural i d fi d b h h iproperties defined by the techniques

It could be necessary to merge several techniques to cover a designer’s modularization

Structural

Well-modularized

Modularize withhis intention

Structural properties

Has

Modularization

Derive

copyrightⓒ 2008 All rights reserved by Jimin Hwa

Techniques23/27

Page 24: Modularization in Large-Scale OO Systemse.kaist.ac.kr/.../2013/05/Modularization-in-Large-Scale-OO-systems.… · Quality Assessment of Modularization Related Work : Sarkarn et a

R l t d W k M G B l ’

Research in Progress

Related Work : M. G. Bocco et al.’sConduct an experimental analysis of the impact of complexity p y p p yon the maintenance of the UML class diagrams

M i t T kMaintenance Tasks

Time took them to complete the tasks

Class diagram #1 Participants

to co p ete t e tas s

<Complexity of the diagram>Ex> #methods, #associations,Measure CorrelationEx #methods, #associations, max. depth in inheritance tree

Measure Correlation

copyrightⓒ 2008 All rights reserved by Jimin Hwa

* M. G. Bocco et al., “Assessing the capability of internal metrics as early indicators of maintenance effort through experimentation,” J. Softw. Maint. Evol.: Res. Pract. 2005

24/27

Page 25: Modularization in Large-Scale OO Systemse.kaist.ac.kr/.../2013/05/Modularization-in-Large-Scale-OO-systems.… · Quality Assessment of Modularization Related Work : Sarkarn et a

O i f R h

Research in Progress

Overview of ResearchAssumptionsp

1st : Well-managed modules have structural properties 2nd : Modules have different structural properties each other Target to verify

It is not that all modules can be defined by same structural propertiesModules can be classified by their structural properties

Experiment plan

M d lSP1Modular

design #1

MMeasure

< Structural properties

Analysis

copyrightⓒ 2008 All rights reserved by Jimin Hwa

of modules >Ex> #dependency, cohesion, etc... SPn

25/27

Page 26: Modularization in Large-Scale OO Systemse.kaist.ac.kr/.../2013/05/Modularization-in-Large-Scale-OO-systems.… · Quality Assessment of Modularization Related Work : Sarkarn et a

C id ti f E i t D i

Research in Progress

Considerations for Experiment DesignHow justify that a given system’s modular design is well-j y g y gmanaged

Use open-source projects which managed for a long period or known as ll d i liwell-managed systems in literatures

Analyze histories and interview the designers to grasp current state of the systems y

What structural properties are better to be usedSimple and intuitive properties

Ex> #dependencies on other modulesC l ti id d b th i ti d l i ti t h iComplex properties provided by the existing modularization techniques

copyrightⓒ 2008 All rights reserved by Jimin Hwa 26/27

Page 27: Modularization in Large-Scale OO Systemse.kaist.ac.kr/.../2013/05/Modularization-in-Large-Scale-OO-systems.… · Quality Assessment of Modularization Related Work : Sarkarn et a

SSummaryModularization can be help reducing complexity of softwarep g p y

By decomposing a system into meaningful and manageable subsystems

Approaches for assessing and automatic-structuring a modular design of a system have been studied

Many literatures have used structural characteristics of the design to assess and structure it

It is necessary to study the relationship between modules designed by experts and structural properties

An experiment design for this study is in progress

copyrightⓒ 2008 All rights reserved by Jimin Hwa 27/27