Skip to main content

Blueprint Model Debugger

How MDB works: a user drives mdb to run and debug scenarios against the MX execution engine, producing a sequence diagram and execution log from a system execution directory.

An interactive debugger for Shlaer-Mellor Executable UML models. MDB drives the MX model execution engine through user-defined scenarios, letting you step through model level interactions and inspect model properties such as current states, event queue status, and current instance populations and such.

Installation

pip install mi-mdb

Usage

mdb [-s <system>] [-p <playground>] [-x <scenario>] [-L] [-v] [-V]

All path arguments are optional at launch and can be set interactively once the debugger is running.

Argument Description
-s / --system Path to the system directory
-p / --playground Name of the playground to load
-x / --scenario Name of the scenario to run (without extension)
-L / --log Keep mdb.log after exit (deleted by default)
-v / --verbose Verbose console output
-V / --version Print version and exit

System directory structure

The system directory contains all artifacts needed to load and run a modeled system:

<system>/
    models/
        mmdb_<domain>.ral        - Populated SM metamodels, one per domain 
    playgrounds/                 - A playground is like a sandbox, as many as you like
        <playground_name>/       - Define one or more scenarios and one initial population
            scenarios/
                <scenario>.yaml  - The scenario name specified as a yaml file
            population/
                <domain>.ral     - A modeled domain populated with initial instances

A playground is a named initial context — a population of instances in known states from which scenarios are launched. Multiple playgrounds can be defined for the same system, and multiple scenarios can be defined for each playground.

Interactive commands

Once running, MDB presents a # prompt:

show path                   - Show the active system path
show playgrounds            - List all playgrounds defined in the system
show playground             - Show the active playground
show scenarios              - List all scenarios for the active playground
show states                 - Display the current state of all state machines
show step                   - Show stepping mode status
show descriptions           - Show descriptions mode status
set path <abs_path>         - Set the system directory path
set playground <name_or_#>  - Select a playground by name or list number
set scenario <name_or_#>    - Select a scenario by name or list number
set step                    - Toggle stepping mode
set descriptions            - Toggle printing of interaction descriptions
execute / exec / x          - Run the active scenario
help                        - Show available commands
quit / exit                 - Exit the debugger

Playgrounds and scenarios can be selected by the integer shortcut shown in their listing (e.g., set playground 2).

Running a scenario

In run-to-completion mode (default), MDB executes the full scenario and prints each interaction and any announcements triggered by the model engine.

In stepping mode (set step), MDB pauses after each interaction at a >: prompt:

[enter] / n / next / s / step  - Advance to the next interaction
show states                    - Inspect current state machine states
r / run                        - Switch to run-to-completion for the remainder
q / quit / abort               - Abort the scenario
h / help / ?                   - Show stepping commands

Scenario file format

Scenarios are YAML files placed in a playground's scenarios/ directory:

Actors:
  internal:
    <Domain>:
      <ActorName>:
        class: <ClassName>
        instance:
          <AttributeName>: <value>
  external:
    - <DomainName>

Interactions:
  - description: "Human-readable description of this step"
    direction: stimulus        # or: response
    action: signal instance    # or: external event
    name: <EventName>
    source: <Domain>:<ActorName>
    target: <Domain>:<ActorName>
    parameters:                # optional
      <ParamName>: <value>

Please look in the example elevator yaml file for more detailed documentation.

stimulus interactions inject an event into the system; response interactions pass control back to the model engine and collect any announcements it emits.

Development

For a code walkthrough of how MDB works internally — module map, control flow, and the boundary to the MX engine — see documentation/internals.md.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mi_mdb-0.2.0.tar.gz (19.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mi_mdb-0.2.0-py3-none-any.whl (20.2 kB view details)

Uploaded Python 3

File details

Details for the file mi_mdb-0.2.0.tar.gz.

File metadata

  • Download URL: mi_mdb-0.2.0.tar.gz
  • Upload date:
  • Size: 19.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for mi_mdb-0.2.0.tar.gz
Algorithm Hash digest
SHA256 35382dff706851aa5258e9dd976c6eb52f0d0eaee16d02dc12d98a77dd9cd2b5
MD5 75da57f498a6c81dc25f8fe206f90386
BLAKE2b-256 ad994cd73986eed62b9f2715c45e36574bab891098ce0af0e38ca9310df012c1

See more details on using hashes here.

File details

Details for the file mi_mdb-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: mi_mdb-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 20.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for mi_mdb-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cc8c26ba8dcf208f32bdb91fe868e6a0bbfdf3f60a1244ede103fe617e144e24
MD5 eeb736cb60325cb5fd8bc1a8b7d39010
BLAKE2b-256 fdaa18bda856e0157db197ba4a0da6ed144eabe08a022769c0f38335c7ab1241

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page