Understanding the Use of Inheritance with Visual Patterns - - PowerPoint PPT Presentation

understanding the use of inheritance with visual patterns
SMART_READER_LITE
LIVE PREVIEW

Understanding the Use of Inheritance with Visual Patterns - - PowerPoint PPT Presentation

Simon Denier, Houari Sahraoui Understanding the Use of Inheritance with Visual Patterns Inheritance with Visual Patterns Luca Cometta Motivation Number of hierarchies Depth Size Important classes Important classes


slide-1
SLIDE 1

Understanding the Use of Inheritance with Visual Patterns

Simon Denier, Houari Sahraoui

Inheritance with Visual Patterns

Luca Cometta

slide-2
SLIDE 2

Motivation

  • Number of hierarchies
  • Depth
  • Size
  • Important classes
  • Important classes
  • Relationship between classes

2

slide-3
SLIDE 3

VERSO

  • 3D objects
  • 2D plane
  • Classes as 3D boxes

3 Visualization-based Analysis of Quality for Large-scale Software Systems

slide-4
SLIDE 4

Definitions of the Inheritance Notion

  • Parent class: a class which has

subclasses

  • Childless class: a class which has

no subclasses

  • Family: the set of direct

subclasses of a parent subclasses of a parent

  • Hierarchy: the full set of

subclasses of a parent

  • Hierarchy root: the parent class
  • f a Hierarchy whose parent is

Object

  • Ghost class: a class which is

defined outside the project

4

slide-5
SLIDE 5

Definitions of the Sunburst Layout

  • Slice: a part of the visualization

delimited by edges

  • Subslice: a slice on the outer

edge of the current slice

  • Full Slice: a slice and all its

subslices subslices

  • Eye: the innermost slice of the

visualization

5

slide-6
SLIDE 6

Basic Metrics

  • Depth of Inheritance Tree:

– The number of parent classes up to the root – The greater the DIT is, the farther the class is in the inheritance hierarchy

  • Number of Children:
  • Number of Children:

– The greater the NOC is, the more responsibility the class has

  • Number of Methods

– The greater the NOM is, the more services the class can

  • ffer to the program

– Mapped to height

6

slide-7
SLIDE 7

Subclassing Behaviour

7

slide-8
SLIDE 8

Children Similarity

  • Based on similarity of the method signatures
  • Prototype is computed
  • Similarity to prototype is computed

8

  • Mapped to Twist
  • Similar children are vertical
  • Dissimilar children are horizontal
slide-9
SLIDE 9

A First Example: JHotDraw

A: Swing framework extension B: High use of overriding for polymorphism

9

for polymorphism C: Main hierarchy of class Figure

slide-10
SLIDE 10

Visual Patterns

  • Large Root: root slice with a large radius
  • Big Hierarchy: full slice with deeply nested

slices and slices with many entities or subslices subslices

  • Common Family: red parent and mostly blue

children

10

slide-11
SLIDE 11

Polymorphic Hierarchies

  • Large Family: a slice with many entities, often

childless

  • Similar Children: a slice with many vertical

entities

  • Nested Families: nesting of the previous patterns
  • Nested Families: nesting of the previous patterns
  • Library / Framework Extension: full slice with

nested ghost parents parenting entities of mixed properties

  • Exception Hierarchy: Full slice with nested ghost

parents and a majority of purple entities

11

slide-12
SLIDE 12

Program Analysis

A three-step process:

  • 1. An overview of inheritance use is provided to

answer general questions answer general questions

  • 2. Focus on particular classes or hierarchies to

identify visual patterns

  • 3. For each particular case it‘s possible to

request more information

12

slide-13
SLIDE 13

Case Study 1: JFreeChart

  • Many nested slices
  • Rather small hierarchies
  • Many red entities
  • Three big hierarchies
  • Entries display mixed

properties

A: AbstractDataSet B: AbstractRenderer

properties

  • Two big slices
  • Many tall classes in A
  • C: Swing framework

extension

  • Horizontal twist of purple

entities in the eye

13 C

slide-14
SLIDE 14

Case Study 2: Xalan

  • Many slices
  • The eye is relatively small
  • Slices are deeply nested

with large root slices

  • Entities are mostly blue

DTMAxisIteratorBase SyntaxTreeNode

  • Entities are mostly blue
  • A and E show strong

polymorphic patterns

  • B, C and D display mixed

polymorphic hierarchies

  • F matches the exception

hierarchy pattern

14

Resource Bundle Expression UnImplNode

slide-15
SLIDE 15

Case Study 3: Azureus

  • Big eye
  • Few big hierarchies
  • Most hierarchies are shallow
  • Blue and red entities are mixed
  • A is a big hierarchy used to

encode basic datatypes

  • The other big hierarchy is the

DERObject TableColumnImpl

  • The other big hierarchy is the

exception hierarchy E

  • C is unusual: similar children

implementing the same interface (TableCellRefreshListen er)

  • D and F are occurences of

polymorphic families

15

GeneralDigest ResourceDownloader BaseImpl

slide-16
SLIDE 16

Conclusion

  • Scalable inheritance visualization
  • Display many characteristics of inheritance at

program aswell as at class level

  • Developed a new metric for child similarity
  • Developed a new metric for child similarity
  • Major limitation: single inheritance
  • Sunburst layout can display improper effects

16

slide-17
SLIDE 17

Questions?

?

17