Factories
Factories generate entities on demand based on templated or predetermined initialization criteria. We most commonly think of the Gang of Four Abstract Factory [DP] pattern in this role. Other factories exist, including Factory Method and Builder [DP].
Each approach and implementation has distinct characteristics to satisfy its target use case. The key features for consideration in testing are summarized here.
• Singleton-ness: Is the factory a singleton that will, by its nature, be shared between tests?
• Entity initialization flexibility: Does the implementation have sufficient mechanisms to initialize generated entities for the necessary testing variations?
• Registration management: Does the factory allow generated entity types ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access