Skip to content

Commit 61bca6d

Browse files
committed
add info for naming without technical details
1 parent e8fbc1f commit 61bca6d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,17 @@ public function deactivating_an_inactive_subscription_is_invalid(): void
247247
:information_source: Describing the behavior is important in testing the domain scenarios.
248248
If your code is just a utility one it's less important.
249249

250+
:question: Why would it be useful for a non-programmer to read unit tests?
251+
252+
If there is a project with complex domain logic, this logic must be very clear for everyone,
253+
so then tests describe domain details without technical keywords, and you can talk with a business in a language like in these tests.
254+
255+
All code that is related to the domain should be free from technical details. A non-programmer won't be read these tests,
256+
but if you want to talk about the domain these tests will be useful to know what this domain does.
257+
There will be a description without technical details e.g. returns null, throws an exception, etc.
258+
This kind of information has nothing to do with the domain, so we shouldn't use these keywords.
259+
260+
250261
## AAA pattern
251262

252263
It's also common Given, When, Then.

0 commit comments

Comments
 (0)