From 6fcd94f813ae09aae33b1222bc1471b8e0bc1cff Mon Sep 17 00:00:00 2001 From: Hau Nguyen Date: Wed, 24 Jan 2024 11:38:03 +0700 Subject: [PATCH] feat: draft testing --- docs/2024-01-20-backend-thinking.html | 46 ++++++++++++++++++++------- posts/2024-01-20-backend-thinking.md | 23 ++++++++------ 2 files changed, 48 insertions(+), 21 deletions(-) diff --git a/docs/2024-01-20-backend-thinking.html b/docs/2024-01-20-backend-thinking.html index d74b89e..166e780 100644 --- a/docs/2024-01-20-backend-thinking.html +++ b/docs/2024-01-20-backend-thinking.html @@ -294,13 +294,13 @@

All of these above are industry standard.

Write code to delete + >Write code that is easy delete

The way business moving is fast, so a feature is maybe implemented today, @@ -353,17 +353,17 @@

Write code to test + >Write code that is easy to test

Test is not a way to find bug, test is a way for us to make sure what we - code is actually what we think. + code is actually what we think/expect.

Best case scenerio is test with real dependencies (real servives, real @@ -374,12 +374,34 @@ The easier way is to use mocks. Mock all dependencies to test all possible edge cases you can think of.

+

TODO: Show example

-

- Same solution is to keep our code loosely coupled as much as possible. -

-

Each function/ should be contained.

-

Not all