Talk given at the 8th ACM SIGPLAN Int'l Conf. on Software Language Engineering (SLE 2015), Pittsburgh, PA, USA on October 27, 2015. Preprint available at https://hal.inria.fr/hal-01182517
Efficient and Advanced Omniscient Debugging for xDSMLs (SLE 2015)
1. Erwan Bousse, Jonathan Corley, Benoit Combemale,
Jeff Gray and Benoit Baudry
Companion webpage: http://gemoc.org/sle15-omniscientdebugging
Efficient and Advanced
Omniscient Debugging for xDSMLs
8th ACM SIGPLAN Int'l Conf. on Software Language Engineering (SLE 2015)
Pittsburgh, PA, USA
October 27, 2015
2. (Domain-Specific) Behavioral models
Efficient and Advanced Omniscient Debugging for xDSMLs (SLE’15) - 2
• Various engineering: software
engineering, systems engineering,
enterprise architecture, scientific
modeling...
• Various domains: Business Processes,
Orchestrations, Functional chains,
Activities, Protocoles, Scenarios...
• Various analysis techniques for
checking behavioral properties (early
V&V)
3. Stepwise debugging
- 3
• Stepwise Debugging: find the cause of a defect by manually
observing and controlling execution
• Central dynamic V&V activity
Resume
Stop
Pause
Step into
Step over
Step out
Visualization of
the current state
Breakpoints
Efficient and Advanced Omniscient Debugging for xDSMLs (SLE’15)
4. Stepwise debugging
- 4
• Intuitive model comprehension technique
• No abstraction gap
• Better turn-arounds
⇒ Fast convergence towards an acceptable design
Resume
Stop
Pause
Step into
Step over
Step out
Visualization of
the current state
Breakpoints
Efficient and Advanced Omniscient Debugging for xDSMLs (SLE’15)
5. Omniscient debugging
- 5
• Stepwise debuggers only go forward
• Omniscient debuggers go forward and backward
• Omniscient debuggers typically rely on an execution trace
storing previous states.
Efficient and Advanced Omniscient Debugging for xDSMLs (SLE’15)
6. Brief recap about the terminology
- 6
Weak omniscient debugging,
ie., restart the execution (without any trace)
Omniscient debugging
(with an executiontrace)
Multidimensional
omniscient debugging
(part of our contribution)
Multidimensional
exploration
Backward
exploration
Stepwise debugging
Deterministic,
without engine
restart
Forward
exploration
Efficient and Advanced Omniscient Debugging for xDSMLs (SLE’15)
7. Debuggers for all languages… ?
- 7
• Most GPLs have their own efficient stepwise debugger
• Java: Jdb, Python: Pdb, C: Gdb
• IDEs also typically include a stepwise debugger
• Visual Studio, Eclipse
• Omniscient debuggers were originally introduced for GPLs
• Java: [Pothier2009], Chronon (commercial).
How to provide omniscient debugging to any
executable domain-specific modeling language (xDSML)?
Efficient and Advanced Omniscient Debugging for xDSMLs (SLE’15)
8. Example of an xDSML
- 8
• We focus on operational semantics, defined as a set of
transformation rules
• Abstract syntax properties (e.g. initialTokens) are immutable
• Execution metamodel properties (e.g. tokens) are mutable
Abstract Syntax
input
1..*
output
1..*
Place
+name: string
+initialTokens: int
Transition
+name: string
transitions
*
places
*
imports
merges
Execution Metamodel
Place
+tokens: int
Operational Semantics (summarized)
: while there is an enabled transition, fires it.
: returns true if tokens > 0 for each input Place, false otherwise.
: removes a token from each input Place and adds a token to each output Place.
run(Net)
isEnabled(Transition)
fire(Transition)
Net
Efficient and Advanced Omniscient Debugging for xDSMLs (SLE’15)
9. Example of an omniscient debugger for xDSML
- 9
è Possible to identify a common set of omniscient debugging facilities
for all xDSMLs (e.g., step into or step over)
(4) backOut
(1) stepInto (3) backInto
Efficient and Advanced Omniscient Debugging for xDSMLs (SLE’15)
10. Challenges
- 10
• Generic omniscient debugger supporting any xDSML?
• Two key problems:
1. Genericity requires additional processing (e.g., introspection)
impacting responsiveness
2. Execution states of an xDSML can be arbitrarily complex,
impacting understandability
Efficient and Advanced Omniscient Debugging for xDSMLs (SLE’15)
12. 1- Efficient Omniscient Debugging
- 12
Generated trace Manager/metamodel and
Generic execution engine and debugger
Execution
Metamodel
DS Trace Manager
(generated)
xDSML
Depends on /
Uses
conf.to
Produces
Modifies
Generators
Operational
Semantics
Generic Multidim.
Omniscient
Debugger
Execution
Engine
Executable
Model
conf.to
Trace
Metamodel
Interface
State
Manager
DS Trace
Metamodel
(generated)
Domain-
Specific (DS)
Execution Trace
Trace
Constructor
Efficient and Advanced Omniscient Debugging for xDSMLs (SLE’15)
13. 1- Efficient Omniscient Debugging
- 13
Generated domain-specific trace metamodel/manager
• Trace Metamodel Interface
• Provide generic access to domain-specific trace models for
the debugger (e.g. to provide visualization of the execution
trace)
• State manager
• Allows the debugger to restore the model to a prior state (e.g.
to implement back stepping)
• Trace constructor
• Allows the execution engine to construct the trace during the
execution
Efficient and Advanced Omniscient Debugging for xDSMLs (SLE’15)
14. 1- Efficient Omniscient Debugging
- 14
Generic execution engine and debugger
• Execution engine: applies the transformation rules of the
operational semantics
• Must provide facilities to pause/resume the execution
• Must notify other components when steps start/end
• Generic Debugger: generically implements advanced
omniscient debugging services
Efficient and Advanced Omniscient Debugging for xDSMLs (SLE’15)
16. 2- Advanced Omniscient Debugging
- 16
p1
p3
p2
p4
p5
t1
t2
t3
B
fire(t1) fire(t2)
run(net)
p1
p3
p2
p4
p5
t1
t2
t3
A
p1
p3
p2
p4
p5
t1
t2
t3
C
Model
States
P1
Values
P2
Values
P3
Values
P4
Values
Efficient and Advanced Omniscient Debugging for xDSMLs (SLE’15)
17. Example of the trace metamodel for Petri nets
- 17
• Precisely captures the possible content of the traces of an xDSML
• Based on prior work [Bousse et al. ECMFA 2014]
Efficient and Advanced Omniscient Debugging for xDSMLs (SLE’15)
18. Implementation within the GEMOC Studio
- 18Efficient and Advanced Omniscient Debugging for xDSMLs (SLE’15)
19. Implementation within the GEMOC Studio
- 19
• The GEMOC Studio provides
• A language workbench to implement xDSMLs
• A modeling workbench to use xDSMLs, incl. an execution engine
and an addon interface
• Additional addons for omniscient debugging
• 1 Generated addon specific to the xDSML (trace manager)
• 2 Generic addons (debugger and view)
Efficient and Advanced Omniscient Debugging for xDSMLs (SLE’15)
20. - 20
• Graphical animation
• Breakpoint definition on model element
• Multi-dimensional and efficient trace
management
• Model debugging facilities (incl., timeline,
step backward, stimuli management, etc.)
• Concurrency simulation and formal analysis
ActivityDiagramDebugger
https://github.com/gemoc/activitydiagram
Efficient and Advanced Omniscient Debugging for xDSMLs (SLE’15)
23. Evaluation
- 23
• Research questions
• RQ#1: Is our approach more efficient in memory as compared
to a weak omniscient debugger and to a clone-based omniscient
debugger?
• RQ#2: Is our approach more efficient in time for omniscient
debugging services as compared to a weak omniscient debugger
and to a clone-based omniscient debugger?
• Comparison with
• Clone-based omniscient debugger: creates a trace by copying a
snapshot of the model at each step (uses EMF Compare to restore a
state in the model)
• Weak omniscient debugger: does not create any trace (uses stepwise
execution features to restore a state by re-executing from the start)
Usability not evaluated
(future work)
Efficient and Advanced Omniscient Debugging for xDSMLs (SLE’15)
24. Evaluation
- 24
• fUML xDSML implemented using Kermeta and Ecore within the
GEMOC Studio
• fUML models from the semantic differencing case study of Maoz
et al. [1]
• 40 models with sizes ranging from 36 to 51 objects
• Data collected in a reproducible way through a programmatic use
of GEMOC Studio’s engine.
• Each result is an average value computed from five identical
measure
[1] http://www.se-rwth.de/materials/semdiff/
Efficient and Advanced Omniscient Debugging for xDSMLs (SLE’15)
26. Conclusion and Perspectives
- 26
• Context: Omniscient debugging is a powerful dynamic V&V
approach for designers
• Problem: Handling any xDSML is difficult because of efficiency
and understandability
• Contribution: partially generic debugger with generated domain-
specific trace metamodel/manager
• Results: more efficient in time and memory than a clone-based
and weak omniscient debugger
• Perspectives:
• Domain-specific debugging services (cf. [Chiş et al., SLE 2014])
• Temporal properties to define breakpoints
• Support external stimuli / concurrency in operational semantics
• User study to validate the benefits of (multidimensional) omniscient
debugging for designers
Efficient and Advanced Omniscient Debugging for xDSMLs (SLE’15)