26
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

Efficient and Advanced Omniscient Debugging for xDSMLs (SLE 2015)

Embed Size (px)

Citation preview

Erwan Bousse, Jonathan Corley, Benoit Combemale, Jeff Gray and Benoit Baudry

Companion webpage: http://gemoc.org/sle15-omniscientdebugging

Efficient and Advanced Omniscient Debugging for xDSMLs8th ACM SIGPLAN Int'l Conf. on Software Language Engineering (SLE 2015) Pittsburgh, PA, USAOctober 27, 2015

(Domain-Specific) Behavioral models

Efficient and Advanced Omniscient Debugging for xDSMLs (SLE’15) - 2

• Various engineering: software engineering, systems engineering, enterprise architecture, scientificmodeling...

• Various domains: Business Processes, Orchestrations, Functional chains, Activities, Protocoles, Scenarios...

• Various analysis techniques for checking behavioral properties (earlyV&V)

Stepwise debugging

- 3

• Stepwise Debugging: find the cause of a defect by manuallyobserving and controlling execution

• Central dynamic V&V activity

Resume

StopPause

Step intoStep over

Step out

Visualization ofthe current state

Breakpoints

Efficient and Advanced Omniscient Debugging for xDSMLs (SLE’15)

Stepwise debugging

- 4

• Intuitive model comprehension technique• No abstraction gap• Better turn-arounds

⇒ Fast convergence towards an acceptable designResume

StopPause

Step intoStep over

Step out

Visualization ofthe current state

Breakpoints

Efficient and Advanced Omniscient Debugging for xDSMLs (SLE’15)

Omniscient debugging

- 5

• Stepwise debuggers only go forward

• Omniscient debuggers go forward and backward

• Omniscient debuggers typically rely on an execution tracestoring previous states.

Efficient and Advanced Omniscient Debugging for xDSMLs (SLE’15)

Brief recap about the terminology

- 6

Weak omniscient debugging,ie., restart the execution (without any trace)

Omniscient debugging(with an execution trace)

Multidimensionalomniscient debugging(part of our contribution)

Multidimensionalexploration

Backwardexploration

Stepwise debugging

Deterministic,without engine

restart

Forwardexploration

Efficient and Advanced Omniscient Debugging for xDSMLs (SLE’15)

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)

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

input1..*output1..*

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)

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)

Challenges

- 10

• Generic omniscient debugger supporting any xDSML?

• Two key problems:1. Genericity requires additional processing (e.g., introspection)

impacting responsiveness2. Execution states of an xDSML can be arbitrarily complex,

impacting understandability

Efficient and Advanced Omniscient Debugging for xDSMLs (SLE’15)

Approach overview

- 11

Solution: partially generic debugger including

1. Efficient generated domain-specific trace management facilities(for better responsiveness)

2. Advanced multidimensional omniscient debugging services (for better understandability)

Efficient and Advanced Omniscient Debugging for xDSMLs (SLE’15)

1- Efficient Omniscient Debugging

- 12

Generated trace Manager/metamodel and Generic execution engine and debugger

ExecutionMetamodel

DS Trace Manager(generated)

xDSML

Depends on /Uses

conf.to

ProducesModifies

Generators

OperationalSemantics

Generic Multidim.OmniscientDebugger

ExecutionEngine

ExecutableModel

conf.to

TraceMetamodelInterface

StateManager

DS TraceMetamodel(generated)

Domain-Specific (DS)

Execution Trace

TraceConstructor

Efficient and Advanced Omniscient Debugging for xDSMLs (SLE’15)

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 executiontrace)

• 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)

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 advancedomniscient debugging services

Efficient and Advanced Omniscient Debugging for xDSMLs (SLE’15)

2- Advanced Omniscient Debugging

- 15

• Stepwise modified for Omniscient Traversal• Play, Pause, Stop, StepInto, StepOut, StepOver

• Omniscient Traversal Features mirroring Stepwise• PlayBack, BackInto, BackOut, BackOver

• Advanced Omniscient Multidimensional Traversal• StepByValue, BackStepByValue

Efficient and Advanced Omniscient Debugging for xDSMLs (SLE’15)

2- Advanced Omniscient Debugging

- 16

p1

p3

p2p4

p5

t1

t2

t3

Bfire(t1) fire(t2)

run(net)

p1

p3

p2p4

p5

t1

t2

t3

A

p1

p3

p2p4

p5

t1

t2

t3

CModelStates

P1Values

P2Values

P3Values

P4Values

Efficient and Advanced Omniscient Debugging for xDSMLs (SLE’15)

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)

Implementation within the GEMOC Studio

- 18Efficient and Advanced Omniscient Debugging for xDSMLs (SLE’15)

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

• 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

Activity Diagram Debugger

https://github.com/gemoc/activitydiagram

Efficient and Advanced Omniscient Debugging for xDSMLs (SLE’15)

- 21

Arduino Designer (& Debugger)

https://github.com/gemoc/arduinomodeling

Efficient and Advanced Omniscient Debugging for xDSMLs (SLE’15)

- 22

https://github.com/gemoc/farmingmodeling

Farming System Modeling

Efficient and Advanced Omniscient Debugging for xDSMLs (SLE’15)

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)

Evaluation

- 24

• fUML xDSML implemented using Kermeta and Ecore within the GEMOC Studio

• fUML models from the semantic differencing case study of Maozet 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)

Evaluation

- 25

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 200.1

1

10

100

TIM

E (M

S)

21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 400.1

1

10

100

TIM

E (M

S)

MultiDimDebugger CloneBasedDebugger WeakDebugger

Efficiencyin memory

Efficiencyin time

Efficient and Advanced Omniscient Debugging for xDSMLs (SLE’15)

Conclusion and Perspectives

- 26

• Context: Omniscient debugging is a powerful dynamic V&V approach for designers

• Problem: Handling any xDSML is difficult because of efficiencyand understandability

• Contribution: partially generic debugger with generated domain-specific trace metamodel/manager

• Results: more efficient in time and memory than a clone-basedand 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)