Mining Entities to Rules with MEntoR

Post on 21-Oct-2014

239 views 0 download

Tags:

description

Presentation at BENEVOL 2010

transcript

Mining Entities to RulesMEntoR

Angela Lozano, Andy Kellens,

Kim Mens, Gabriela Arevalo

Thursday 16 December 2010

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

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

Motivation3/9

Thursday 16 December 2010

Motivation3/9

how to add a new action to the app?

let me see

Thursday 16 December 2010

Motivation3/9

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

Thursday 16 December 2010

Motivation3/9

Source code is reliable

how to add a new action to the app?

Thursday 16 December 2010

Motivation3/9

Source code is reliable

are there other examples of actions?here!

Thursday 16 December 2010

Motivation3/9

Source code is reliable

which other methods should I add?here!

Thursday 16 December 2010

Motivation3/9

Source code is reliableIt condenses design knowledge

which other methods should I add?

Thursday 16 December 2010

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

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

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

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

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

4/9

Thursday 16 December 2010

4/9

Thursday 16 December 2010

4/9

Thursday 16 December 2010

4/9

Thursday 16 December 2010

4/9

Thursday 16 December 2010

4/9

Thursday 16 December 2010

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

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

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

A regularity is a set of intersecting rules6/9

Thursday 16 December 2010

CId>ActionHier>IntensiVEAction

.

A regularity is a set of intersecting rules

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

6/9

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

Thursday 16 December 2010

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

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

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

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

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

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

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

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

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

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

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

8/9 MEntoR

Thursday 16 December 2010

8/9 MEntoR

Thursday 16 December 2010

MEntoR8/9

Context is given by the entity in focus

Thursday 16 December 2010

MEntoR8/9

Entityin

focus

Context is given by the entity in focus

Thursday 16 December 2010

8/9 MEntoR

Thursday 16 December 2010

8/9

Selected rule

Shows the rules related to the entity in focus

MEntoR

Thursday 16 December 2010

8/9

Selected rule

Shows the rules related to the entity in focus

MEntoR

Rule pretty printed

Thursday 16 December 2010

MEntoR8/9

Thursday 16 December 2010

Entity in focus

MEntoR8/9

Thursday 16 December 2010

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

MEntoR8/9

Thursday 16 December 2010

MEntoR

Entity in focus

8/9

Thursday 16 December 2010

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

MEntoR8/9

Thursday 16 December 2010

MEntoR

Entity in focus

8/9

Thursday 16 December 2010

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

MEntoR

Entity in focusTag

options

8/9

Thursday 16 December 2010

MEntoR

Entity in focus

8/9

Rule View

Thursday 16 December 2010

IVAbstractEntityIVCheckeableEntity

IVComposableEntityDefinitonIVPersistentEntity

UncheckedEntityEditor

CId>EntityHier>Classifications2.AbstractClassification

Hier>Intensional.IVAbstractEntity

IVViewDef

......

MEntoR8/9

Thursday 16 December 2010

MEntoR8/9

Thursday 16 December 2010

IVAbstractEntityIVCheckeableEntity

IVComposableEntityDefinitonIVPersistentEntity

UncheckedEntityEditor

CId>EntityHier>Classifications2.AbstractClassification

Hier>Intensional.IVAbstractEntity

IVViewDef

......

MEntoR8/9

Thursday 16 December 2010

9/9 Clairvoyant

Thursday 16 December 2010