Dynamic Analysis (EVO 2008)

638 views
566 views

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
638
On SlideShare
0
From Embeds
0
Number of Embeds
41
Actions
Shares
0
Downloads
25
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

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/

×