# Modeling Aggregates: Testable Units
> [!Note]
> Designing [[Aggregate]] as **isolated**, **unit-testable** components with comprehensive **operation validation**, **invariant checks**, and **full domain coverage** ensures robust and reliable domain logic.
[[Aggregate]] should be structured so that all public operations can be executed and verified in isolation, allowing teams to write focused **unit tests** without external dependencies. Each operation exposed by the aggregate must have explicit test cases that validate both normal behavior and edge conditions, guaranteeing that every **business invariant** is upheld. To achieve full confidence, tests should cover not only the [[Aggregate Root]] but also its internal [[Entities]] and [[Value Objects]], ensuring that every aspect of the model behaves correctly under all relevant scenarios.
---
## References
- Vernon, V. (2016). _Domain-driven design distilled_. Addison-Wesley Professional.
- Vernon, V. (2013). _Implementing domain-driven design_. Addison-Wesley Professional.
- Khononov, V. (2021). _Learning domain-driven design: Aligning software architecture and business strategy_. O’Reilly Media.
- Alammar, J., & Grootendorst, M. (2024). _Hands-on large language models: Language understanding and generation_. O’Reilly Media.
- Evans, E. (2003). _Domain-driven design: Tackling complexity in the heart of software_. Addison-Wesley Professional.
- Millett, S., & Tune, N. (2015). _Patterns, principles, and practices of domain-driven design._ Wrox.