Skip to content
IT glossary
TestingUpdated December 3, 2026

Integration testing

Интеграционное тестирование

This kind of software testing checks whether parts of a system work together, such as whether an app can save data to a database and read it back correctly.

What integration tests catch

A unit test can tell you that a function produces the expected value. It usually can't tell you whether another part of the system understands that value. For example, a background worker may handle a message correctly when given a hand-built sample, but fail on real messages because the publisher uses a different field name. An integration test exercises the handoff so it can catch that mismatch.

The boundary can be between modules in the same process, between an application and a database, or between services that communicate over HTTP or a message broker. An integration test doesn't have to run the whole product. An end-to-end test, by contrast, follows a complete workflow through the system's external interfaces.

Example: processing a message

Suppose a publisher sends a shipment update through RabbitMQ and a worker records the new status. Run the real publisher and worker with a test broker, then assert that the update was recorded. In pseudocode:

shipment_id = create_test_shipment()
publisher.send_shipped(shipment_id)
wait_until(timeout=5s, condition=lambda:
    shipment_store.status(shipment_id) == "shipped")

Checking only that the publish call returned would miss failures in routing or message decoding. The final status shows that the message reached the worker and was processed. Waiting for that condition with a deadline, rather than sleeping for five seconds, lets the test finish as soon as the result is available and fail if it never appears.

Choosing what to run for real

Keep the dependency that matters to the test. If you're testing PostgreSQL migrations or queries, use a disposable PostgreSQL instance rather than assuming an in-memory substitute behaves the same way. If the same test would normally send a notification through a third-party provider, a stub can stand in for that provider. The test then makes no claim about compatibility with the real notification API.

In CI, integration tests often have their own setup step to start dependencies and wait for them to be ready. Give tests independent data and isolate parallel runs where needed, for example with a separate queue per test worker. A test that passes only after another test has created a record is relying on execution order rather than proving that its own setup is sufficient.

What interviewers look for

Start with the failure you want to catch, then describe the smallest setup that can expose it. Use unit tests for cases like deciding which shipment statuses are valid, and use integration tests for cases like whether a valid status survives serialization and delivery. Explain what you'd assert and what your choice of test doubles leaves untested.