liveBook · Manning

Synchronous testing

Synchronous testing is a technique that tests behavior in a controlled, sequential execution context without exercising asynchronous interactions.

How 2 Manning books explain it

Effective Behavior-Driven Development

A testing pattern that runs an asynchronous operation synchronously when asynchrony is not the behavior under test.

How it is used
Simplifies tests that depend on asynchronous resources when completion timing is not itself under test.
How deep it goes
Defines the pattern, gives a stubbed time-service example, and warns that synchronous execution can hide concurrency defects.
Examples
Uses a background job and a stub time service that fires events immediately.
What you can do after
Apply it by running normally asynchronous work synchronously when timing is incidental, while assessing risks from the changed execution mode.

Read how Effective Behavior-Driven Development explains synchronous testing →

Akka in Action, Second Edition

Synchronous actor testing is a sequential technique for testing an actor in isolation in a controlled environment without exercising asynchronous interactions.

How it is used
Tests an actor's internal logic in isolation when sequential, deterministic execution is sufficient.
How deep it goes
Explains white-box checks of effects, received messages, and logs, while stopping short of asynchronous, timer, scheduler, and real-actor interactions.
Examples
Uses BehaviorTestKit for execution effects and TestInbox for probing messages sent to an ActorRef.
What you can do after
Apply it via BehaviorTestKit and TestInbox to assert actor effects, message reception, and logs sequentially.

Read how Akka in Action, Second Edition explains synchronous testing →

What to know first

Related concepts

Questions about synchronous testing

What is synchronous testing?

Synchronous testing is a technique that tests behavior in a controlled, sequential execution context without exercising asynchronous interactions.

Which Manning books explain synchronous testing?

Effective Behavior-Driven Development and Akka in Action, Second Edition.

What should I know before learning synchronous testing?

Manning books that teach synchronous testing usually introduce asynchronous programming first.

What is the difference between synchronous testing and asynchronous programming?

Synchronous testing is a technique that tests behavior in a controlled, sequential execution context without exercising asynchronous interactions. Asynchronous programming structures operations so that the initiating execution can continue or yield control without synchronously waiting for each operation to complete.

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.