Changes for page Testable Design
Last modified by chrisby on 2024/09/19 10:50
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -9,7 +9,7 @@ 9 9 * Injectable promotes decoupling. Dependency injection allows for more flexible and extensible code through interchangeable dependencies. 10 10 * **Outsource code that is difficult to test.** For example, network connections to external services should not be part of unit or component tests and should therefore be mocked away. 11 11 12 -### 12 +### 13 13 14 14 ### Additional Details 15 15 ... ... @@ -25,10 +25,10 @@ 25 25 * Create distinct, small modules, each with unique functionality and responsibilities. This ensures that changes in one module are isolated from others. 26 26 * Maintain loose coupling: Minimize the dependencies between modules. 27 27 * Develop self-contained modules: Each module should be a self-contained unit of functionality. New features should be introduced by creating new modules. 28 -* **Avoid the singleton design pattern** because its private constructor prevents mocking. Consider a `getInstance()`method that returns an interface type instead.28 +* **Avoid the singleton design pattern** because its private constructor prevents mocking. Consider a getInstance() method that returns an interface type instead. 29 29 * **Favor composition over inheritance.** Use inheritance only for polymorphism, as it is less flexible than composition. Composition should be the primary approach to code reuse. 30 30 31 -### 31 +### 32 32 33 33 ### Testable Architecture 34 34