From 2d4701b4c823bd8e8059adb220eede2d0bdf35c6 Mon Sep 17 00:00:00 2001 From: Hau Nguyen Date: Wed, 24 Jan 2024 12:51:38 +0700 Subject: [PATCH] feat: draft test --- docs/2024-01-20-backend-thinking.html | 54 +++++++++++++++++++-------- posts/2024-01-20-backend-thinking.md | 30 +++++++++------ 2 files changed, 58 insertions(+), 26 deletions(-) diff --git a/docs/2024-01-20-backend-thinking.html b/docs/2024-01-20-backend-thinking.html index 166e780..f260b5e 100644 --- a/docs/2024-01-20-backend-thinking.html +++ b/docs/2024-01-20-backend-thinking.html @@ -109,8 +109,8 @@ processing, ...

- Example: UM (Team User Management Core) has 10+ Java services and - 30+ Go services. + Example: Team UM (User Management) has 10+ Java services and 30+ + Go services.

The question is for each new business requirements, what should we do: @@ -366,9 +366,8 @@ code is actually what we think/expect.

- Best case scenerio is test with real dependencies (real servives, real - Redis, real MySQL, real Kafka, ...). But it's not easy way to setup - yourself. + Best case is test with real dependencies (real servives, real Redis, real + MySQL, real Kafka, ...). But it's not easy way to setup yourself.

The easier way is to use mocks. Mock all dependencies to test all possible @@ -391,17 +390,34 @@

  • - Integration tests in 2 ways: + Integration tests is to test your system as a whole package, can be in 2 + ways:
  • TODO: Show example

    +

    How to make code easier to test. Same idea loosely coupled as above.

    +

    Some tips:

    +

    Known concept + >System Design

    -

    TODO: Cache strategy, async operation

    Challenge + >Performance +

    +

    + Security

    -

    TODO: Scale problem