180 likes | 350 Views
Dynamic Event Generation for Runtime Checking Using the JDI. Introduction. Jassda. Performance. Summary. Dynamic Event Generation for Runtime Checking U sing the JDI. MARK BRÖRKENS OFFIS, GERMANY. Dynamic Event Generation for Runtime Checking Using the JDI. Introduction. Jassda.
E N D
Dynamic Event Generation for Runtime Checking Using the JDI Introduction Jassda Performance Summary Dynamic Event Generation for Runtime Checking Using the JDI MARK BRÖRKENS OFFIS, GERMANY
Dynamic Event Generation for Runtime Checking Using the JDI Introduction Jassda Performance Summary • Motivation • Runtime Checking • Architecture • JDI • Modules • Logger • Trace Checker • Bubblesort - • Benchmark • Conclusion • Future Work overview
Dynamic Event Generation for Runtime Checking Using the JDI Introduction Jassda Performance Summary Software systems are getting more complex Formal methods are being researched to prove the correctness of a system Successfully applied to domain specific areas in software engineering Often restricted to experts motivation
Dynamic Event Generation for Runtime Checking Using the JDI Introduction Jassda Performance Summary client supplier • Proposed by Bertrand Meyer for Eiffel • For Java: iContract, jContractor, Runtime Checker of JML, Jass • Code is inserted for checking of assertions • Sequence of method invocations can’t be checked runtime checking: design by contract
Dynamic Event Generation for Runtime Checking Using the JDI Introduction Jassda Performance Summary init stop start destroy Applet • Track the execution of an application • Decide, whether the current trace is correct runtime checking
Logger Trace- Checker modules jassda GUI Broker other core components core JDI Debuggee (1) Debuggee (n) Dynamic Event Generation for Runtime Checking Using the JDI Introduction Jassda Performance Summary Jassda – Java with Assertions Debugger Architecture
Dynamic Event Generation for Runtime Checking Using the JDI Introduction Jassda Performance Summary • explicit control over a virtual machine's execution • suspend and resume threads • set breakpoints and watchpoints • notification of • method invocation • method termination • exceptions • class loading • vm died • breakpoint reached • variable read/changed • remote access • introspective access to a running virtual machine • loaded classes and their variables, methods • bytecode of methods JDI - Features
Dynamic Event Generation for Runtime Checking Using the JDI Introduction Jassda Performance Summary • For full functionality code has to be compiled with debuginformation • Add generic debug information in class files using the Byte Code Engineering Library (BCEL) • Direct access to return values of methods missing • Write return value into local variable and set breakpoint before method termination Solution Solution JDI – Problems and Solutions
suspend configure basic events get all classes get event types {Applet} {begin, end} analyse class {init, start, ....} listens on event? configure events true resume Dynamic Event Generation for Runtime Checking Using the JDI Introduction Jassda Performance Summary debuggee broker module Configuraion of Event Generation
Dynamic Event Generation for Runtime Checking Using the JDI Introduction Jassda Performance Summary • Writes sequence of events into a file • The set of events can be customized in an XML-based configuration-file Module: Logger
Dynamic Event Generation for Runtime Checking Using the JDI Introduction Jassda Performance Summary • <?xml version="1.0" encoding="UTF-8"?> • <logger> • <file name="sequence.log"/> • <event> • <template>%method%(%arguments%) = %returnvalue%</template> • </event> • <include> • <eventset class="de.jassda.core.event.GenericSet" • field="class" • argument="de.jassda.examples.*"/> • </include> • <exclude> • <eventset class="de.jassda.core.event.GenericSet" • field="class" • argument=“de.jassda.examples.test.*"/> • </exclude> • </logger> Module: Logger
Dynamic Event Generation for Runtime Checking Using the JDI Introduction Jassda Performance Summary • Check sequence of events against CSP-like specification (CSPjassda) Module: TraceChecker
Dynamic Event Generation for Runtime Checking Using the JDI Introduction Jassda Performance Summary • eventset applet { instanceof="java.applet.Applet" } • eventset init { method="init" } • ..... • applets() { • ||i:[instance] @ • applet.i.init.begin • -> applet.i.init.end • -> appletrun(i)} • appletrun(i) { • ( applet.i.start.begin -> applet.i.start.end • -> applet.i.stop.begin -> applet.i.stop.end -> appletrun(i) • ) [] appletdestroy(i) • } • appletdestroy(inst) { • applet.inst.destroy.begin -> applet.inst.destroy.end -> STOP • } Alphabet: {applet.init.begin, applet.init.end, applet.start.begin, applet.start.end, applet.stop.begin, applet.stop.end, applet.destroy.begin, applet.destroy,end} TraceChecker: CSPjassda
Dynamic Event Generation for Runtime Checking Using the JDI Introduction Jassda Performance Summary Jassda: GUI
Dynamic Event Generation for Runtime Checking Using the JDI Introduction Jassda Performance Summary • Bubblesort • sort 10000 numbers • 2 implementations: • 1 method invocation • 10001 method invocations • Platform • Windows 2000 • Pentium 1.2GHz • jdk1.3 classic • jdk1.3 hotspot • jdk1.4 • Scenarios • standalone • debug-mode enabled • jassda tool attached seconds jdk1.3 classic jdk1.3 hotspot jdk1.4 Performance
Dynamic Event Generation for Runtime Checking Using the JDI Introduction Jassda Performance Summary • Using the JDI is a viable method to trace the execution of (distributed) Java applications • No or little modification on code is necessary • Jassda works fine for limited number of events • The set of events that are generated can be changed during the debug run Conclusion
Dynamic Event Generation for Runtime Checking Using the JDI Introduction Jassda Performance Summary • Improve jassda • performance • usability of GUI • add modules e.g DbC • Improve CSPjassda • Case studies: expressiveness of CSPjassda, scalability and overhead of debug architecture Future Work
Dynamic Event Generation for Runtime Checking Using the JDI Introduction Jassda Performance Summary http://jassda.sourceforge.net