liveBook · Manning

Chapter 12: Integration Testing

What you will learn in chapter 12 of Data-Oriented Programming in Java

The introduction explains why integration tests matter for software that interacts with the world and why they are difficult to make reliable.

After this chapter you will be able to

What it builds on

Section by section

Introduction

The introduction explains why integration tests matter for software that interacts with the world and why they are difficult to make reliable.

Key terms: integration tests, unit test, edges of our system, integration testing, unreliable networks, service outages, race conditions, data corruption

12.1 Writing Integration Tests

Defines integration tests by their use of I/O, shows that they can take different shapes, and explains why testing real dependencies is valuable but hard to maintain.

Key terms: integration test, I/O, real dependencies, mocks, arrange, act, assert pattern, assert as you go, dependencies, distance, data-oriented approach

12.2 Drive your integration tests with data

The section shows how generating integration-test inputs from data makes tests easier to understand and the suite easier to adapt.

Key terms: integration tests, inputs, outputs, side-effects, hard coded file, provenance, generate, assertions, test data, support code

12.3 Impose algebraic properties on your dependencies

The section uses an algebraic model of task-state transitions to define and test the behavior a database must enforce.

Key terms: invariants, integration testing, dependencies, race conditions, ordering, irreflexive binary relation, terminal states, state machine, algebraic model

12.4 Embrace concurrency, beat up your software, and find bugs

This section explains why sequential integration tests can miss bugs that appear under load and how concurrent tests can expose them.

Key terms: example-based testing, arrange, act, assert, short codes, concurrently, concurrent tests, invariant, threads, determinism

12.5 Regularly prune redundant tests!

Explains why an integration test suite should shed tests that become redundant as the project matures.

Key terms: integration tests, anti-regression layer, invariants, higher-level API, redundant tests

12.6 Building a reliable integration test suite

The section shows how to make integration tests reliable by isolating their infrastructure, including when tests fail and leave resources behind.

Key terms: integration test, isolation, clean slate, on demand, isolated, ephemeral, actual services, randomization, namespace, stale resources

12.7 Wrapping up

This section closes the chapter by explaining why reliable integration tests are worth the difficulty and encouraging data-focused experimentation.

Key terms: integration tests, unit tests, correctness, data, Arrange, Act, Assert, randomization, concurrently

12.8 Summary

Concepts explained in this chapter

← Chapter 11: Data Oriented Testing

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.