From a4edce4145a4a4193b607af46cc366347176fd7d Mon Sep 17 00:00:00 2001 From: "Matheus D. Santos" <67028798+MatheusDSantossi@users.noreply.github.com> Date: Mon, 12 Jan 2026 13:21:00 -0300 Subject: [PATCH] Revise section on fast and independent tests (#9534) Added principles for fast and independent tests to enhance understanding of testing best practices. --- ...t-and-independent@mzt7fvx6ab3tmG1R1NcLO.md | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/data/roadmaps/software-design-architecture/content/tests-should-be-fast-and-independent@mzt7fvx6ab3tmG1R1NcLO.md b/src/data/roadmaps/software-design-architecture/content/tests-should-be-fast-and-independent@mzt7fvx6ab3tmG1R1NcLO.md index 847631cad..1239b2071 100644 --- a/src/data/roadmaps/software-design-architecture/content/tests-should-be-fast-and-independent@mzt7fvx6ab3tmG1R1NcLO.md +++ b/src/data/roadmaps/software-design-architecture/content/tests-should-be-fast-and-independent@mzt7fvx6ab3tmG1R1NcLO.md @@ -1 +1,27 @@ -# Tests should be fast and independent \ No newline at end of file +# Tests Should Be Fast and Independent + +Fast and independent tests are a cornerstone of reliable and maintainable software. They enable developers to run tests frequently, get quick feedback, and trust the results. When tests are slow or tightly coupled to each other or external systems, they become a bottleneck and reduce confidence in the codebase. + +Well-designed tests focus on validating behavior in isolation and execute quickly enough to be run as part of everyday development. + +Some of the key principles of fast and independent tests include: + +* Speed: Tests should execute quickly so they can be run frequently during development. +* Independence: Each test should run in isolation and not depend on the outcome or state of other tests. +* Determinism: Tests should produce the same result every time they are run. +* Isolation: External dependencies (databases, APIs, file systems, time) should be mocked or stubbed. +* Single Responsibility: Each test should verify one behavior or scenario. +* Easy Setup and Teardown: Tests should have minimal and clear setup logic. +* Reliability: Tests should fail only when the code under test is broken, not due to environment issues. +* Automation Friendly: Tests should be easy to run in CI/CD pipelines without special configuration. +* Maintainability: Tests should be easy to read, understand, and update as the code evolves. +* Feedback-Oriented: Test failures should provide clear and actionable feedback. + +Fast and independent tests improve developer productivity, encourage refactoring, and act as living documentation for the system’s behavior. + +Learn more from the following links: + +* [@article@Unit Testing Best Practices](https://martinfowler.com/articles/practical-test-pyramid.html) +* [@article@Test Pyramid Explained](https://martinfowler.com/bliki/TestPyramid.html) +* [@article@Writing Reliable Tests](https://testing.googleblog.com/2014/05/testing-on-toilet-how-much.html) +* [@feed@Explore top posts about Testing](https://app.daily.dev/tags/testing?ref=roadmapsh)