Time travel debugging or time traveling debugging is the process of stepping back in time through
source code
In computing, source code, or simply code, is any collection of code, with or without comments, written using a human-readable programming language, usually as plain text. The source code of a program is specially designed to facilitate the w ...
to understand what is happening during
execution
Capital punishment, also known as the death penalty, is the state-sanctioned practice of deliberately killing a person as a punishment for an actual or supposed crime, usually following an authorized, rule-governed process to conclude that ...
of a
computer program
A computer program is a sequence or set of instructions in a programming language for a computer to execute. Computer programs are one component of software, which also includes documentation and other intangible components.
A computer program ...
. Typically,
debugging and
debuggers
A debugger or debugging tool is a computer program used to test and debug other programs (the "target" program). The main use of a debugger is to run the target program under controlled conditions that permit the programmer to track its executi ...
, tools that assist a user with the process of debugging, allow users to pause the execution of running
software
Software is a set of computer programs and associated software documentation, documentation and data (computing), data. This is in contrast to Computer hardware, hardware, from which the system is built and which actually performs the work.
...
and inspect the current state of the program. Users can then step forward in time, stepping into or over
statements
Statement or statements may refer to: Common uses
*Statement (computer science), the smallest standalone element of an imperative programming language
*Statement (logic), declarative sentence that is either true or false
*Statement, a declarative ...
and proceeding in a forward direction. Interactive debuggers include the ability to modify code and step forward based on updated information.
Reverse debugging tools allow users to step backwards in time through the steps that resulted in reaching a particular point in the program. Time traveling debuggers provide these features and also allow users to interact with the program, changing the history if desired, and watch how the program responds.
Characteristics supporting bi-directional travel
There are several characteristics that support the ability to move backwards as well as forwards in time.
* Selecting a
purely functional programming
In computer science, purely functional programming usually designates a programming paradigm—a style of building the structure and elements of computer programs—that treats all computation as the evaluation of function (mathematics), mathemati ...
language helps due to the self-contained nature of
pure function
In computer programming, a pure function is a function that has the following properties:
# the function return values are identical for identical arguments (no variation with local static variables, non-local variables, mutable reference argume ...
s. Pure functions have no
side effects
In medicine, a side effect is an effect, whether therapeutic or adverse, that is secondary to the one intended; although the term is predominantly employed to describe adverse effects, it can also apply to beneficial, but unintended, consequence ...
and depend only on the information explicitly provided to the function, providing a repeatable, reliable, replayable path through the code.
* Languages and debuggers that enable
hot swapping
Hot swapping is the replacement or addition of components to a computer system without stopping, shutting down, or rebooting the system; hot plugging describes the addition of components only. Components which have such functionality are said ...
, the ability to modify code as the code is running, provide some of the requirements necessary to rewind, and potentially rewrite execution.
* Tools based on the
GNU debugger (GDB), available for compatible languages such as
C,
C++
C++ (pronounced "C plus plus") is a high-level general-purpose programming language created by Danish computer scientist Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significan ...
,
Go, and
Fortran are capable of reverse debugging, but the effort significantly slows interaction.
Time traveling debuggers
Examples of Debuggers with the ability to step backwards:
See also
*
Interactive computing
In computer science, interactive computing refers to software which accepts input from the user as it runs.
Interactive software includes commonly used programs, such as word processors or spreadsheet applications. By comparison, non-interactive ...
*
List of purely functional programming languages
References
*
*
Human–computer interaction
{{programming-software-stub