Object Flow Analysis Taking an Object-centric View on Dynamic - - PowerPoint PPT Presentation

object flow analysis taking an object centric view on
SMART_READER_LITE
LIVE PREVIEW

Object Flow Analysis Taking an Object-centric View on Dynamic - - PowerPoint PPT Presentation

Object Flow Analysis Taking an Object-centric View on Dynamic Analysis Adrian Lienhard 1 , Stphane Ducasse 2 and T udor Grba 1 1 Software Composition Group, University of Bern, Switzerland 2 LISTIC, University of Savoie, France A missing


slide-1
SLIDE 1

Object Flow Analysis – Taking an Object-centric View

  • n Dynamic Analysis

Adrian Lienhard1, Stéphane Ducasse2 and T udor Gîrba1

1Software Composition Group, University of Bern, Switzerland 2 LISTIC, University of Savoie, France

slide-2
SLIDE 2

Object Flow Analysis — T aking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch

A missing aspect of OO dynamic analysis

Typical characterization of OO program execution: 1) message passing 2) object interrelationships How are objects passed throught the system?

slide-3
SLIDE 3

Object Flow Analysis — T aking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch

1) the method execution perspective

MethodNode>>generate ASTTranslator class>>new ... ... IRBuilder>>initialize IRMethod class>>new ... ASTTranslator>>visitNode: ASTTranslator>>ir IRMethod>>compiledMethod IRTranlator class>new

slide-4
SLIDE 4

Object Flow Analysis — T aking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch

1) the method execution perspective

“How is the IRMethod instance passed to MethodNode?”

MethodNode>>generate ASTTranslator class>>new ... ... IRBuilder>>initialize IRMethod class>>new ... ASTTranslator>>visitNode: ASTTranslator>>ir IRMethod>>compiledMethod IRTranlator class>new ?

slide-5
SLIDE 5

Object Flow Analysis — T aking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch

:IRBuilder :IRMethod :IRSequence :MethodNode :ASTTranslator

2) the object interrelationship perspective

slide-6
SLIDE 6

Object Flow Analysis — T aking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch

“How is the IRMethod instance passed to MethodNode?”

:IRBuilder :IRMethod :IRSequence :MethodNode :ASTTranslator

?

2) the object interrelationship perspective

slide-7
SLIDE 7

Object Flow Analysis — T aking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch

:IRBuilder :IRMethod :IRSequence :MethodNode :ASTTranslator

? MethodNode>>generate ASTTranslator class>>new ... ... IRBuilder>>initialize IRMethod class>>new ... ASTTranslator>>visitNode: ASTTranslator>>ir IRMethod>>compiledMethod IRTranlator class>new ?

interdependency? Object Flow Analysis track the transfer of object references

slide-8
SLIDE 8

Object Flow Analysis — T aking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch

a) capture all references of an

  • bject

b) track the transfer of references

Object Flow Analysis

instantiation field store field read argument field store return return field store argument field read IRBuilder>>initialize ir := IRMethod new. ... IRBuilder>>startNewSequence newSequence := IRSequence new. newSequence method: ir. IRSequence>>method: aMethod method := aMethod. ASTTranslator>>ir ^ builder ir. MethodNode>>generate ast := ASTTranslator new visitNode: self. ir := ast ir. ^ ir compiledMethod. IRMethod>>compiledMethod ^ compiledMethod := IRTranslator new interpret: self; compiledMethod. IRTranslator>>interpret: ir ...

slide-9
SLIDE 9

Object Flow Analysis — T aking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch

a) capture all references of an

  • bject

b) track the transfer of references

Object Flow Analysis

instantiation field write field read argument field write return return field write argument field read IRBuilder>>initialize ir := IRMethod new. ... IRBuilder>>startNewSequence newSequence := IRSequence new. newSequence method: ir. IRSequence>>method: aMethod method := aMethod. ASTTranslator>>ir ^ builder ir. MethodNode>>generate ast := ASTTranslator new visitNode: self. ir := ast ir. ^ ir compiledMethod. IRMethod>>compiledMethod ^ compiledMethod := IRTranslator new interpret: self; compiledMethod. IRTranslator>>interpret: ir ... instantiation field write field read argument field write return return field write argument field read

slide-10
SLIDE 10

Object Flow Analysis — T aking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch

Object Flow Analysis

instantiation field write field read argument field write return return field write argument field read IRBuilder>>initialize ir := IRMethod new. ... IRBuilder>>startNewSequence newSequence := IRSequence new. newSequence method: ir. IRSequence>>method: aMethod method := aMethod. ASTTranslator>>ir ^ builder ir. MethodNode>>generate ast := ASTTranslator new visitNode: self. ir := ast ir. ^ ir compiledMethod. IRMethod>>compiledMethod ^ compiledMethod := IRTranslator new interpret: self; compiledMethod. IRTranslator>>interpret: ir ... instantiation field write field read argument field write return return field write argument field read instantiation field store field read argument field store return return field store argument field read IRBuilder>>initialize ir := IRMethod new. ... IRBuilder>>startNewSequence newSequence := IRSequence new. newSequence method: ir. IRSequence>>method: aMethod method := aMethod. ASTTranslator>>ir ^ builder ir. MethodNode>>generate ast := ASTTranslator new visitNode: self. ir := ast ir. ^ ir compiledMethod. IRMethod>>compiledMethod ^ compiledMethod := IRTranslator new interpret: self; compiledMethod. IRTranslator>>interpret: ir ... instantiation field write field read argument field write return return field write argument field read 2 3 2 3 1 1

“How is the IRMethod instance passed to MethodNode?”

slide-11
SLIDE 11

Object Flow Analysis — T aking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch

Application How do classes exchange objects?

slide-12
SLIDE 12

Object Flow Analysis — T aking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch

Inter-unit flow view

classes containedInPackage: ’AST-Nodes’ mapTo: ’AST’. classes hierarchyRootedIn: ’IRInstruction’ mapTo: ’Intermediate-Representation’

slide-13
SLIDE 13

Object Flow Analysis — T aking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch

Chronological propagation

slide-14
SLIDE 14

Object Flow Analysis — T aking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch

Spanning flows

Parser (4)

slide-15
SLIDE 15

Object Flow Analysis — T aking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch

Spanning flows

IRBuilder

slide-16
SLIDE 16

Object Flow Analysis — T aking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch

  • bjects stored

in an instance variable

  • bjects passed out

multiple times

  • bjects passed

through directly

  • bjects created in

IRBuilder timeline

slide-17
SLIDE 17

Object Flow Analysis — T aking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch

Representing object flows

IRBuilder>>initialize ir := IRMethod new. ... IRBuilder>>startNewSequence newSequence := IRSequence new. newSequence method: ir. IRSequence>>method: aMethod method := aMethod. ASTTranslator>>ir ^ builder ir. MethodNode>>generate ast := ASTTranslator new visitNode: self. ir := ast ir. ^ ir compiledMethod. instantiation field store field read argument field store return return field store field read instantiation field write field read argument field write return return ...

slide-18
SLIDE 18

Object Flow Analysis — T aking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch

Representing object flows

IRBuilder>>initialize ir := IRMethod new. ... IRBuilder>>startNewSequence newSequence := IRSequence new. newSequence method: ir. IRSequence>>method: aMethod method := aMethod. ASTTranslator>>ir ^ builder ir. MethodNode>>generate ast := ASTTranslator new visitNode: self. ir := ast ir. ^ ir compiledMethod. instantiation field store field read argument field store return return field store field read instantiation field write field read argument field write return return ...

Alias

* 0..1 parent child Instance

slide-19
SLIDE 19

Object Flow Analysis — T aking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch

Representing object flows

ranslator new visitNode: self. instantiation field store field read argument field store return return field store field read instantiation field write field read argument field write return return ...

Alias

* 0..1 parent child Instance ArgumentAlias FieldWriteAlias ReturnAlias ...

slide-20
SLIDE 20

Object Flow Analysis — T aking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch

Representing object flows

return return eld store eld read return return

Alias

* 0..1 parent child Instance ArgumentAlias FieldWriteAlias ReturnAlias ... 0..1 * sender Method Class Attribute Activation receiver creator

slide-21
SLIDE 21

Object Flow Analysis — T aking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch

Summary

IRBuilder>>initialize ir := IRMethod new. ... IRBuilder>>startNewSequence newSequence := IRSequence new. newSequence method: ir. IRSequence>>method: aMethod method := aMethod. ASTTranslator>>ir ^ builder ir. MethodNode>>generate ast := ASTTranslator new visitNode: self. ir := ast ir. ^ ir compiledMethod. instantiation field store field read argument field store return return field store field read instantiation field write field read argument field write return return ...

Alias

* 0..1 parent child Instance ArgumentAlias FieldWriteAlias ReturnAlias ... 0..1 * sender Method Class Attribute Activation receiver creator

Questions?