Dynamic Object Flow Analysis (PhD Defense)

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    Dynamic Object Flow Analysis (PhD Defense) - Presentation Transcript

    1. Dynamic Object Flow Analysis PhD defense Adrian Lienhard Advisor: Oscar Nierstrasz
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. image:Image copy:Image a1 a2 :File name = 'cat.jpg' image := Image newFor: file. // creates a1 copy := image duplicate. // creates a2 7
    8. image:Image copy:Image a1 a2 :File name = nil image := Image newFor: file. // creates a1 copy := image duplicate. // creates a2 copy delete // file.name := nil 8
    9. image:Image copy:Image a1 a2 :File name = nil image := Image newFor: file. // creates a1 copy := image duplicate. // creates a2 copy delete // file.name := nil image display // file.name asUrl NullPointerException 9
    10. image:Image copy:Image a1 a2 :File name = nil image := aliasing is a problem because a1 Object Image newFor: file. // creates copy := image duplicate. // creates a2 it introduces hidden dependencies. copy delete // file.name := nil image display // file.name asUrl NullPointerException 10
    11. Dynamic Control Flow Analysis 11
    12. Dynamic Control Flow Analysis delete upload 12
    13. Dynamic Control Flow Analysis delete upload Feature "Upload" Feature "Duplicate" Feature "Delete" [Salah and Mancoridis ICSM'04] 13
    14. Dynamic Control Flow Analysis ? delete upload Feature "Upload" Feature "Duplicate" Feature "Delete" 14
    15. Dynamic Data Analysis image:Image copy:Image a1 a2 :File name = 'cat.jpg' 15
    16. Dynamic Data Analysis Reference Patterns Ownership Trees [De Pauw, Sevitsky ECOOP’99] [Hill, Noble, Potter JVLC’02] 16
    17. Dynamic Data Analysis image:Image copy:Image a1 a2 :File name = 'cat.jpg' 17
    18. Dynamic Data Analysis image:Image ? copy:Image a1 a2 :File name = 'cat.jpg' 18
    19. Dynamic Analysis control flow data data flow ! ! ? method reference reference execution structure transfer 19
    20. Dynamic Analysis control flow data data flow ! ! ? method reference reference execution structure transfer 20
    21. Thesis Object references must be captured and modeled explicitly. 21
    22. image:Image copy:Image Runtime a1 a2 :File Object Flow Metamodel 22
    23. image:Image copy:Image Runtime a1 a2 :File Object Flow Metamodel Object 23
    24. image:Image copy:Image Runtime a1 a2 :File Object Flow Metamodel * 1 Alias Object value 24
    25. image:Image copy:Image Runtime a1 a2 :File Object Flow Metamodel 0..1 * 1 * Alias Object origin value 25
    26. Runtime Object Flow Metamodel 0..1 * * 1 * Alias Object origin value 26
    27. Runtime caller 0..1 Activation Object Flow * Metamodel 0..1 * 1 * Alias Object origin value 27
    28. Runtime caller 0..1 Activation Object Flow * 1 context Metamodel 0..1 * * 1 * Alias Object origin value 28
    29. delete upload duplicate Runtime caller 0..1 Activation Object Flow * 1 context Metamodel 0..1 * * 1 * Alias Object origin value 29
    30. Object Flow 30
    31. Visualizing Feature Test Object Flows Dependencies Blueprints Runtime Monitoring in the VM Metamodel Activation Alias Object origin Object Tracking 31
    32. Visualizing Feature Test Object Flows Dependencies Blueprints Runtime Monitoring in the VM Metamodel Activation Alias Object origin Object Tracking 32
    33. Visualizing Feature Test Object Flows Dependencies Blueprints Runtime Monitoring in the VM Metamodel Activation Alias Object origin Object Tracking 33
    34. Visualizing Feature Test Object Flows Dependencies Blueprints Runtime Monitoring in the VM Metamodel Activation Alias Object origin Object Tracking 34
    35. Visualizing Feature Test Object Flows Dependencies Blueprints Runtime Monitoring in the VM Metamodel Activation Alias Object origin Object Tracking 35
    36. Visualizing Feature Test Object Flows Dependencies Blueprints Runtime Monitoring in the VM Metamodel Activation Alias Object origin Object Tracking 36
    37. Detecting flows between classes Activation 1 context 0..1 * * * 1 Alias Object origin value 37
    38. Detecting flows between classes Method 1 * Activation 1 context 0..1 * * * 1 Alias Object origin value 38
    39. Detecting flows between classes Class A Class 1 * Method Class B 1 * Activation 1 context Class C 0..1 * * * 1 Alias Object origin value 39
    40. Detecting flows between classes Class A Class 1 * Method Class B 1 * Activation 1 context Class C 0..1 * * * 1 Alias Object origin value 40
    41. Inter-unit Flow View 41
    42. Chronological propagation 42
    43. Chronological propagation 42
    44. Chronological propagation 42
    45. Spanning flows Parser (4) 43
    46. Spanning flows IRBuilder 44
    47. Visualizing Feature Test Object Flows Dependencies Blueprints Runtime Monitoring in the VM l. ard eta [ Lienh AN'09] L COM Metamodel Activation Alias Object origin Object Tracking 45
    48. Visualizing Feature Test Object Flows Dependencies Blueprints Runtime Monitoring in the VM Metamodel Activation Alias Object origin Object Tracking 46
    49. Feature "Upload" Feature "Duplicate" Feature "Delete" [Salah and Mancoridis ICSM'04] 47
    50. Feature "Upload" Feature "Duplicate" Feature "Delete" image: a1 :File 48
    51. Feature "Upload" Feature "Duplicate" Feature "Delete" image: image: copy: a1 a1 a2 :File :File 49
    52. Feature "Upload" Feature "Duplicate" Feature "Delete" image: image: copy: image: copy: a1 a1 a2 a1 a2 :File :File :File 50
    53. Feature "Upload" Feature "Duplicate" Feature "Delete" 0..1 * * 1 Activation Feature 1 context * * 1 0..1 * Alias Object origin value 51
    54. delete upload duplicate Feature "Upload" Feature "Duplicate" Feature "Delete" 0..1 * * 1 Activation Feature 1 context * * 1 0..1 * Alias Object origin value 52
    55. IRC client dependencies Open Setup Connect MOTD Join Channel Send Message Receive Message New Console Disconnect 0 5 10 15 20 25 30 35 Our approach Salah et al. 53
    56. Object Dependency Graph of feature Receive Message Open Join Channel Connect Send Message 54
    57. Object Dependency Graph of feature Receive Message Open Join Channel Connect Send Message 55
    58. Object Dependency Graph of feature Receive Message Open Join Channel Connect Send Message 56
    59. Object Dependency Graph of feature Receive Message Open Join Channel Connect Send Message 57
    60. Visualizing Feature Test Object Flows Dependencies Blueprints Runtime Monitoring in the VM ta l. ard e Lienh 07 ' ICPC Metamodel Activation Alias Object origin Object Tracking 58
    61. Visualizing Feature Test Object Flows Dependencies Blueprints Runtime Monitoring in the VM Metamodel Activation Alias Object origin Object Tracking 59
    62. Writing a Unit Test 1. Setup 2. Invoke 3. Assert 60
    63. duplicate 61
    64. duplicate Test Blueprint Objects :Image existing :Image (target) :Image (return) :Image new References existing :File new 62
    65. duplicate Test Blueprint Objects :Image existing :Image (target) :Image (return) :Image new References existing :File new 1 file := File named: 'cat.jpg'. 2 image := Image new. 3 image file: file. 63
    66. duplicate Test Blueprint Objects :Image existing :Image (target) :Image (return) :Image new References existing :File new 1 file := File named: 'cat.jpg'. 4 copy := image duplicate. 2 image := Image new. 3 image file: file. 64
    67. duplicate Test Blueprint Objects :Image existing :Image (target) :Image (return) :Image new References existing :File new 1 file := File named: 'cat.jpg'. 4 copy := image duplicate. 2 image := Image new. 3 image file: file. 5 self assert: copy class = Image. 6 self assert: copy file == file 65
    68. duplicate caller 0..1 * Activation context target parameters * 1 * 0..1 * 1 Alias Object origin value 66
    69. IRBuilder>>add: 2 FunctionScope>>lookupVar: 1 NonClosureScopeFixer>>acceptVarNode: InstanceScope>>newMethodScope 4 3 ace Test Blueprint 67
    70. Execution Trace Test Blueprint 68
    71. Initial Study I Let a developer use the tool: 12 tests in 2h Execution Trace Test Blueprint 69
    72. Initial Study II Rewrote assertions of 14 existing tests: 72 identical, 12 missed, 5 additional Execution Trace Test Blueprint 70
    73. Visualizing Feature Test Object Flows Dependencies Blueprints Runtime Monitoring in the VM al. a rd et Lienh '08 R CSM Metamodel Activation Alias Object origin Object Tracking 71
    74. Visualizing Feature Test Object Flows Dependencies Blueprints Runtime Monitoring in the VM Metamodel Activation Alias Object origin Object Tracking 72
    75. Visualizing Feature Test Object Flows Dependencies Blueprints Runtime Monitoring in the VM Metamodel Activation Alias Object origin Object Tracking 73
    76. 74
    77. Specification of object flow tracking by extending language semantics 75
    78. Example execution Computer Dynamic Source Code (formal semantics) Analysis Data f := new File ... return f 76
    79. Example execution Computer Dynamic Source Code (formal semantics) Analysis Data f := new File allocation ... return f 77
    80. Example execution Computer Dynamic Source Code (formal semantics) Analysis Data f := new File allocation ... field-write return f 78
    81. Example execution Computer Dynamic Source Code (formal semantics) Analysis Data f := new File allocation ... field-write return f return 79
    82. Visualizing Feature Test Object Flows Dependencies Blueprints Runtime Monitoring in the VM Metamodel Activation Alias Object origin Object Tracking 80
    83. Visualizing Feature Test Object Flows Dependencies Blueprints Runtime Monitoring in the VM Metamodel Activation Alias Object origin Object Tracking 81
    84. Problem of conventional debuggers In 50% of the cases the execution stack contains essentially no information about the bug's cause. [Liblit etal. PLDI'05] 82
    85. Back-in-time debugging Challenges 1. amount of data 2. execution overhead 83
    86. Approaches Omniscient Trace-oriented Trace-oriented Debugger debugger (partial) debugger (full) loss of old history loss of selected history complete history overhead 100x overhead 10x overhead 100x 84
    87. Approaches Omniscient Trace-oriented Trace-oriented Debugger Our approach debugger (partial) debugger (full) low overhead relevant history loss of old history loss of history complete history overhead 100x overhead 10x overhead 100x 85
    88. Delete history when it gets irrelevant History of origins of objects Previous field values of objects Call stacks in which above appear 86
    89. Before deletion 87
    90. Before deletion After deletion 88
    91. Object Flow VM regular objects alias header header header header field_1 field_1 header ... value field_2 field_2 ... context .... .... field_n pointer field_n origin predecessor ... Typical model Object Flow VM 89
    92. Capturing historical object state t1 t2 t3 image := Image new image height: 17 image height: 42 90
    93. Capturing historical object state t1 t2 t3 image := Image new image height: 17 image height: 42 height image: @t1 nil 91
    94. Capturing historical object state t1 t2 t3 image := Image new image height: 17 image height: 42 @t1 nil predecessor height image: @t2 17 92
    95. Capturing historical object state t1 t2 t3 image := Image new image height: 17 image height: 42 @t1 nil predecessor @t2 17 predecessor height image: @t3 42 93
    96. Capturing historical object state t1 t2 t3 image := Image new image height: 17 image height: 42 @t1 nil predecessor @t2 17 predecessor height image: @t3 42 predecessor 0..1 0..1 Alias Object origin * 1 fields 94
    97. Evaluation memory usage (1) 2.5e+09 1e+07 Number of aliases allocated (left Y-axis) Number of aliases in memory (right Y-axis) Number of objects in memory (right Y-axis) 2e+09 8e+06 1.5e+09 6e+06 1e+09 4e+06 5e+08 2e+06 0 0 0 200 400 600 800 1000 #classes 95
    98. Evaluation memory usage (2) 7e+06 50 Number of aliases allocated Number of aliases in memory 6e+06 Number of objects in memory Ratio between aliases in 40 memory and allocated 5e+06 30 4e+06 % 3e+06 20 2e+06 10 1e+06 0 0 0 2 4 6 8 10 12 14 16 18 #samples 96
    99. Evaluation memory usage (3) 1e+07 Number of aliases allocated 9e+06 Number of aliases in memory Number of objects in memory 8e+06 7e+06 6e+06 5e+06 4e+06 3e+06 2e+06 1e+06 0 5 10 15 20 25 #requests 97
    100. Evaluation run-time overhead Overhead GC Recording off 1.15 1.6% Recording on 3.84 27.6% Largest overhead: 6.9 98
    101. Visualizing Feature Test Object Flows Dependencies Blueprints Runtime Monitoring in the VM Metamodel Activation Alias Object origin al. a rd et Object Tracking Lienh P'08 O ECO 99
    102. Visualizing Feature Test Object Flows Dependencies Blueprints Runtime Monitoring in the VM Metamodel Activation Alias Object origin Object Tracking

    + lienhardlienhard, 4 months ago

    custom

    205 views, 0 favs, 1 embeds more stats

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 205
      • 195 on SlideShare
      • 10 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 3
    Most viewed embeds
    • 10 views on http://www.adrian-lienhard.ch

    more

    All embeds
    • 10 views on http://www.adrian-lienhard.ch

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories