Testing Standard¶
Executive Summary¶
Testing Standard defines the engineering testing expectations for the Spring Boot Modulith.
Test Layers¶
| Test Type | Purpose |
|---|---|
| Domain tests | Validate aggregates, value objects, policies, and domain services. |
| Application service tests | Validate use-case orchestration, security context, events, repositories, and AIOS boundaries. |
| Repository tests | Validate module-owned persistence behavior and tenant filtering. |
| API tests | Validate request handling, authorization, DTO mapping, and error behavior. |
| Event tests | Validate event publication, consumption, idempotency, and metadata. |
| Spring Modulith tests | Verify module boundaries, allowed dependencies, and event interactions. |
| Contract tests | Validate module API or integration contracts where approved. |
Spring Modulith Test Guidance¶
| Area | Requirement |
|---|---|
| Module boundary verification | Tests should fail when forbidden dependencies appear. |
| Application module tests | Each module should have focused tests for exposed application behavior. |
| Event publication tests | Verify that accepted commands publish expected events. |
| Event consumption tests | Verify idempotent reaction to subscribed events. |
| Architecture tests | Enforce package and dependency rules. |
Boundary Verification Checklist¶
- No module imports another module's repository.
- No module imports another module's aggregate or entity.
- No module writes another module's database ownership area.
- Shared kernel contains only approved primitives.
- AIOS interactions go through approved application services.
- Tenant and organization context are tested for customer-scoped behavior.
Non-Goals¶
This document does not define test framework code, annotations, fixtures, coverage thresholds, or CI configuration.