From 72f827f0522e2c24fadf6906eb201b132aa8f1f2 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Tue, 9 May 2023 23:55:09 +0100 Subject: [PATCH] daily-email: add 2023-05-08 --- src/content/daily-email/2023-05-08.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/content/daily-email/2023-05-08.md diff --git a/src/content/daily-email/2023-05-08.md b/src/content/daily-email/2023-05-08.md new file mode 100644 index 00000000..7693ba59 --- /dev/null +++ b/src/content/daily-email/2023-05-08.md @@ -0,0 +1,16 @@ +--- +title: > + Only write enough code to get a failing test +pubDate: 2023-05-08 +permalink: > + archive/2023/05/08/only-write-enough-code-to-get-a-failing-test +tags: + - automated-testing + - test-driven-development +--- + +Instead of writing a whole test and then attempting to make it pass, only write enough code to get the test to fail. + +This could be by starting with a failing assertion that is fixed with a hard-coded value and then iterating on the test to introduce the next failure before repeating the process. + +This allows you to keep the feedback loop small and not write more code than is needed, to focus on the objective of the test, and not code yourself into a corner.