liveBook · Manning

System under test

As explained in gRPC Microservices in Go

A system under test is the software element whose behavior is being evaluated, ranging from a class or layer to an entire application.

A system under test (SUT) is the software element whose behavior a test evaluates. Depending on the testing strategy, it can be a class, an architectural layer, a service, or an entire application. A test supplies inputs and execution conditions, then compares actual behavior with expected results. section 7.2.1

A test commonly follows four phases:

  • Setup: prepare dependencies and initialize the SUT, potentially including a MySQL database. section 7.2.2
  • Invoke: call the operation being tested, such as a class method or service function. section 7.2.2
  • Verify: compare actual and expected results with assertions. section 7.2.2
  • Teardown: release resources that are no longer needed; simple tests may omit setup and teardown. section 7.2.2

A test suite groups related tests around one SUT. It can include a happy path and several edge cases, making the required behavior explicit rather than checking only one successful execution. section 7.2.1

Testing an Order service

To test PlaceOrder in the Order service, mock its Payment service and database dependencies. Interfaces such as PaymentPort and DBPort allow the test to control dependency behavior while focusing on the Order service. This avoids the slower setup required by real dependent systems and provides fast feedback. section 7.2.3

Figure 7.2 A test suite is formed by a set of related tests, and its goal is to verify a SUT.

Use the diagram to relate individual happy-path and edge-case tests to the test suite that verifies a SUT. section 7.2.1

How gRPC Microservices in Go covers it

How deep it goes
Defines scope and test phases, then stops short of prescribing one testing strategy or dependency setup.
Examples
Uses Fibonacci testing, an Order service, MySQL dependencies, test containers, and mocked PaymentPort and DBPort interfaces.
What it assumes
Assumes basic testing concepts but teaches the target boundary, setup–invoke–verify–teardown workflow, and dependency isolation.
What you can do after
Evaluate/understand behavior by isolating a target, controlling dependencies, and verifying expected results across test scenarios.
How it connects
Connects SUTs with test suites, unit testing, integration testing, end-to-end testing, hexagonal architecture, and mocking.

Also explained in

Compare how 4 books explain system under test →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of gRPC Microservices in Go. The section links point to the parts of the book it draws on.