Your SlideShare is downloading. ×
0
Dynamic Analysis



Tudor Gîrba
www.tudorgirba.com
Dynamic analysis is the analysis of the properties of a
running program




                                              ...
Dynamic analysis is the analysis of the properties of a
running program

                                  prope rties?
  ...
main()
method()
method2(param)
e infor mation
                  offers precis
     ic an alysis
Dynam
ment
         instru and why
H ow to
     t to c apture
Wha          odel
 Ho w to m cute
 What   to exe
How to instrument
…
public class BankAccount {
  private Money balance;

  public void deposit(Money amount) {
     System.out.println(“depo...
import org.apache.log4j.Logger;
…
public class BankAccount {
  private Money balance;

  public void deposit(Money amount)...
Method Wrappers and Aspects intervene before
      and after each interesting method
Profilers probe the system
3+4


pushConstant: 3
pushConstant: 4
popIntoTemp: 0 
 
 
 
 
 “put argument in temp 0”
                
popIntoTemp: 1 
 ...
3+4
… insertBefore: 'Transcript show: <meta: #receiver>'
pushConstant: 3
pushConstant: 4
popIntoTemp: 0 
 
 
 
 
         ...
3+4




  Message (+)



                 Receiver (3)



                Arguments (4)

                                 ...
3+4
… insertBefore: 'Transcript show: <meta: #receiver>'


                     before       Transcript show: <meta: #rece...
How to instrument
How to instrument
What to capture and why
Collecting Garbage is a Dynamic Analysis
The Control Flow is the most common focus
8
     Pauw etal 199
De
8
     Pauw etal 199
De
8
     Pauw etal 199
De
Trace Signals reveal similar execution traces




                                            eevy 2006
                  ...
Inter Class Call Matrix shows how classes
          collaborate at runtime




                                           ...
Communication Interaction shows how classes
         collaborate at runtime




                                          ...
How to instrument
What to capture and why
How to instrument
What to capture and why
How to model
sender
0..1    *
Activation
Class
 sender                 1
0..1    *               *
Activation   *   1
                     Method
A feature is an observable unit of behavior of a system
triggered by the user




                                        ...
Feature 1   Feature 2   ...   Feature n
Class
 sender                 1
0..1    *               *
Activation   *   1
                     Method
Class
 sender                 1
0..1    *               *
Activation   *   1
                     Method
       *



 Feat...
5
 ilde, Sc ully 199
W
5
 ilde, Sc ully 199
W
5
 ilde, Sc ully 199
W
Software Reconnaissance identifies
 where features are implemented




                                               5
   ...
er 2004
      n  , Demey
Zaidma
Feature Views show how features cover classes




                                          e tal 2006
    addFolder   add...
addFolder   addPage
Team Collaboration shows how
   authors develop features




                                e tal 2007
                  ...
How to instrument
What to capture and why
How to model
How to instrument
What to capture and why
How to model




                                          activations
         ...
return
return




         field-read
return


field-write

                      field-read
return


field-write

                       field-read
     return
return


field-write                 field-read

                                                       field-read
     retur...
Object Flow captures object aliases




                                             9
                               Lien...
Object Flow captures object aliases




                                             9
                               Lien...
Class
 sender                 1
0..1    *               *
Activation   *   1
                     Method
       *



 Feat...
*                    1
Instance                            Class
                sender                 1
               0...
subject                                       1
                        Instance       *                        Class
    ...
subject                                             1                1
                           Instance       *        ...
Object Flow shows how objects move




                                      e tal 2007
                            L ienh...
Object Dependencies reveal features dependencies




                          Open      Join Channel
                    ...
ontains
                                   stack c ause
                       e execution     bug’s c
                ase...
Back in time debuggers remember
   more than the current stack




                                      08
              ...
How to instrument
What to capture and why
How to model




                                          activations
         ...
How to instrument
What to capture and why
How to model
What to execute




                                          activ...
Tudor Gîrba
       www.tudorgirba.com




creativecommons.org/licenses/by/3.0/
Dynamic Analysis (EVO 2008)
Dynamic Analysis (EVO 2008)
Dynamic Analysis (EVO 2008)
Dynamic Analysis (EVO 2008)
Dynamic Analysis (EVO 2008)
Dynamic Analysis (EVO 2008)
Dynamic Analysis (EVO 2008)
Dynamic Analysis (EVO 2008)
Dynamic Analysis (EVO 2008)
Dynamic Analysis (EVO 2008)
Dynamic Analysis (EVO 2008)
Dynamic Analysis (EVO 2008)
Dynamic Analysis (EVO 2008)
Dynamic Analysis (EVO 2008)
Upcoming SlideShare
Loading in...5
×

Dynamic Analysis (EVO 2008)

464

Published on

I used this set of slides for a lecture I gave at the University of Bern.

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
464
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
25
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "Dynamic Analysis (EVO 2008)"

  1. 1. Dynamic Analysis Tudor Gîrba www.tudorgirba.com
  2. 2. Dynamic analysis is the analysis of the properties of a running program 9 Ball 199
  3. 3. Dynamic analysis is the analysis of the properties of a running program prope rties? W hat 9 Ball 199
  4. 4. main()
  5. 5. method()
  6. 6. method2(param)
  7. 7. e infor mation offers precis ic an alysis Dynam
  8. 8. ment instru and why H ow to t to c apture Wha odel Ho w to m cute What to exe
  9. 9. How to instrument
  10. 10. … public class BankAccount { private Money balance; public void deposit(Money amount) { System.out.println(“deposit“); this.balance += money; } }
  11. 11. import org.apache.log4j.Logger; … public class BankAccount { private Money balance; public void deposit(Money amount) { logger.info(“deposit“); this.balance += money; } }
  12. 12. Method Wrappers and Aspects intervene before and after each interesting method
  13. 13. Profilers probe the system
  14. 14. 3+4 pushConstant: 3 pushConstant: 4 popIntoTemp: 0 “put argument in temp 0” popIntoTemp: 1 “put receiver in temp 1” send: + “perform addition” returnTop
  15. 15. 3+4 … insertBefore: 'Transcript show: <meta: #receiver>' pushConstant: 3 pushConstant: 4 popIntoTemp: 0 quot;put argument in temp 0quot; popIntoTemp: 1 quot;put receiver in temp 1quot; pushLit: ##Transcript quot;start of inserted codequot; pushTemp: 1 quot;push receiver for printingquot; send: asString send: show: pop quot;end of inserted codequot; pushTemp: 1 quot;rebuild the stackquot; pushTemp: 0 send: + returnTop 8 Den ker 200
  16. 16. 3+4 Message (+) Receiver (3) Arguments (4) 00 7 Denke r etal 2
  17. 17. 3+4 … insertBefore: 'Transcript show: <meta: #receiver>' before Transcript show: <meta: #receiver> Message (+) Receiver (3) Arguments (4) 00 7 Denke r etal 2
  18. 18. How to instrument
  19. 19. How to instrument What to capture and why
  20. 20. Collecting Garbage is a Dynamic Analysis
  21. 21. The Control Flow is the most common focus
  22. 22. 8 Pauw etal 199 De
  23. 23. 8 Pauw etal 199 De
  24. 24. 8 Pauw etal 199 De
  25. 25. Trace Signals reveal similar execution traces eevy 2006 Kuhn, Gr
  26. 26. Inter Class Call Matrix shows how classes collaborate at runtime 3 Pauw etal 199 De
  27. 27. Communication Interaction shows how classes collaborate at runtime 4 casse etal 200 Du
  28. 28. How to instrument What to capture and why
  29. 29. How to instrument What to capture and why How to model
  30. 30. sender 0..1 * Activation
  31. 31. Class sender 1 0..1 * * Activation * 1 Method
  32. 32. A feature is an observable unit of behavior of a system triggered by the user arth e tal 2003 Eisenb
  33. 33. Feature 1 Feature 2 ... Feature n
  34. 34. Class sender 1 0..1 * * Activation * 1 Method
  35. 35. Class sender 1 0..1 * * Activation * 1 Method * Feature
  36. 36. 5 ilde, Sc ully 199 W
  37. 37. 5 ilde, Sc ully 199 W
  38. 38. 5 ilde, Sc ully 199 W
  39. 39. Software Reconnaissance identifies where features are implemented 5 ilde, Sc ully 199 W
  40. 40. er 2004 n , Demey Zaidma
  41. 41. Feature Views show how features cover classes e tal 2006 addFolder addPage Greevy
  42. 42. addFolder addPage
  43. 43. Team Collaboration shows how authors develop features e tal 2007 Greevy
  44. 44. How to instrument What to capture and why How to model
  45. 45. How to instrument What to capture and why How to model activations metho d more than e runt ime is Th
  46. 46. return
  47. 47. return field-read
  48. 48. return field-write field-read
  49. 49. return field-write field-read return
  50. 50. return field-write field-read field-read return parameter allocation
  51. 51. Object Flow captures object aliases 9 Lienh ard 200
  52. 52. Object Flow captures object aliases 9 Lienh ard 200
  53. 53. Class sender 1 0..1 * * Activation * 1 Method * Feature
  54. 54. * 1 Instance Class sender 1 0..1 * * Activation * 1 Method * Feature
  55. 55. subject 1 Instance * Class sender 1 * 0..1 * * 0..1 Activation * 1 Alias receiver Method parent * creator Feature
  56. 56. subject 1 1 Instance * Class sender 1 * 0..1 * * 0..1 Activation * 1 Alias receiver Method parent * creator * Feature Attribute ArgumentAlias ReturnAlias TempAlias FieldAlias
  57. 57. Object Flow shows how objects move e tal 2007 L ienhard
  58. 58. Object Dependencies reveal features dependencies Open Join Channel Connect Send Message e tal 2007 L ienhard
  59. 59. ontains stack c ause e execution bug’s c ases th on about the of the c formati In 50% ly no in ess ential 5 Liblit etal 200
  60. 60. Back in time debuggers remember more than the current stack 08 Fierz 20
  61. 61. How to instrument What to capture and why How to model activations metho d more than e runt ime is Th
  62. 62. How to instrument What to capture and why How to model What to execute activations metho d more than e runt ime is Th
  63. 63. Tudor Gîrba www.tudorgirba.com creativecommons.org/licenses/by/3.0/
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×