Object Flow Analysis

860 views

Published on

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
860
On SlideShare
0
From Embeds
0
Number of Embeds
29
Actions
Shares
0
Downloads
12
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Object Flow Analysis

  1. 1. Object Flow Analysis – Taking an Object-centric View on Dynamic Analysis Adrian Lienhard1, Stéphane Ducasse2 and Tudor Gîrba1 1Software Composition Group, University of Bern, Switzerland 2 LISTIC, University of Savoie, France
  2. 2. 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? Object Flow Analysis — Taking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch
  3. 3. 1) the method execution perspective MethodNode>>generate ASTTranslator class>>new ... ... IRBuilder>>initialize IRMethod class>>new ... ASTTranslator>>visitNode: ASTTranslator>>ir IRMethod>>compiledMethod IRTranlator class>new Object Flow Analysis — Taking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch
  4. 4. 1) the method execution perspective MethodNode>>generate ASTTranslator class>>new ... ... IRBuilder>>initialize “How is the IRMethod IRMethod class>>new instance passed to ? ... ASTTranslator>>visitNode: MethodNode?” ASTTranslator>>ir IRMethod>>compiledMethod IRTranlator class>new Object Flow Analysis — Taking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch
  5. 5. 2) the object interrelationship perspective :IRMethod :MethodNode :IRBuilder :IRSequence :ASTTranslator Object Flow Analysis — Taking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch
  6. 6. 2) the object interrelationship perspective ? “How is the IRMethod :IRMethod :MethodNode instance passed to MethodNode?” :IRBuilder :IRSequence :ASTTranslator Object Flow Analysis — Taking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch
  7. 7. MethodNode>>generate ASTTranslator class>>new ... ? ... :IRMethod :MethodNode IRBuilder>>initialize IRMethod class>>new ? ... ASTTranslator>>visitNode: interdependency? :IRBuilder :IRSequence ASTTranslator>>ir IRMethod>>compiledMethod IRTranlator class>new :ASTTranslator Object Flow Analysis — Taking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch
  8. 8. MethodNode>>generate ASTTranslator class>>new ... ? ... :IRMethod :MethodNode IRBuilder>>initialize IRMethod class>>new ? ... ASTTranslator>>visitNode: interdependency? :IRBuilder :IRSequence ASTTranslator>>ir IRMethod>>compiledMethod IRTranlator class>new :ASTTranslator Object Flow Analysis track the transfer of object references Object Flow Analysis — Taking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch
  9. 9. Object Flow IRBuilder>>initialize ir := IRMethod new. instantiation field store Analysis ... IRBuilder>>startNewSequence newSequence := IRSequence new. newSequence method: ir. field read IRSequence>>method: aMethod argument method := aMethod. field store a) capture all ASTTranslator>>ir ^ builder ir. return references of an MethodNode>>generate object ast := ASTTranslator new visitNode: self. ir := ast ir. return ^ ir compiledMethod. field store field read b) track the IRMethod>>compiledMethod ^ compiledMethod := IRTranslator new transfer of interpret: self; compiledMethod. references IRTranslator>>interpret: ir argument ... Object Flow Analysis — Taking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch
  10. 10. Object Flow IRBuilder>>initialize ir := IRMethod new. instantiation instantiation field write field write Analysis ... IRBuilder>>startNewSequence newSequence := IRSequence new. newSequence method: ir. field read IRSequence>>method: aMethod argument method := aMethod. field write a) capture all ASTTranslator>>ir ^ builder ir. return return references of an MethodNode>>generate object ast := ASTTranslator new visitNode: self. ir := ast ir. return return ^ ir compiledMethod. field write field write field read field read b) track the IRMethod>>compiledMethod ^ compiledMethod := IRTranslator new transfer of interpret: self; compiledMethod. references IRTranslator>>interpret: ir argumentargument ... Object Flow Analysis — Taking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch
  11. 11. Object Flow IRBuilder>>initialize ir := IRMethod new. instantiation instantiation field store write field write 1 Analysis ... 1 IRBuilder>>startNewSequence newSequence := IRSequence new. newSequence method: ir. field read 2 2 IRSequence>>method: aMethod argument method := aMethod. field store write “How is the IRMethod ASTTranslator>>ir ^ builder ir. return return instance passed to 3 MethodNode>>generate 3 MethodNode?” ast := ASTTranslator new visitNode: self. ir := ast ir. return return ^ ir compiledMethod. field write field write store field read field read IRMethod>>compiledMethod ^ compiledMethod := IRTranslator new interpret: self; compiledMethod. IRTranslator>>interpret: ir argumentargument ... Object Flow Analysis — Taking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch
  12. 12. Application How do classes exchange objects? Object Flow Analysis — Taking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch
  13. 13. Inter-unit flow view Object Flow Analysis — Taking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch
  14. 14. Inter-unit flow view classes containedInPackage: ʼAST-Nodesʼ mapTo: ʼASTʼ. classes hierarchyRootedIn: ʼIRInstructionʼ mapTo: ʼIntermediate-Representationʼ Object Flow Analysis — Taking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch
  15. 15. Inter-unit flow view Object Flow Analysis — Taking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch
  16. 16. Chronological propagation Object Flow Analysis — Taking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch
  17. 17. Chronological propagation Object Flow Analysis — Taking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch
  18. 18. Chronological propagation Object Flow Analysis — Taking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch
  19. 19. Parser (4) Spanning flows Object Flow Analysis — Taking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch
  20. 20. Spanning flows IRBuilder Object Flow Analysis — Taking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch
  21. 21. timeline Object Flow Analysis — Taking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch
  22. 22. objects created in IRBuilder timeline Object Flow Analysis — Taking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch
  23. 23. timeline Object Flow Analysis — Taking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch
  24. 24. objects passed through directly timeline Object Flow Analysis — Taking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch
  25. 25. timeline Object Flow Analysis — Taking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch
  26. 26. objects stored in an instance variable timeline Object Flow Analysis — Taking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch
  27. 27. timeline Object Flow Analysis — Taking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch
  28. 28. objects passed out multiple times timeline Object Flow Analysis — Taking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch
  29. 29. timeline Object Flow Analysis — Taking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch
  30. 30. Representing object flows IRBuilder>>initialize instantiation ir := IRMethod new. ... field store write IRBuilder>>startNewSequence newSequence := IRSequence new. newSequence method: ir. field read IRSequence>>method: aMethod argument method := aMethod. field store write ASTTranslator>>ir ^ builder ir. return MethodNode>>generate ast := ASTTranslator new visitNode: self. return ir := ast ir. field store ^ ir compiledMethod. field read ... Object Flow Analysis — Taking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch
  31. 31. Representing object flows IRBuilder>>initialize instantiation ir := IRMethod new. Instance ... field store write IRBuilder>>startNewSequence newSequence := IRSequence new. field read parent newSequence method: ir. 0..1 Alias IRSequence>>method: aMethod argument * method := aMethod. field store write child ASTTranslator>>ir ^ builder ir. return MethodNode>>generate ast := ASTTranslator new visitNode: self. return ir := ast ir. field store ^ ir compiledMethod. field read ... Object Flow Analysis — Taking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch
  32. 32. Representing object flows instantiation Instance field store write field read parent 0..1 Alias argument * field store write child return ... ArgumentAlias ReturnAlias FieldWriteAlias self. return field store field read ... Object Flow Analysis — Taking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch
  33. 33. Representing object flows n Instance Class sender parent 0..1 * 0..1 receiver Alias Activation Method * child creator Attribute turn ... ArgumentAlias ReturnAlias FieldWriteAlias turn store d read ... Object Flow Analysis — Taking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch
  34. 34. Summary IRBuilder>>initialize instantiation ir := IRMethod new. Instance Class ... field store write IRBuilder>>startNewSequence sender newSequence := IRSequence new. 0..1 field read parent * newSequence method: ir. 0..1 receiver Alias Activation Method IRSequence>>method: aMethod argument * method := aMethod. field write store creator child Attribute ASTTranslator>>ir ^ builder ir. return ... ArgumentAlias ReturnAlias FieldWriteAlias MethodNode>>generate ast := ASTTranslator new visitNode: self. return ir := ast ir. field store ^ ir compiledMethod. field read ... Object Flow Analysis — Taking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch
  35. 35. Summary IRBuilder>>initialize instantiation ir := IRMethod new. Instance Class ... field store write IRBuilder>>startNewSequence sender newSequence := IRSequence new. 0..1 field read parent * newSequence method: ir. 0..1 receiver Alias Activation Method IRSequence>>method: aMethod argument * method := aMethod. field write store creator child Attribute ASTTranslator>>ir ^ builder ir. return ... ArgumentAlias ReturnAlias FieldWriteAlias MethodNode>>generate ast := ASTTranslator new visitNode: self. return ir := ast ir. field store ^ ir compiledMethod. field read ... Questions? Object Flow Analysis — Taking an Object-centric View on Dynamic Analysis : : Adrian Lienhard : : lienhard@iam.unibe.ch

×