Skip to content

Commit bead936

Browse files
committed
chore: Add a dev-adr about Dummy creation
1 parent ac80bdd commit bead936

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

DEV-ADR.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,34 @@ To complete
2323
To complete
2424
-->
2525

26+
### 3. Guidelines for Dummy Test Doubles
27+
28+
**Date:** 2025-07-22
29+
**Status:** Accepted
30+
31+
#### Context
32+
33+
The use of `dummy()` functions for creating test doubles is widespread across the codebase. However, inconsistencies
34+
in their placement and visibility have led to maintenance challenges and reduced code clarity.
35+
36+
#### Decision
37+
38+
A `Dummy` trait will be introduced, functioning similarly to Rust's `Default` trait.
39+
40+
The following guidelines will be adopted for implementing the `Dummy` trait:
41+
42+
1. Most implementations should reside in a `test::double::dummies` module within the crate where the type is defined.
43+
2. For types with non-public fields, the `Dummy` trait should be implemented directly below the type's definition.
44+
45+
#### Consequences
46+
47+
- Enhanced consistency in code organization.
48+
- Improved discoverability of test doubles.
49+
- Clearer distinction between production and test code.
50+
- Simplified maintenance of test implementations.
51+
52+
---
53+
2654
## 2. Remove Artifacts serialization support when compiling to WebAssembly
2755

2856
date: 2025-02-26

0 commit comments

Comments
 (0)