liveBook · Manning

Reproducibility

As explained in Data-Oriented Programming: Reduce software complexity

Reproducibility is the ability to recreate the behavior of a computation in another environment using the same relevant inputs and conditions.

Reproducibility means capturing a function’s context so its behavior can be recreated elsewhere. With immutable data, that context is the values of its arguments: the same values produce the same result. section 15.1 section 15.7

Imagine debugging a web search. You trigger an endpoint, but the failing function sits deeper in the call stack. A breakpoint reveals a query and a huge nested catalog; copying those values into a REPL lets you investigate without repeatedly invoking the endpoint. section 15.1

A practical reproducibility loop looks like this:

  • Capture the function arguments when the real scenario occurs. section 15.3
  • Serialize complex data, such as nested maps, so it can be copied or stored. section 15.1 section 15.7
  • Replay the call in a pristine REPL environment and iterate with a short feedback loop. section 15.3
  • Store captured inputs with the tests when they expose useful production conditions. section 15.4

Replaying a book-search failure

Capture catalogData and query when Catalog.searchBooksByTitle runs. Replaying the captured catalog with "Habit" exposes an empty result; after changing matching behavior, the same fixture returns 7 Habits of Highly Effective People. The fixture can then drive tests for case variations and valid or invalid prefixes. section 15.3 section 15.4

External data complicates the promise. A changing database or service can return a different response for the same query. Immutable or append-only databases preserve reproducibility by querying unchanging snapshots; otherwise, local debugging depends on the data remaining stable. section 15.5

Table 15.1 REPLs per programming language (view table figure)

JavaScript (Browser)

Browser console

Node.js

Node CLI

Java

JShell

C#

C# REPL

Python

Python interpreter

Ruby

Interactive Ruby

Use a language REPL to execute captured calls interactively; available examples include browser JavaScript, Node.js, JShell, C# REPL, Python, and Ruby. section 15.1

How Data-Oriented Programming: Reduce software complexity covers it

How deep it goes
Explains deterministic arguments, serialization, REPL replay, test fixtures, and external-data limits, but does not develop formal theory.
Examples
Uses a nested book catalog, captured JSON arguments, REPL experiments, and unit tests for matching queries.
What it assumes
Assumes functions and endpoint debugging, while teaching function context, REPL use, serialization, and immutable-data reasoning.
What you can do after
Diagnose/debug with it by capturing inputs, replaying calls, refining behavior, and converting scenarios into repeatable tests.
How it connects
Connects immutability, determinism, serialization, REPLs, debugging, unit testing, and database snapshots.

Also explained in

Compare how 8 books explain reproducibility →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Data-Oriented Programming: Reduce software complexity. The section links point to the parts of the book it draws on.