mining entities to rules with mentor

59
Mining Entities to Rules MEntoR Angela Lozano , Andy Kellens, Kim Mens, Gabriela Arevalo Thursday 16 December 2010

Post on 21-Oct-2014

243 views

Category:

Technology


0 download

DESCRIPTION

Presentation at BENEVOL 2010

TRANSCRIPT

Page 1: Mining Entities to Rules with MEntoR

Mining Entities to RulesMEntoR

Angela Lozano, Andy Kellens,

Kim Mens, Gabriela Arevalo

Thursday 16 December 2010

Page 2: Mining Entities to Rules with MEntoR

source code regularities• Implementation standards

e.g. idioms, naming conventions, design patterns....

• Encode design decisions

• Facilitate comprehension, maintenance, & evolution

• Are implicit = often not fully respected

2/9

Thursday 16 December 2010

Page 3: Mining Entities to Rules with MEntoR

source code regularities• Implementation standards

e.g. idioms, naming conventions, design patterns....

• Encode design decisions

• Facilitate comprehension, maintenance, & evolution

• Are implicit = often not fully respected

We can mine for regularities BUT

their usefulness might be ‘entity-dependent’

2/9

Thursday 16 December 2010

Page 4: Mining Entities to Rules with MEntoR

Motivation3/9

Thursday 16 December 2010

Page 5: Mining Entities to Rules with MEntoR

Motivation3/9

how to add a new action to the app?

let me see

Thursday 16 December 2010

Page 6: Mining Entities to Rules with MEntoR

Motivation3/9

how to add a new action to the app?here!

Thursday 16 December 2010

Page 7: Mining Entities to Rules with MEntoR

Motivation3/9

Source code is reliable

how to add a new action to the app?

Thursday 16 December 2010

Page 8: Mining Entities to Rules with MEntoR

Motivation3/9

Source code is reliable

are there other examples of actions?here!

Thursday 16 December 2010

Page 9: Mining Entities to Rules with MEntoR

Motivation3/9

Source code is reliable

which other methods should I add?here!

Thursday 16 December 2010

Page 10: Mining Entities to Rules with MEntoR

Motivation3/9

Source code is reliableIt condenses design knowledge

which other methods should I add?

Thursday 16 December 2010

Page 11: Mining Entities to Rules with MEntoR

Motivation3/9

Source code is reliableIt condenses design knowledge

which other methods should I add?

are all actions implemented using the command pattern?

Thursday 16 December 2010

Page 12: Mining Entities to Rules with MEntoR

Motivation3/9

Source code is reliableIt condenses design knowledge

which other methods should I add?

are all methods related to actions documented?

Thursday 16 December 2010

Page 13: Mining Entities to Rules with MEntoR

Motivation3/9

Source code is reliableIt condenses design knowledge

All developers need such knowledge to keep consistency

which other methods should I add?

are all methods related to actions documented?

Thursday 16 December 2010

Page 14: Mining Entities to Rules with MEntoR

Motivation3/9

Source code is reliableIt condenses design knowledge

All developers need such knowledge to keep consistency

which other methods should I add?

are all methods related to actions documented?

Thursday 16 December 2010

Page 15: Mining Entities to Rules with MEntoR

Motivation3/9

Source code is reliableIt condenses design knowledge

All developers need such knowledge to keep consistency

We need automatic support to detect design knowledge in the code

which other methods should I add?

are all methods related to actions documented?

Thursday 16 December 2010

Page 16: Mining Entities to Rules with MEntoR

4/9

Thursday 16 December 2010

Page 17: Mining Entities to Rules with MEntoR

4/9

Thursday 16 December 2010

Page 18: Mining Entities to Rules with MEntoR

4/9

Thursday 16 December 2010

Page 19: Mining Entities to Rules with MEntoR

4/9

Thursday 16 December 2010

Page 20: Mining Entities to Rules with MEntoR

4/9

Thursday 16 December 2010

Page 21: Mining Entities to Rules with MEntoR

4/9

Thursday 16 December 2010

Page 22: Mining Entities to Rules with MEntoR

4/9

--------------------------CId>Action Impl>performAction -Impl>isUndoable -Hier>AddObjectAction -Ref>MenuService

AbstractAddAction ------X ----------------- X ------------------------X -----------------------X ---------------------X

AddObjectAction --------X ----------------- -------------------------------------------------------- ---------------------X

Thursday 16 December 2010

Page 23: Mining Entities to Rules with MEntoR

ImplicationsH>ArrayedCollection ==> Id>'Array'

True in a closed world

Subset relation in the FCA latticeH>ArrayedCollection

Id>Array

ArrayedCollection Array CharacterArray

5/9

Characterizing Collection Classes

Characterizing Collection Classes

AttributesAttributesAttributesAttributesAttributes

Characterizing Collection Classes

Characterizing Collection Classes

Collection * *

SequenceableCollection * * *

OrderedCollection * * *

ArrayedCollection * * * * *

Array * * * *

CharacterArray * * * *

H>

Col

lect

ion

H>

Sequ

ence

able

Col

lect

ion

H>

Arr

ayed

Col

lect

ion

Id>

Col

lect

ion

Id>

Arr

ay

Cla

sses

Thursday 16 December 2010

Page 24: Mining Entities to Rules with MEntoR

ImplicationsH>ArrayedCollection ==> Id>'Array'

True in a closed world

Subset relation in the FCA lattice

AsssociationsH>Collection --83%--> H>SequenceableCollection

Most collections are sequenceable; but Collections is not

Superset or siblings relation in the FCA lattice

H>ArrayedCollectionId>Array

ArrayedCollection Array CharacterArray

H>Collection

H>SequenceableCollection

SequenceableCollection OrderedCollection ArrayedCollection Array CharacterArray

Collection

5/9

Characterizing Collection Classes

Characterizing Collection Classes

AttributesAttributesAttributesAttributesAttributes

Characterizing Collection Classes

Characterizing Collection Classes

Collection * *

SequenceableCollection * * *

OrderedCollection * * *

ArrayedCollection * * * * *

Array * * * *

CharacterArray * * * *

H>

Col

lect

ion

H>

Sequ

ence

able

Col

lect

ion

H>

Arr

ayed

Col

lect

ion

Id>

Col

lect

ion

Id>

Arr

ay

Cla

sses

Condition*Conclusion

Thursday 16 December 2010

Page 25: Mining Entities to Rules with MEntoR

A regularity is a set of intersecting rules6/9

Thursday 16 December 2010

Page 26: Mining Entities to Rules with MEntoR

CId>ActionHier>IntensiVEAction

.

A regularity is a set of intersecting rules

. . . . . . . . . . . . . . . . . . . . . . .

6/9

Rule 1:CId>Action ==>Hier>IntensiVEAction

Thursday 16 December 2010

Page 27: Mining Entities to Rules with MEntoR

Impl>performAction

Impl>undoActio

CId>ActionHier>IntensiVEAction

.

A regularity is a set of intersecting rules

. . . . . . . . . . . . . . . . . . . . . . .

6/9

Rule 2:Impl>undoAction ==>Impl>performAction

Thursday 16 December 2010

Page 28: Mining Entities to Rules with MEntoR

Impl>performAction

Impl>undoActio Hier>AbstractAction

Impl>name. . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . .

.

CId>ActionHier>IntensiVEAction

.

A regularity is a set of intersecting rules

. . . . . . . . . . . . . . . . . . . . . . .

6/9

Rule 3:Hier>AbstractAction -->Impl>name

Thursday 16 December 2010

Page 29: Mining Entities to Rules with MEntoR

Impl>performAction

Impl>undoActio

23 classes match

Hier>AbstractAction

Impl>name. . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . .

.

CId>ActionHier>IntensiVEAction

.

A regularity is a set of intersecting rules

. . . . . . . . . . . . . . . . . . . . . . .

6/9

Thursday 16 December 2010

Page 30: Mining Entities to Rules with MEntoR

7/9

. . .

. . .

MEntoR

. . . . . . . . . . .

. . . . . . . . . . .

If the entity in focus is here

The usefulness of a rule might be ‘entity-dependent’MEntoR is based on the entity in focus

Condition properties → Conclusion properties

Thursday 16 December 2010

Page 31: Mining Entities to Rules with MEntoR

7/9

. . .

. . .

MEntoR

. . . . . . . . . . .

. . . . . . . . . . .

If the entity in focus is here

The usefulness of a rule might be ‘entity-dependent’MEntoR is based on the entity in focus

Condition properties → Conclusion properties

Thursday 16 December 2010

Page 32: Mining Entities to Rules with MEntoR

7/9

. . .

. . .

MEntoR

. . . . . . . . . . .

. . . . . . . . . . .

If the entity in focus is here

the entity is classified as

The usefulness of a rule might be ‘entity-dependent’MEntoR is based on the entity in focus

Condition properties → Conclusion properties

Thursday 16 December 2010

Page 33: Mining Entities to Rules with MEntoR

7/9

. . .

. . .

MEntoR

. . . . . . . . . . .

. . . . . . . . . . .

If the entity in focus is here

an error

the entity is classified as

The usefulness of a rule might be ‘entity-dependent’MEntoR is based on the entity in focus

Condition properties → Conclusion properties

of the ruleThursday 16 December 2010

Page 34: Mining Entities to Rules with MEntoR

7/9

. . .

. . .

MEntoR

. . . . . . . . . . .

. . . . . . . . . . .

If the entity in focus is here

an error

the entity is classified as

The usefulness of a rule might be ‘entity-dependent’MEntoR is based on the entity in focus

Condition properties → Conclusion properties

of the ruleThursday 16 December 2010

Page 35: Mining Entities to Rules with MEntoR

7/9

. . .

. . .

MEntoR

. . . . . . . . . . .

. . . . . . . . . . .

If the entity in focus is here

an error

the entity is classified as

satisfied example

The usefulness of a rule might be ‘entity-dependent’MEntoR is based on the entity in focus

Condition properties → Conclusion properties

of the ruleThursday 16 December 2010

Page 36: Mining Entities to Rules with MEntoR

7/9

. . .

. . .

MEntoR

. . . . . . . . . . .

. . . . . . . . . . .

If the entity in focus is here

an error

the entity is classified as

satisfied example

The usefulness of a rule might be ‘entity-dependent’MEntoR is based on the entity in focus

Condition properties → Conclusion properties

of the ruleThursday 16 December 2010

Page 37: Mining Entities to Rules with MEntoR

7/9

. . .

. . .

MEntoR

. . . . . . . . . . .

. . . . . . . . . . .

If the entity in focus is here

an error

the entity is classified as

satisfied example a suggestion

The usefulness of a rule might be ‘entity-dependent’MEntoR is based on the entity in focus

Condition properties → Conclusion properties

of the ruleThursday 16 December 2010

Page 38: Mining Entities to Rules with MEntoR

8/9 MEntoR

Thursday 16 December 2010

Page 39: Mining Entities to Rules with MEntoR

8/9 MEntoR

Thursday 16 December 2010

Page 40: Mining Entities to Rules with MEntoR

MEntoR8/9

Context is given by the entity in focus

Thursday 16 December 2010

Page 41: Mining Entities to Rules with MEntoR

MEntoR8/9

Entityin

focus

Context is given by the entity in focus

Thursday 16 December 2010

Page 42: Mining Entities to Rules with MEntoR

8/9 MEntoR

Thursday 16 December 2010

Page 43: Mining Entities to Rules with MEntoR

8/9

Selected rule

Shows the rules related to the entity in focus

MEntoR

Thursday 16 December 2010

Page 44: Mining Entities to Rules with MEntoR

8/9

Selected rule

Shows the rules related to the entity in focus

MEntoR

Rule pretty printed

Thursday 16 December 2010

Page 45: Mining Entities to Rules with MEntoR

MEntoR8/9

Thursday 16 December 2010

Page 46: Mining Entities to Rules with MEntoR

Entity in focus

MEntoR8/9

Thursday 16 December 2010

Page 47: Mining Entities to Rules with MEntoR

Entity in focus

Errors

MEntoRRules in which the entity complies with the condition

but not with the conclusion (errors)

8/9

Thursday 16 December 2010

Page 48: Mining Entities to Rules with MEntoR

MEntoR8/9

Thursday 16 December 2010

Page 49: Mining Entities to Rules with MEntoR

MEntoR

Entity in focus

8/9

Thursday 16 December 2010

Page 50: Mining Entities to Rules with MEntoR

Rules in which the entity complies with the condition and with the conclusion (satisfied)

MEntoR

Satisfied rulesEntity in focus

8/9

Thursday 16 December 2010

Page 51: Mining Entities to Rules with MEntoR

MEntoR8/9

Thursday 16 December 2010

Page 52: Mining Entities to Rules with MEntoR

MEntoR

Entity in focus

8/9

Thursday 16 December 2010

Page 53: Mining Entities to Rules with MEntoR

Rules in which the entity complies partially with the conclusion but not with the condition (suggestions)

Suggestions

MEntoR

Entity in focus

8/9

Thursday 16 December 2010

Page 54: Mining Entities to Rules with MEntoR

MEntoR

Entity in focusTag

options

8/9

Thursday 16 December 2010

Page 55: Mining Entities to Rules with MEntoR

MEntoR

Entity in focus

8/9

Rule View

Thursday 16 December 2010

Page 56: Mining Entities to Rules with MEntoR

IVAbstractEntityIVCheckeableEntity

IVComposableEntityDefinitonIVPersistentEntity

UncheckedEntityEditor

CId>EntityHier>Classifications2.AbstractClassification

Hier>Intensional.IVAbstractEntity

IVViewDef

......

MEntoR8/9

Thursday 16 December 2010

Page 57: Mining Entities to Rules with MEntoR

MEntoR8/9

Thursday 16 December 2010

Page 58: Mining Entities to Rules with MEntoR

IVAbstractEntityIVCheckeableEntity

IVComposableEntityDefinitonIVPersistentEntity

UncheckedEntityEditor

CId>EntityHier>Classifications2.AbstractClassification

Hier>Intensional.IVAbstractEntity

IVViewDef

......

MEntoR8/9

Thursday 16 December 2010

Page 59: Mining Entities to Rules with MEntoR

9/9 Clairvoyant

Thursday 16 December 2010