SlideShare a Scribd company logo
1 of 39
Download to read offline
OORPT Object-Oriented Reengineering Patterns and Techniques 12.  Analyzing Dynamic Behavior Orla Greevy & Adrian Lienhard
What is Dynamic Analysis? ,[object Object],[object Object]
Has anyone used Dynamic Analysis?
Roadmap ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
What does this program do? ,[object Object],Thomas Ball, The Concept of Dynamic Analysis, FSE ’ 99
Why Dynamic Analysis? ,[object Object],Trying to understand one [structure] from the other is like trying to understand the dynamism of living ecosystems from the static taxonomy of plants and animals, and vice-versa. --  Erich Gamma et al.,  D esign Patterns
Reengineering Patterns based on Dynamic Analysis ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Runtime Information Sources ,[object Object],execute program and watch it from outside Internal view External view instrument program and watch it from inside
External View ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Internal View  Log statements in code Stack trace Debugger Many different tools are based on tracing: execution profilers,  test coverage analyzers, tools for  reverse engineering… Execution trace
Execution Tracing ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Tracing Techniques ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Technical Challenges ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Roadmap ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Debuggers Breakpoint Debuggers jdb, gdb,… (run, step, inspect) Omniscent Debuggers ( http://www.lambdacs.com/debugger/debugger.html ) Memory Debuggers jmp - java memory profiler purify (IBM Rational) - a tool for detecting memory leaks in C,C++ code
Loggers - low tech debugging “… debugging statements stay with the program;  debugging sessions are transient. “   Kerningham and Pike public class Main { public static void main(String[] args) { Clingon aAlien = new Clingon(); System.out.println(“in main “);   aAlien.spendLife(); } } Very messy!
- defacto standard for Java ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],export TOMCAT_OPTS="-Dlog4j.debug  -Dlog4j.configuration=foobar.xml
Short Demo of log4j usage ,[object Object],import org.apache.log4j.Logger; … public class Main { static Logger logger = Logger.getLogger(MyApp.class); public static void main(String[] args) { Clingon aAlien = new Clingon(); logger.info(“Entering Application“);   aAlien.spendLife(); } } 1 [main]  (Main.java)  - Entering Application.
Profilers are used to track performance for optimization ,[object Object],[object Object],[object Object],[object Object]
JProfiler Example Views
JWireTap: An Interactive Profiler for Eclipse  (Demo)
Roadmap ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Reverse Engineering Reverse Engineering static view + execution traces dynamic view + Dynamic Analysis
Dynamic Analysis for Program Comprehension ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Visualization of Runtime Behavior Problem  of  Large  traces [JinSight, De Pauw 1993 ]
Feature-Centric Reverse Engineering Users   Software developer   F 2 F 1 F n F 1 F n F 2 Software System
Bug reports often expressed in terms of Features. I can’t add new  contacts!!! The  “ add contacts“   feature
Dividing a trace into features Feature 1 Feature 2 Feature n
Feature Identification is a technique to map features to source code. “ A feature is an observable unit of behavior of a system triggered by the user” [Eisenbarth etal. 2003] Software Reconnaissance  [Wilde and Scully ] Run a  (1)   feature exhibiting scenario  and a  (2) non-exhibiting scenario  and compare the traces.  Then browse the source code.
Feature-Centric Analysis: 3 Complementary Perspectives F1 F3 F2 F4 F5 Features  Perspective Features Relationships Perspective Classes  Perspective
Dynamix  - A Model for Dynamic Analysis
DynaMoose - An Environment for Feature Analysis
Demo of Feature Analysis - Feature Views of Classes Feature Views of PhoneSim Classes PhoneButtonEventBackSpace PhoneStateContact PhoneStateContactForm EditableText CustomTextArea
Feature Views of ‘Phonesim’ Methods Feature Views of PhoneSim Methods
Feature Relationships based on shared usage of classes or methods. browseContacts, addContacts
Object Flow Analysis ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Dynamic vs. Static Analysis ,[object Object],[object Object],[object Object],[object Object]
Conclusions: Pros and Cons ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
License ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

More Related Content

What's hot

Testing Autonomous Cars for Feature Interaction Failures using Many-Objective...
Testing Autonomous Cars for Feature Interaction Failures using Many-Objective...Testing Autonomous Cars for Feature Interaction Failures using Many-Objective...
Testing Autonomous Cars for Feature Interaction Failures using Many-Objective...
Lionel Briand
 
Assessing Model-Based Testing: An Empirical Study Conducted in Industry
Assessing Model-Based Testing: An Empirical Study Conducted in IndustryAssessing Model-Based Testing: An Empirical Study Conducted in Industry
Assessing Model-Based Testing: An Empirical Study Conducted in Industry
Dharmalingam Ganesan
 
Upgrading to System Verilog for FPGA Designs, Srinivasan Venkataramanan, CVC
Upgrading to System Verilog for FPGA Designs, Srinivasan Venkataramanan, CVCUpgrading to System Verilog for FPGA Designs, Srinivasan Venkataramanan, CVC
Upgrading to System Verilog for FPGA Designs, Srinivasan Venkataramanan, CVC
FPGA Central
 
Session 8 assertion_based_verification_and_interfaces
Session 8 assertion_based_verification_and_interfacesSession 8 assertion_based_verification_and_interfaces
Session 8 assertion_based_verification_and_interfaces
Nirav Desai
 
Navigate, Understand, Communicate: How Developers Locate Performance Bugs
Navigate, Understand, Communicate: How Developers Locate Performance BugsNavigate, Understand, Communicate: How Developers Locate Performance Bugs
Navigate, Understand, Communicate: How Developers Locate Performance Bugs
Sebastian Baltes
 
Ivv workshop model-based-testing-of-nasa-systems
Ivv workshop model-based-testing-of-nasa-systemsIvv workshop model-based-testing-of-nasa-systems
Ivv workshop model-based-testing-of-nasa-systems
Dharmalingam Ganesan
 
Interface-Implementation Contract Checking
Interface-Implementation Contract CheckingInterface-Implementation Contract Checking
Interface-Implementation Contract Checking
Dharmalingam Ganesan
 
Automated testing of NASA Software - part 2
Automated testing of NASA Software - part 2Automated testing of NASA Software - part 2
Automated testing of NASA Software - part 2
Dharmalingam Ganesan
 
CS8592 Object Oriented Analysis & Design - UNIT V
CS8592 Object Oriented Analysis & Design - UNIT V CS8592 Object Oriented Analysis & Design - UNIT V
CS8592 Object Oriented Analysis & Design - UNIT V
pkaviya
 
Uvm cookbook-systemverilog-guidelines-verification-academy
Uvm cookbook-systemverilog-guidelines-verification-academyUvm cookbook-systemverilog-guidelines-verification-academy
Uvm cookbook-systemverilog-guidelines-verification-academy
Raghavendra Kamath
 

What's hot (20)

Testing Autonomous Cars for Feature Interaction Failures using Many-Objective...
Testing Autonomous Cars for Feature Interaction Failures using Many-Objective...Testing Autonomous Cars for Feature Interaction Failures using Many-Objective...
Testing Autonomous Cars for Feature Interaction Failures using Many-Objective...
 
Assessing Model-Based Testing: An Empirical Study Conducted in Industry
Assessing Model-Based Testing: An Empirical Study Conducted in IndustryAssessing Model-Based Testing: An Empirical Study Conducted in Industry
Assessing Model-Based Testing: An Empirical Study Conducted in Industry
 
Software Testing Methodologies
Software Testing MethodologiesSoftware Testing Methodologies
Software Testing Methodologies
 
Upgrading to System Verilog for FPGA Designs, Srinivasan Venkataramanan, CVC
Upgrading to System Verilog for FPGA Designs, Srinivasan Venkataramanan, CVCUpgrading to System Verilog for FPGA Designs, Srinivasan Venkataramanan, CVC
Upgrading to System Verilog for FPGA Designs, Srinivasan Venkataramanan, CVC
 
Session 8 assertion_based_verification_and_interfaces
Session 8 assertion_based_verification_and_interfacesSession 8 assertion_based_verification_and_interfaces
Session 8 assertion_based_verification_and_interfaces
 
Navigate, Understand, Communicate: How Developers Locate Performance Bugs
Navigate, Understand, Communicate: How Developers Locate Performance BugsNavigate, Understand, Communicate: How Developers Locate Performance Bugs
Navigate, Understand, Communicate: How Developers Locate Performance Bugs
 
SOC Verification using SystemVerilog
SOC Verification using SystemVerilog SOC Verification using SystemVerilog
SOC Verification using SystemVerilog
 
formal verification
formal verificationformal verification
formal verification
 
Ivv workshop model-based-testing-of-nasa-systems
Ivv workshop model-based-testing-of-nasa-systemsIvv workshop model-based-testing-of-nasa-systems
Ivv workshop model-based-testing-of-nasa-systems
 
system verilog
system verilogsystem verilog
system verilog
 
STAMP
STAMPSTAMP
STAMP
 
Interface-Implementation Contract Checking
Interface-Implementation Contract CheckingInterface-Implementation Contract Checking
Interface-Implementation Contract Checking
 
Automated testing of NASA Software - part 2
Automated testing of NASA Software - part 2Automated testing of NASA Software - part 2
Automated testing of NASA Software - part 2
 
SECh1920
SECh1920SECh1920
SECh1920
 
Massimo Rossello Zen And The Art Of Testing
Massimo Rossello   Zen And The Art Of TestingMassimo Rossello   Zen And The Art Of Testing
Massimo Rossello Zen And The Art Of Testing
 
Verification challenges and methodologies - SoC and ASICs
Verification challenges and methodologies - SoC and ASICsVerification challenges and methodologies - SoC and ASICs
Verification challenges and methodologies - SoC and ASICs
 
#1 formal methods – introduction for software engineering
#1 formal methods – introduction for software engineering#1 formal methods – introduction for software engineering
#1 formal methods – introduction for software engineering
 
Search-driven String Constraint Solving for Vulnerability Detection
Search-driven String Constraint Solving for Vulnerability DetectionSearch-driven String Constraint Solving for Vulnerability Detection
Search-driven String Constraint Solving for Vulnerability Detection
 
CS8592 Object Oriented Analysis & Design - UNIT V
CS8592 Object Oriented Analysis & Design - UNIT V CS8592 Object Oriented Analysis & Design - UNIT V
CS8592 Object Oriented Analysis & Design - UNIT V
 
Uvm cookbook-systemverilog-guidelines-verification-academy
Uvm cookbook-systemverilog-guidelines-verification-academyUvm cookbook-systemverilog-guidelines-verification-academy
Uvm cookbook-systemverilog-guidelines-verification-academy
 

Viewers also liked

Irem presentation final
Irem presentation   finalIrem presentation   final
Irem presentation final
Kepler
 
Accomplishment, Aspirations & Challenges: Boston
Accomplishment, Aspirations & Challenges: BostonAccomplishment, Aspirations & Challenges: Boston
Accomplishment, Aspirations & Challenges: Boston
The Hub Milan
 
Angeiologie 4 2013 - 1-2014 livre des resumes
Angeiologie 4 2013 - 1-2014 livre des resumesAngeiologie 4 2013 - 1-2014 livre des resumes
Angeiologie 4 2013 - 1-2014 livre des resumes
sfa_angeiologie
 
RCMSL Phenomenal July 16, 2009
RCMSL Phenomenal July 16, 2009RCMSL Phenomenal July 16, 2009
RCMSL Phenomenal July 16, 2009
etalcomendras
 
Financial planning introduction fall 2010
Financial planning introduction fall 2010Financial planning introduction fall 2010
Financial planning introduction fall 2010
dphil002
 
Sociale media en journalistiek
Sociale media en journalistiekSociale media en journalistiek
Sociale media en journalistiek
Bart Van Belle
 
Syndrome metabolique et maladies vasculaires s novo
Syndrome metabolique et maladies vasculaires s novoSyndrome metabolique et maladies vasculaires s novo
Syndrome metabolique et maladies vasculaires s novo
sfa_angeiologie
 

Viewers also liked (20)

Irem presentation final
Irem presentation   finalIrem presentation   final
Irem presentation final
 
201506 CSE340 Lecture 15
201506 CSE340 Lecture 15201506 CSE340 Lecture 15
201506 CSE340 Lecture 15
 
Twitter en Facebook voor journalisten
Twitter en Facebook voor journalistenTwitter en Facebook voor journalisten
Twitter en Facebook voor journalisten
 
Cup A Soup MiNi
Cup A Soup MiNiCup A Soup MiNi
Cup A Soup MiNi
 
Sexto AñO Basico
Sexto AñO BasicoSexto AñO Basico
Sexto AñO Basico
 
Accomplishment, Aspirations & Challenges: Boston
Accomplishment, Aspirations & Challenges: BostonAccomplishment, Aspirations & Challenges: Boston
Accomplishment, Aspirations & Challenges: Boston
 
Angeiologie 4 2013 - 1-2014 livre des resumes
Angeiologie 4 2013 - 1-2014 livre des resumesAngeiologie 4 2013 - 1-2014 livre des resumes
Angeiologie 4 2013 - 1-2014 livre des resumes
 
RCMSL Phenomenal July 16, 2009
RCMSL Phenomenal July 16, 2009RCMSL Phenomenal July 16, 2009
RCMSL Phenomenal July 16, 2009
 
201106 WICSA
201106 WICSA201106 WICSA
201106 WICSA
 
Financial planning introduction fall 2010
Financial planning introduction fall 2010Financial planning introduction fall 2010
Financial planning introduction fall 2010
 
201204 AME High Five
201204 AME High Five201204 AME High Five
201204 AME High Five
 
201506 CSE340 Lecture 16
201506 CSE340 Lecture 16201506 CSE340 Lecture 16
201506 CSE340 Lecture 16
 
Eeuwigblijvenleren2
Eeuwigblijvenleren2Eeuwigblijvenleren2
Eeuwigblijvenleren2
 
201506 CSE340 Lecture 09
201506 CSE340 Lecture 09201506 CSE340 Lecture 09
201506 CSE340 Lecture 09
 
Eurochap2010
Eurochap2010Eurochap2010
Eurochap2010
 
LiveOffice Email Archiving & Compliance 101
LiveOffice Email Archiving & Compliance 101LiveOffice Email Archiving & Compliance 101
LiveOffice Email Archiving & Compliance 101
 
Sociale media en journalistiek
Sociale media en journalistiekSociale media en journalistiek
Sociale media en journalistiek
 
Syndrome metabolique et maladies vasculaires s novo
Syndrome metabolique et maladies vasculaires s novoSyndrome metabolique et maladies vasculaires s novo
Syndrome metabolique et maladies vasculaires s novo
 
Postcards From Pure Michigan
Postcards From Pure MichiganPostcards From Pure Michigan
Postcards From Pure Michigan
 
201506 CSE340 Lecture 22
201506 CSE340 Lecture 22201506 CSE340 Lecture 22
201506 CSE340 Lecture 22
 

Similar to OORPT Dynamic Analysis

The differing ways to monitor and instrument
The differing ways to monitor and instrumentThe differing ways to monitor and instrument
The differing ways to monitor and instrument
Jonah Kowall
 

Similar to OORPT Dynamic Analysis (20)

Monitoring and Instrumentation Strategies: Tips and Best Practices - AppSphere16
Monitoring and Instrumentation Strategies: Tips and Best Practices - AppSphere16Monitoring and Instrumentation Strategies: Tips and Best Practices - AppSphere16
Monitoring and Instrumentation Strategies: Tips and Best Practices - AppSphere16
 
The Magic Of Application Lifecycle Management In Vs Public
The Magic Of Application Lifecycle Management In Vs PublicThe Magic Of Application Lifecycle Management In Vs Public
The Magic Of Application Lifecycle Management In Vs Public
 
Ensuring code quality
Ensuring code qualityEnsuring code quality
Ensuring code quality
 
SANJAY_SINGH
SANJAY_SINGHSANJAY_SINGH
SANJAY_SINGH
 
Sdlc
SdlcSdlc
Sdlc
 
Sdlc
SdlcSdlc
Sdlc
 
Unit 1
Unit  1Unit  1
Unit 1
 
Parasoft .TEST, Write better C# Code Using Data Flow Analysis
Parasoft .TEST, Write better C# Code Using  Data Flow Analysis Parasoft .TEST, Write better C# Code Using  Data Flow Analysis
Parasoft .TEST, Write better C# Code Using Data Flow Analysis
 
Java Performance & Profiling
Java Performance & ProfilingJava Performance & Profiling
Java Performance & Profiling
 
Welcome Webinar Slides
Welcome Webinar SlidesWelcome Webinar Slides
Welcome Webinar Slides
 
Computers in management
Computers in managementComputers in management
Computers in management
 
Play framework : A Walkthrough
Play framework : A WalkthroughPlay framework : A Walkthrough
Play framework : A Walkthrough
 
Software development effort reduction with Co-op
Software development effort reduction with Co-opSoftware development effort reduction with Co-op
Software development effort reduction with Co-op
 
The differing ways to monitor and instrument
The differing ways to monitor and instrumentThe differing ways to monitor and instrument
The differing ways to monitor and instrument
 
Resume
ResumeResume
Resume
 
Programming Fundamentals lecture 3
Programming Fundamentals lecture 3Programming Fundamentals lecture 3
Programming Fundamentals lecture 3
 
Sanjeevi's SDLC Guest Lecture in Anna University campus at AU-PERS Centre (Ye...
Sanjeevi's SDLC Guest Lecture in Anna University campus at AU-PERS Centre (Ye...Sanjeevi's SDLC Guest Lecture in Anna University campus at AU-PERS Centre (Ye...
Sanjeevi's SDLC Guest Lecture in Anna University campus at AU-PERS Centre (Ye...
 
Slides 6 design of sw arch using add
Slides 6 design of sw arch using addSlides 6 design of sw arch using add
Slides 6 design of sw arch using add
 
Distributed Tracing
Distributed TracingDistributed Tracing
Distributed Tracing
 
Distributed tracing 101
Distributed tracing 101Distributed tracing 101
Distributed tracing 101
 

More from lienhard (11)

Chicken
ChickenChicken
Chicken
 
Prototype-based Programming with JavaScript
Prototype-based Programming with JavaScriptPrototype-based Programming with JavaScript
Prototype-based Programming with JavaScript
 
Virtual Machines Lecture
Virtual Machines LectureVirtual Machines Lecture
Virtual Machines Lecture
 
Flow-Centric, Back-In-Time Debugging
Flow-Centric, Back-In-Time DebuggingFlow-Centric, Back-In-Time Debugging
Flow-Centric, Back-In-Time Debugging
 
Dynamic Object Flow Analysis (PhD Defense)
Dynamic Object Flow Analysis (PhD Defense)Dynamic Object Flow Analysis (PhD Defense)
Dynamic Object Flow Analysis (PhD Defense)
 
Rapid Prototyping Of Visualizations Using Mondrian
Rapid Prototyping Of Visualizations Using MondrianRapid Prototyping Of Visualizations Using Mondrian
Rapid Prototyping Of Visualizations Using Mondrian
 
Tracking Objects To Detect Feature Dependencies
Tracking Objects To Detect Feature DependenciesTracking Objects To Detect Feature Dependencies
Tracking Objects To Detect Feature Dependencies
 
Practical Object-Oriented Back-in-Time Debugging
Practical Object-Oriented Back-in-Time DebuggingPractical Object-Oriented Back-in-Time Debugging
Practical Object-Oriented Back-in-Time Debugging
 
Test Blueprints
Test BlueprintsTest Blueprints
Test Blueprints
 
Object Flow Analysis
Object Flow AnalysisObject Flow Analysis
Object Flow Analysis
 
Identifying Traits with Formal Concept Analysis
Identifying Traits with Formal Concept AnalysisIdentifying Traits with Formal Concept Analysis
Identifying Traits with Formal Concept Analysis
 

Recently uploaded

Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 

Recently uploaded (20)

Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 

OORPT Dynamic Analysis

  • 1. OORPT Object-Oriented Reengineering Patterns and Techniques 12. Analyzing Dynamic Behavior Orla Greevy & Adrian Lienhard
  • 2.
  • 3. Has anyone used Dynamic Analysis?
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10. Internal View Log statements in code Stack trace Debugger Many different tools are based on tracing: execution profilers, test coverage analyzers, tools for reverse engineering… Execution trace
  • 11.
  • 12.
  • 13.
  • 14.
  • 15. Debuggers Breakpoint Debuggers jdb, gdb,… (run, step, inspect) Omniscent Debuggers ( http://www.lambdacs.com/debugger/debugger.html ) Memory Debuggers jmp - java memory profiler purify (IBM Rational) - a tool for detecting memory leaks in C,C++ code
  • 16. Loggers - low tech debugging “… debugging statements stay with the program; debugging sessions are transient. “ Kerningham and Pike public class Main { public static void main(String[] args) { Clingon aAlien = new Clingon(); System.out.println(“in main “); aAlien.spendLife(); } } Very messy!
  • 17.
  • 18.
  • 19.
  • 21. JWireTap: An Interactive Profiler for Eclipse (Demo)
  • 22.
  • 23. Reverse Engineering Reverse Engineering static view + execution traces dynamic view + Dynamic Analysis
  • 24.
  • 25. Visualization of Runtime Behavior Problem of Large traces [JinSight, De Pauw 1993 ]
  • 26. Feature-Centric Reverse Engineering Users Software developer F 2 F 1 F n F 1 F n F 2 Software System
  • 27. Bug reports often expressed in terms of Features. I can’t add new contacts!!! The “ add contacts“ feature
  • 28. Dividing a trace into features Feature 1 Feature 2 Feature n
  • 29. Feature Identification is a technique to map features to source code. “ A feature is an observable unit of behavior of a system triggered by the user” [Eisenbarth etal. 2003] Software Reconnaissance [Wilde and Scully ] Run a (1) feature exhibiting scenario and a (2) non-exhibiting scenario and compare the traces. Then browse the source code.
  • 30. Feature-Centric Analysis: 3 Complementary Perspectives F1 F3 F2 F4 F5 Features Perspective Features Relationships Perspective Classes Perspective
  • 31. Dynamix - A Model for Dynamic Analysis
  • 32. DynaMoose - An Environment for Feature Analysis
  • 33. Demo of Feature Analysis - Feature Views of Classes Feature Views of PhoneSim Classes PhoneButtonEventBackSpace PhoneStateContact PhoneStateContactForm EditableText CustomTextArea
  • 34. Feature Views of ‘Phonesim’ Methods Feature Views of PhoneSim Methods
  • 35. Feature Relationships based on shared usage of classes or methods. browseContacts, addContacts
  • 36.
  • 37.
  • 38.
  • 39.

Editor's Notes

  1. Source code can be hard to read and understand. This is a legal C program, an extreme case of course. This is intentionally obfuscated code. Obfuscation is a set of transformations that preserve the behavior of the program but make the internals hard to reverse-engineer. - Programming contests - Prevent reverse engineering
  2. Programs can be hard to understand from their source code alone. The static code does not explicitly reflect the dynamic behavior. The code structure consists of classes in fixed inheritance relationships. Difficulties: OO source code exposes a class hierarchy, not the run-time object collaborations Collaborations are spread throughout the code Polymorphism may hide which classes are instantiated A program’s run-time structure consists of rapidly changing networks of communicating objects.
  3. - The Interview during demo pattern is based on the running program. Different kind of people can give you insights from their point of view by presenting the application. - How do you uncover the run-time architecture of a program? Execute scenarios of known use cases and step through the code with a debugger. - Tests are especially valuable during reengineering because they reduce the risk of reengineering changes. If tests are missing Write Tests to Understand. See chapter in the book devoted to this subject.
  4. - Logs: Single points in the execution. - Stack trace: snapshot of the current stack - Debugger: interactive, allows one to step into future method executions. Not persistent. - Tracing: full history of all method executions
  5. For now we consider this approach Sequence and nesting: construct tree structure Additional: receiver and arguments Return values Object creation Current feature Distinguish process (analyze concurrency properties) Object referencing relationships not captured. Object graph at particular point in time cannot be reconstructed, now, how it evolves
  6. Simulate execution: slow, but very precise control possible Sampling: mainly used for profiling Dynamic recompilation: - control optimizations: compile hot blocks/paths/procedures to machine code - data optimizations: garbage collection: move objects for locality
  7. Inserting log statements into your code is a low-tech method for debugging it. It may also be the only way because debuggers are not always available or applicable. This is often the case for distributed applications.
  8. One of the advantages of the log4j API is its manageability. Once the log statements have been inserted into the code, they can be controlled with configuration files. They can be selectively enabled or disabled, and sent to different and multiple output targets in user-chosen formats. The log4j package is designed so that log statements can remain in shipped code without incurring a heavy performance cost.
  9. Features: Selective instrumentation On and off profiling Produce graphs of performance hotspots Querying of dynamic metrics - eg number of hotspots, maxdepth of the call tree, average time spent in a method Dynamic update of information View performance statistics Configurable and easy to use.
  10. More views available at: http://www.ej-technologies.com/products/jprofiler/screenshots.html
  11. In this course you have been introduced to the concepts of reverse engineering. Reverse engineering Reverse engineering abstracts high level abstractions that support system understanding [Chikofsky and Cross, 1990]. “ Object-oriented language characteristics such as inheritance, dynamic binding and polymorphism mean that the behavior of a system can only be determined at runtime.” [Jerding 1996, Demeyer2003a] A static perspective of the system over looks semantic knowledge of the problem domain of a system. The semanic knowledge Should not be ignored. We need a way to enrich the static views with information about their intent. Which features do they Participate in at runtime? Are they specific to one part of the system, one feature, or is it general functionality that implements sone infrastructural functionality? So lets extend our analysis by incorporating dynamic data captured while executing the features.
  12. .They define an execution scenario to maximize coverage of the system and ‘preciseness’. To execute all the features. Frequency analysis - small number of methods are responsible for a large amount of the trace. They focus on call relationships between methods to learn something about a system. Coupling metrics: Runtime metrics - how many methods of a class were invoked during the execution of a system. which classes create objects Which classes communicate with each other
  13. Traces of execution behavior lead to huge execution traces of tens of thousands of events. This makes them difficult to interpret or to Extract high level views. We need techniques to reduce the volume of information without loss of details needed to answer a specific research question. For example: “Which classes and methods implement the save contact feature?” Wim dePauw [JinSight, De Pauw 1993 ]. Other compression approaches Use graph algorithms to detect patterns and reduce the volume of data. Use patterns to learn something about the system behavior.
  14. The software engineer needs to maintain a mental map between features and the parts of the code that implement them. Features are not implemented in one class. Their implementation spreads out over lots of classes. The behavior consist of objects that collaborate at runtime. “ Change requests and bug reports are usually expressed in a language that reflects the features of a system” [Mehta and Heinemann 2002]
  15. Other researchers had devised variations of software reconnaissance - Antoniol, Eisenberg etc.
  16. How are classes related to features? How are features related to classes? How are features related to each other? We define a Feature-Affinity metric to distinguish between various levels of characterization of classes.
  17. Here we see the feature views (of classes) Our question was “Which classes participate in the addContacts feature?”
  18. Which methods participate in the feature ‘addContacts()’? 22 single feature methods
  19. How similar are the features? We represent static feature relationships in a matrix visualization to make the pairwise similarity relationships between two features explicit. We shows an example of a feature relationship matrix of the features of the phone simulator application. We use grayscale to represent the degree of similarity of two features. The addContacts and browseContacts give a similarity value of tight.