From 33d62a96da1ab57580bd02378bfca28f4329b6db Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Mon, 23 Jan 2023 03:26:53 +0400 Subject: [PATCH] Update src/roadmaps/software-design-architecture/content/100-clean-code-principles/110-keep-tests-independent.md --- .../110-keep-tests-independent.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/roadmaps/software-design-architecture/content/100-clean-code-principles/110-keep-tests-independent.md b/src/roadmaps/software-design-architecture/content/100-clean-code-principles/110-keep-tests-independent.md index 72f1b92ba..894ebf240 100644 --- a/src/roadmaps/software-design-architecture/content/100-clean-code-principles/110-keep-tests-independent.md +++ b/src/roadmaps/software-design-architecture/content/100-clean-code-principles/110-keep-tests-independent.md @@ -4,14 +4,13 @@ Keeping tests independent helps ensures that the tests are reliable, repeatable, Here are some ways to keep tests independent in system architecture: -1. Use dependency injection to decouple the test code from the application code. This allows the tests to be run without the need to instantiate the application objects directly. -2. Use mocks or stubs to isolate the test from external dependencies such as databases, APIs, or other services. -3. Use test data that is self-contained and does not rely on external data or state. -4. Use a test framework that supports running tests in parallel, so that the tests can be run independently of each other. -5. Use test-driven development (TDD), which involves writing tests before writing the application code. This ensures that the tests are independent and that the code is written with testability in mind. -6. Avoid global state and shared mutable state as it may cause unexpected results. +- Use dependency injection to decouple the test code from the application code. This allows the tests to be run without the need to instantiate the application objects directly. +- Use mocks or stubs to isolate the test from external dependencies such as databases, APIs, or other services. +- Use test data that is self-contained and does not rely on external data or state. +- Use a test framework that supports running tests in parallel, so that the tests can be run independently of each other. +- Use test-driven development (TDD), which involves writing tests before writing the application code. This ensures that the tests are independent and that the code is written with testability in mind. +- Avoid global state and shared mutable state as it may cause unexpected results. -By following these best practices, the system architecture will be more maintainable, testable, and less error-prone, and it will be easier to run and manage the tests. Learn more from the following links: