liveBook · Manning

Local reasoning

Local reasoning is a technique for determining a component’s behavior from its locally visible inputs, outputs, definition, and dependencies.

How 2 Manning books explain it

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

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.