Visualizing Feature Test
Object Flows Dependencies Blueprints
Runtime Monitoring in the VM
Metamodel
Activation
Alias Object
origin
Object Tracking
31
Visualizing Feature Test
Object Flows Dependencies Blueprints
Runtime Monitoring in the VM
Metamodel
Activation
Alias Object
origin
Object Tracking
32
Visualizing Feature Test
Object Flows Dependencies Blueprints
Runtime Monitoring in the VM
Metamodel
Activation
Alias Object
origin
Object Tracking
33
Visualizing Feature Test
Object Flows Dependencies Blueprints
Runtime Monitoring in the VM
Metamodel
Activation
Alias Object
origin
Object Tracking
34
Visualizing Feature Test
Object Flows Dependencies Blueprints
Runtime Monitoring in the VM
Metamodel
Activation
Alias Object
origin
Object Tracking
35
Visualizing Feature Test
Object Flows Dependencies Blueprints
Runtime Monitoring in the VM
Metamodel
Activation
Alias Object
origin
Object Tracking
36
Detecting flows between classes
Activation
1 context
0..1 * *
* 1
Alias Object
origin value
37
Detecting flows between classes
Method
1
*
Activation
1 context
0..1 * *
* 1
Alias Object
origin value
38
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
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
Inter-unit Flow View
41
Chronological
propagation
42
Chronological
propagation
42
Chronological
propagation
42
Spanning flows
Parser (4)
43
Spanning flows
IRBuilder
44
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
Visualizing Feature Test
Object Flows Dependencies Blueprints
Runtime Monitoring in the VM
Metamodel
Activation
Alias Object
origin
Object Tracking
46
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
Object Dependency Graph
of feature Receive Message
Open Join Channel
Connect Send Message
54
Object Dependency Graph
of feature Receive Message
Open Join Channel
Connect Send Message
55
Object Dependency Graph
of feature Receive Message
Open Join Channel
Connect Send Message
56
Object Dependency Graph
of feature Receive Message
Open Join Channel
Connect Send Message
57
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
Visualizing Feature Test
Object Flows Dependencies Blueprints
Runtime Monitoring in the VM
Metamodel
Activation
Alias Object
origin
Object Tracking
59
Writing a Unit Test
1. Setup
2. Invoke
3. Assert
60
duplicate
61
duplicate
Test Blueprint Objects
:Image existing
:Image (target) :Image (return) :Image new
References
existing
:File new
62
Initial Study I
Let a developer use the tool:
12 tests in 2h
Execution Trace Test Blueprint
69
Initial Study II
Rewrote assertions of 14 existing tests:
72 identical, 12 missed, 5 additional
Execution Trace Test Blueprint
70
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
Visualizing Feature Test
Object Flows Dependencies Blueprints
Runtime Monitoring in the VM
Metamodel
Activation
Alias Object
origin
Object Tracking
72
Visualizing Feature Test
Object Flows Dependencies Blueprints
Runtime Monitoring in the VM
Metamodel
Activation
Alias Object
origin
Object Tracking
73
74
Specification of object flow tracking
by extending language semantics
75
Example execution
Computer Dynamic
Source Code
(formal semantics) Analysis Data
f := new File
...
return f
76
Example execution
Computer Dynamic
Source Code
(formal semantics) Analysis Data
f := new File allocation
...
return f
77
Example execution
Computer Dynamic
Source Code
(formal semantics) Analysis Data
f := new File allocation
...
field-write
return f
78
Example execution
Computer Dynamic
Source Code
(formal semantics) Analysis Data
f := new File allocation
...
field-write
return f
return
79
Visualizing Feature Test
Object Flows Dependencies Blueprints
Runtime Monitoring in the VM
Metamodel
Activation
Alias Object
origin
Object Tracking
80
Visualizing Feature Test
Object Flows Dependencies Blueprints
Runtime Monitoring in the VM
Metamodel
Activation
Alias Object
origin
Object Tracking
81
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
Back-in-time debugging
Challenges
1. amount of data
2. execution overhead
83
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
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
Delete history when it
gets irrelevant
History of origins of objects
Previous field values of objects
Call stacks in which above appear
86
Before deletion
87
Before deletion
After deletion
88
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
Capturing historical object state
t1 t2 t3
image := Image new image height: 17 image height: 42
90
Capturing historical object state
t1 t2 t3
image := Image new image height: 17 image height: 42
height
image: @t1 nil
91
Capturing historical object state
t1 t2 t3
image := Image new image height: 17 image height: 42
@t1 nil
predecessor
height
image: @t2 17
92
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
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
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
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
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
Evaluation run-time overhead
Overhead GC
Recording off 1.15 1.6%
Recording on 3.84 27.6%
Largest overhead: 6.9
98
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
Visualizing Feature Test
Object Flows Dependencies Blueprints
Runtime Monitoring in the VM
Metamodel
Activation
Alias Object
origin
Object Tracking
0 comments
Post a comment