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
Use the diagram to relate individual happy-path and edge-case tests to the test suite that verifies a SUT. section 7.2.1



