Reverse Engineering (EVO 2008)

4,418 views

Published on

This set of slides accompanied my lecture on reverse engineering held at the University of Bern. More information at: scglectures.unibe.ch/evo2008

Published in: Education
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
4,418
On SlideShare
0
From Embeds
0
Number of Embeds
97
Actions
Shares
0
Downloads
300
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Reverse Engineering (EVO 2008)

  1. Reverse Engineering Tudor Gîrba www.tudorgirba.com
  2. Reverse engineering is analyzing a subject system to: identify components and their relationships, and create more abstract representations. 0 & Cross, 9 C hikofky
  3. Why reverse engineer?
  4. B29 b omber The
  5. ussia d to la nd in R 4, 3 B 29s ha In 194
  6. rything, fast! : Co py eve R equirement
  7. Disas semble
  8. Disas semble Run
  9. Disas semble Run a nd co mpare Test
  10. d in 2 years es assemble 000 pi ec v TU-4: 105, Tupole
  11. Why reverse engineer software?
  12. fo rw ar d en gin ee rin g { { { { { { } { { } } actual development } } } { } } }
  13. fo rw g rin ar ee d gin en gin en ee se rin erv g re { { { { { { } { { } } actual development } } } { } } }
  14. fo rw g rin ar ee d gin en gin en ee se rin erv g re { { { { { { } { { } } program transformation } } } { } } }
  15. cycle ginee ring life Reen fo rw g rin ar ee d gin en gin en ee se rin erv g re { { { { { { } { { } } program transformation } } } { } } }
  16. Setting direction First contact Initial understanding g Detailed model capture rin ee gin en se erv re { { { { } } } } { }
  17. Setting direction patterns First contact patterns Initial understanding patterns g Detailed model capture patterns rin ee gin en se erv re { { { { } } } } { }
  18. short in termezz o What are patterns?
  19. Setting direction First contact Initial understanding g rin Detailed model capture ee gin en se erv re { { { { } } } } { }
  20. You got to be careful if you don't know where you're going, because you might not get there. ra Yogi Ber
  21. Setting direction patterns Set Where direction to start Agree Most valuable on maxims first Maintain Coordinate What not What direction direction to do to do Appoint Speak to the If it ain’t broke Fix problems a navigator round table don’t fix it not symptoms How to do Keep it simple
  22. Setting direction First contact Initial understanding g rin Detailed model capture ee gin en se erv re { { { { } } } } { }
  23. Interview during demo Chat with maintainers What is the usage? What is the history? What are the bugs? What is the process? What do you like? What are the problems?
  24. Interview during demo Chat with maintainers What is the usage? What is the history? What are the bugs? What is the process? What do you like? What are the problems? all humans: that th ey are mber Reme plain h t ey com usiastic they are enth eir jobs tect th they pro
  25. Read all code in one hour
  26. Read all code in one hour ?
  27. Read all code in one hour ? 100’000 lines of code
  28. Read all code in one hour ? 100’000 lines of code * 2 = 200’000 seconds
  29. Read all code in one hour ? 100’000 lines of code * 2 = 200’000 seconds / 3600 = 56 hours
  30. Read all code in one hour ? 100’000 lines of code * 2 = 200’000 seconds / 3600 = 56 hours / 8 = 7 days
  31. A rgoUML
  32. Moose
  33. I took a course in speed reading and read “War and Peace” in twenty minutes. It’s about Russia. n Woody Alle
  34. First contact patterns Talk with Talk with developers users Talk Chat with Interview about it maintainers during demo Verify what Read Read about Compile you hear the code the code the code Read all code Skim Do a mock in one hour documentation installation
  35. Setting direction First contact Initial understanding g rin Detailed model capture ee gin en se erv re { { { { } } } } { }
  36. Speculate about design Layout Abstract Item Graph Node Edge
  37. Identify exceptional entities
  38. Identify exceptional entities for i in $( ls ); do echo `wc -l $i` >> temp done sort -nr temp | head -10
  39. Initial understanding patterns Top down Recover design Speculate about design Iteration Analyze Study persistent data exceptional entities Recover Identify database problems Bottom up
  40. Setting direction First contact Initial understanding g Detailed model capture rin ee gin en se erv re { { { { } } } } { }
  41. To understand: refactor
  42. To understand: refactor write tests
  43. To understand: refactor write tests step through execution
  44. Learn from the past
  45. Detailed model capture patterns Tie code and questions Track your Expose understanding design Refactor to understand Expose Encode collaborations assumptions Step through Write tests execution to understand Expose contracts Expose evolution Look for Learn from the contracts the past
  46. Setting direction First contact Initial understanding g Detailed model capture rin ee gin en se erv re { { { { } } } } { }
  47. Tudor Gîrba www.tudorgirba.com creativecommons.org/licenses/by/3.0/

×