@@ -23,6 +23,48 @@ To complete
2323To complete
2424-->
2525
26+ ### 4. Guidelines for crate test utilities
27+
28+ ** Date:** 2025-07-25
29+ ** Status:** Accepted
30+
31+ ### Context
32+
33+ - Testing requires reusable utilities that may need to be shared across crates
34+ - Test utilities should be isolated from production code while remaining accessible to child crates
35+ - We need to minimize feature flags to optimize Rust compiler artifact reuse and reduce build times
36+
37+ ### Decision
38+
39+ Test utilities must follow this organizational structure:
40+
41+ ** Core Rules:**
42+
43+ 1 . All test utilities belong in a dedicated ` test ` module within each crate
44+ 2 . Utilities become public only when used by child crates or integration tests
45+ 3 . Public test utilities must not introduce additional dependencies
46+ 4 . Private test utilities are gated behind ` cfg(test) `
47+ 5 . Import paths must explicitly include ` test ` modules to prevent accidental production usage
48+ 6 . Feature flags are prohibited for test utility isolation
49+
50+ ** Module Organization:**
51+
52+ - ** Test doubles** (mocks, fakes, stubs): ` test::double ` module
53+ - ** Test data builders** : ` test::builder ` module
54+ - ** Test-only type extensions** : Extension traits in ` test ` module
55+ - Trait names end with ` TestExtension `
56+ - Implementations follow trait definitions, except when accessing private fields
57+
58+ #### Consequences
59+
60+ - Consistent codebase organization across all crates
61+ - Clear separation between production and test code
62+ - Improved discoverability and maintainability of test utilities
63+ - Reduced build times through minimal feature flag usage
64+ - Enhanced reusability of test utilities across child crates
65+
66+ ---
67+
2668### 3. Guidelines for Dummy Test Doubles
2769
2870** Date:** 2025-07-22
@@ -51,7 +93,7 @@ The following guidelines will be adopted for implementing the `Dummy` trait:
5193
5294---
5395
54- ## 2. Remove Artifacts serialization support when compiling to WebAssembly
96+ ## 2. Remove artifacts serialization support when compiling to WebAssembly
5597
5698date: 2025-02-26
5799status: Accepted
@@ -88,7 +130,7 @@ In the future, if we need to serialize and deserialize Artifacts in WebAssembly,
88130
89131---
90132
91- ## 1. Record Architecture Decisions
133+ ## 1. Record architecture decisions
92134
93135date: 2025-02-26
94136status: Accepted
0 commit comments