From 2ea836e55aad4238f610b19e97543b4a53e2e5a6 Mon Sep 17 00:00:00 2001 From: Asiel Leal Celdeiro <15990580+lealceldeiro@users.noreply.github.com> Date: Mon, 11 Sep 2023 13:59:43 +0300 Subject: [PATCH] Add notes from "Clean Craftsmanship" --- CleanCraftsmanship/README.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/CleanCraftsmanship/README.md b/CleanCraftsmanship/README.md index fa165c1..7ce7dd7 100644 --- a/CleanCraftsmanship/README.md +++ b/CleanCraftsmanship/README.md @@ -43,7 +43,7 @@ The essence of TDD entails the discipline to do the following: - Create tests and production code that are sufficiently decoupled from each other so as to allow convenient maintenance of both, without the impediment of replicating changes between the two. -### The Three Laws of TDD +#### The Three Laws of TDD 1. The First Law: Write no production code until you have first written a test that fails due to the lack of that production code. @@ -60,7 +60,7 @@ Benefits of applying these three laws: - You will produce a test suite that will give you the confidence to deploy. - You will create less-coupled designs. -### The fourth law +#### The fourth law Refactoring: First you write a small amount of failing test code. Then you write a small amount of passing production code. Then you clean up the mess you just made. @@ -95,6 +95,15 @@ The computation is performed elsewhere. Rule 6: When the code feels wrong, fix the design before proceeding. +### Chapter 3: Advanced TDD + +Rule 7: Exhaust the current simpler case before testing the next more complex case. + +Rule 8: If you must implement too much to get the current test to pass, delete that test and write a simpler test +that you can more easily pass. + +Rule 9: Follow a deliberate and incremental pattern that covers the test space. + ## Part I: Standards ## Part I: Ethics