Local reasoning
Local reasoning is a technique for determining a component’s behavior from its locally visible inputs, outputs, definition, and dependencies.
Functional Programming in Scala, Second Edition
Local reasoning is analyzing a component from its definition and inputs without tracking unrelated execution history or state changes.
- How it is used
- Uses purity and substitution to understand components without simulating unrelated state changes or execution history.
- How deep it goes
- Explains substitution, mutation, context dependence, and explicit error values, but stops short of formal proof techniques.
- Examples
- Contrasts immutable string reversal, mutable StringBuilder appends, impure payment processing, and exceptions caught in different contexts.
- What you can do after
- Evaluate/understand pure components by substituting inputs, spotting context-dependent effects, and choosing explicit error representations.
Read how Functional Programming in Scala, Second Edition explains local reasoning →
Data-Oriented Programming in Java
A reasoning technique that determines a computation's behavior from its locally visible inputs, outputs, and dependencies.
- How it is used
- Uses explicit inputs and outputs to make computation and its tests understandable without tracing surrounding state.
- How deep it goes
- Explains isolation, input-output behavior, and test consequences, but stops short of implementation patterns or formal guarantees.
- Examples
- Uses Java methods, surrounding instance state and services, input-output mappings, and test setup as concrete contrasts.
- What you can do after
- Diagnose/debug with it by tracing visible inputs and outputs instead of reconstructing distributed state and hidden setup.
Read how Data-Oriented Programming in Java explains local reasoning →
Related concepts
- test setupcontrasts with · Test setup is the preparation of data, dependencies, state, and execution conditions required before a software test runs.
- inputuses · An input is information, a value, or an action supplied to a system, program, or computation for processing or to influence its behavior.
- outputuses · An output is a result, value, message, or action produced or returned by a system or operation in response to input or a request.
- functional programmingproduced by · Functional programming is a programming paradigm that expresses computation through the evaluation and composition of functions, typically favoring immutable data and minimizing mutable state and side effects.
- software testingused by · Software testing is the systematic evaluation of software under specified inputs or conditions to assess its behavior against expected results or requirements and identify defects.
- principle of least powerproduced by · The principle of least power is the design principle of exposing only the minimal functionality required by a program.
Questions about local reasoning
What is local reasoning?
Local reasoning is a technique for determining a component’s behavior from its locally visible inputs, outputs, definition, and dependencies.
Which Manning books explain local reasoning?
Functional Programming in Scala, Second Edition and Data-Oriented Programming in Java.
What is the difference between local reasoning and test setup?
Local reasoning is a technique for determining a component’s behavior from its locally visible inputs, outputs, definition, and dependencies. Test setup is the preparation of data, dependencies, state, and execution conditions required before a software test runs.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

