Quantum Teleportation of Software

03.10.2013 Malcolm Newman

When it comes to the actual state of a running computer program that we want to diagnose, we are frequently plagued with the software equivalent of that great cornerstone of quantum theory, the Heisenberg Uncertainty Principle. In physics, this is the absolutely hard-wired guarantee of diagnostic uncertainty that prevents Newton's clockwork universe being our reality. In most non-trivial software programs, and especially those that are multi-threaded, the complex dynamics and speed of operation makes accurate and precise scrutiny of the changing state of the system similarly challenging. This makes it extremely difficult to analyse programs for subtle yet crucial defects that only occur under certain dynamic conditions.

Enter Quantum Teleportation of Software!

We use 'quantum' to describe software whose fundamental basis is just as for quantum theory found in nature - based upon distinct, independent states and transitions between them. Software that is built this way can be readily instrumented with a simple yet elegant tool that provides immense diagnostic value through all phases of the software lifecycle - design, implementation, testing, deployment, and the longest phase of all, support. This is the 'teleportation' part.

And here's how you build it in:

For every state that your software system can enter, including hierarchical and parallel thread executing systems, create a system wide enumeration to provide a unique identifier associated with each state (ideally matching each state name with a similar enumeration name). Then create a system wide function that is called once upon entry to every state, performing these three easy steps:

  1. Snapshot the system time using the highest resolution clock or CPU cycle counter available.
  2. Record the enumerated value matching the current state.
  3. Load the above two variables into a system-wide thread-safe cyclic buffer of timed state transition history for the system.

This history buffer (or log) can be of arbitrary length, which can be selected to suit the system operating time frame of interest, subject to constraints of available system memory. Depending on the system, this can be extended to stream periodically to an onboard or remote log file, with negligible impact on the rest of the system.

Now whenever some spurious event in your software is reported (or even suspected), the complete state of the system at any instant or over some interval of interest can be laid out with almost perfect chronology. Combined with some modest graphical analytic tools (common in spreadsheets), this provides levels of insight unmatched by most other inspection techniques.

Borrowing again from the inspiration of quantum physics, because this tool is built in to the normal system, it has the special advantage that the act of inspection does not disturb the experiment, unlike many others. This provides the ability to 'teleport' an almost perfect copy of system state to a remote location. This is similar to instances of quantum entanglement observed increasingly in the natural world, which Einstein called "spooky action at a distance".

Physics comparisons aside, when one of your creations located in some remote corner of this or another planetary body (or somewhere in between) is exhibiting unexpected behaviour, quantum teleportation of software may just be your last, best, hope ...